Skip to content

Commit

Permalink
Replace noinspection instruction with proper @SuppressWarnings an…
Browse files Browse the repository at this point in the history
…notation

`//noinspection unchecked` suppresses unchecked cast warning only in the IDE. `@SuppressWarning` annotation properly suppresses both IDE and the compiler warnings.
  • Loading branch information
vkryl authored and levlam committed Feb 16, 2024
1 parent d93a99e commit d0ff90b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/java/org/drinkless/tdlib/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ public void send(TdApi.Function query, ResultHandler resultHandler) {
* @return request result.
* @throws ExecutionException if query execution fails.
*/
@SuppressWarnings("unchecked")
public static <T extends TdApi.Object> T execute(TdApi.Function<T> query) throws ExecutionException {
TdApi.Object object = nativeClientExecute(query);
if (object instanceof TdApi.Error) {
throw new ExecutionException((TdApi.Error) object);
}
//noinspection unchecked
return (T) object;
}

Expand Down

0 comments on commit d0ff90b

Please sign in to comment.