mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-164159 Nullability annotations don't work with generics
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
abstract class Foo {
|
||||
@NotNull
|
||||
abstract <T> T get(@NotNull Class<? extends T> type);
|
||||
|
||||
void foo(Field field) {
|
||||
Object value = get(field.getType());
|
||||
if (<warning descr="Condition 'value != null' is always 'true'">value != null</warning>) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface Field {
|
||||
Class<?> getType();
|
||||
}
|
||||
Reference in New Issue
Block a user