mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
Now start from annotations instead of type element or owner (process owners for external annotations only) Also, prefer TYPE_USE when reporting on primitive types GitOrigin-RevId: 90771f89eb68ed1446afa9bbfc9cc7938c321d26
25 lines
1006 B
Java
25 lines
1006 B
Java
import org.jetbrains.annotations.*;
|
|
|
|
class C {
|
|
public static C C = null;
|
|
@NotNull public C getC() {return C;}
|
|
@NotNull public C getC2() {return C;}
|
|
|
|
public void f1(@Nullable C p) {}
|
|
public void f2(@NotNull C p) {}
|
|
public void f3(@Nullable C p) {}
|
|
public void f4(@NotNull C p) {}
|
|
}
|
|
|
|
class CC extends C {
|
|
<warning descr="Method annotated with @Nullable must not override @NotNull method">@Nullable</warning> public C getC() {return C;}
|
|
public C <warning descr="Not annotated method overrides method annotated with @NotNull">getC2</warning>() {return C;}
|
|
|
|
public void f1(<warning descr="Parameter annotated @NotNull must not override @Nullable parameter">@NotNull</warning> C p) {}
|
|
public void f2(@NotNull C p) {}
|
|
public void f3(@Nullable C p) {}
|
|
public void f4(@Nullable C p) {}
|
|
|
|
<warning descr="Cannot annotate with both @Nullable and @NotNull">@Nullable</warning> <warning descr="Cannot annotate with both @NotNull and @Nullable">@NotNull</warning> String f() { return null;}
|
|
}
|