mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-166444 Good code yellow: Not annotated method with primitive return type is used as an override for a method annotated with NotNull
This commit is contained in:
+4
-2
@@ -3,7 +3,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
interface NonnullInterface {
|
||||
@NotNull
|
||||
String nonNullMethod();
|
||||
Object nonNullMethod();
|
||||
}
|
||||
|
||||
class P2 {
|
||||
@@ -17,7 +17,7 @@ class P2 {
|
||||
}
|
||||
});
|
||||
test(this::<warning descr="Method annotated with @Nullable must not override @NotNull method">getNull</warning>);
|
||||
test(this::<warning descr="Not annotated method is used as an override for a method annotated with NotNull">getNonAnnotated</warning>);
|
||||
test(this::getPrimitive);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -25,5 +25,7 @@ class P2 {
|
||||
|
||||
String getNonAnnotated() { return null; }
|
||||
|
||||
boolean getPrimitive() { return true; }
|
||||
|
||||
private void test(final NonnullInterface function) { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user