1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.signedness.qual.Unsigned;
public class AnnoBeforeModifier {
// :: warning: (type.anno.before.modifier)
@Unsigned public int i = 0;
public @Unsigned int j = 0;
// :: warning: (type.anno.before.modifier)
public @Unsigned final int k = 0;
@SuppressWarnings("foobar")
@Unsigned public int l = 0;
public @SuppressWarnings("foobar") @Unsigned int m = 0;
@SuppressWarnings("foobar")
@Unsigned public int n = 0;
// TODO: :: warning: (type.anno.before.modifier)
public @SuppressWarnings("foobar") @Unsigned final int o = 0;
// :: warning: (type.anno.before.decl.anno) :: warning: (type.anno.before.modifier)
public @Unsigned @SuppressWarnings("foobar") final int p = 0;
public @SuppressWarnings("foobar") final @Unsigned int q = 0;
@SuppressWarnings("foobar")
public int r = 0;
public @SuppressWarnings("foobar") int s = 0;
public @SuppressWarnings("foobar") final int t = 0;
// :: warning: (type.anno.before.modifier)
@Unsigned public int iMethod() {
return 0;
}
public @Unsigned int jMethod() {
return 0;
}
// :: warning: (type.anno.before.modifier)
public @Unsigned final int kMethod() {
return 0;
}
@SuppressWarnings("foobar")
@Unsigned public int lMethod() {
return 0;
}
public @SuppressWarnings("foobar") @Unsigned int mMethod() {
return 0;
}
@SuppressWarnings("foobar")
@Unsigned public int nMethod() {
return 0;
}
// TODO: :: warning: (type.anno.before.modifier)
public @SuppressWarnings("foobar") @Unsigned final int oMethod() {
return 0;
}
// :: warning: (type.anno.before.decl.anno) :: warning: (type.anno.before.modifier)
public @Unsigned @SuppressWarnings("foobar") final int pMethod() {
return 0;
}
public @SuppressWarnings("foobar") final @Unsigned int qMethod() {
return 0;
}
@SuppressWarnings("foobar")
public int rMethod() {
return 0;
}
public @SuppressWarnings("foobar") int sMethod() {
return 0;
}
public @SuppressWarnings("foobar") final int tMethod() {
return 0;
}
// Use @NonNull rather than a signedness annotation to avoid errors.
@NonNull public enum MyEnum {
@NonNull CONSTANT
}
interface MyInterface {
@NonNull String myMethod();
}
}
|