Replace `noinspection` instruction with proper `@SuppressWarnings` annotation
`//noinspection unchecked` suppresses unchecked cast warning only in the IDE. `@SuppressWarning` annotation properly suppresses both IDE and the compiler warnings.
This commit is contained in:
parent
d93a99e335
commit
d0ff90bb19
|
@ -119,12 +119,12 @@ public final class Client {
|
||||||
* @return request result.
|
* @return request result.
|
||||||
* @throws ExecutionException if query execution fails.
|
* @throws ExecutionException if query execution fails.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static <T extends TdApi.Object> T execute(TdApi.Function<T> query) throws ExecutionException {
|
public static <T extends TdApi.Object> T execute(TdApi.Function<T> query) throws ExecutionException {
|
||||||
TdApi.Object object = nativeClientExecute(query);
|
TdApi.Object object = nativeClientExecute(query);
|
||||||
if (object instanceof TdApi.Error) {
|
if (object instanceof TdApi.Error) {
|
||||||
throw new ExecutionException((TdApi.Error) object);
|
throw new ExecutionException((TdApi.Error) object);
|
||||||
}
|
}
|
||||||
//noinspection unchecked
|
|
||||||
return (T) object;
|
return (T) object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue