mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-01 20:52:37 +07:00
GitOrigin-RevId: 57043eab4896e7cead2c716ef2370fb2dd0ef810
32 lines
1.6 KiB
Java
32 lines
1.6 KiB
Java
import typeUse.*;
|
|
|
|
public class IncorrectPlacement extends <warning descr="Nullability annotation is not applicable to extends/implements clause">@Nullable</warning> Object
|
|
implements <warning descr="Nullability annotation is not applicable to extends/implements clause">@Nullable</warning> Cloneable {
|
|
|
|
interface X {
|
|
void test() throws <warning descr="Nullability annotation is not applicable to 'throws' clause">@Nullable</warning> Exception;
|
|
void test2() throws <warning descr="Nullability annotation is not applicable to 'throws' clause">@NotNull</warning> Exception;
|
|
}
|
|
|
|
<warning descr="Nullability annotation is not applicable to constructors">@Nullable</warning> IncorrectPlacement() {}
|
|
|
|
void test(<warning descr="Receiver parameter is inherently non-null">@Nullable</warning> IncorrectPlacement this) {
|
|
<warning descr="Outer type is inherently non-null">@Nullable</warning> IncorrectPlacement.Inner a1;
|
|
IncorrectPlacement.@Nullable Inner a2;
|
|
}
|
|
|
|
void fqn() {
|
|
<warning descr="Annotation on fully-qualified name must be placed before the last component">@Nullable</warning> java.lang.String[] strs;
|
|
}
|
|
|
|
<warning descr="Primitive type members cannot be annotated">@NotNull</warning> int[] data;
|
|
|
|
void testStaticNested() {
|
|
// No "Outer type is inherently non-null" warning. Reported error provides the same "Move annotation" fix.
|
|
<error descr="Static member qualifying type may not be annotated">@Nullable</error> IncorrectPlacement.StaticNested a1;
|
|
IncorrectPlacement.@Nullable StaticNested a2;
|
|
}
|
|
|
|
class Inner {}
|
|
static class StaticNested {}
|
|
} |