mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
util: (minor) Add proper @Contract to ObjectUtils.tryCast()
This commit is contained in:
@@ -79,7 +79,7 @@ public class ObjectUtils {
|
||||
return value == null ? defaultValue : value;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Contract("null, _ -> null")
|
||||
public static <T> T tryCast(@Nullable Object obj, @NotNull Class<T> clazz) {
|
||||
if (clazz.isInstance(obj)) {
|
||||
return clazz.cast(obj);
|
||||
|
||||
Reference in New Issue
Block a user