| 1 |
import java.lang.annotation.ElementType; |
| 2 |
import java.lang.annotation.Target; |
| 3 |
import org.checkerframework.checker.nullness.qual.*; |
| 4 |
import org.checkerframework.framework.qual.SubtypeOf; |
| 5 |
import org.checkerframework.framework.qual.Unused; |
| 6 |
|
| 7 |
@SubtypeOf({}) |
| 8 |
@Target(ElementType.TYPE_USE) |
| 9 |
@interface DoesNotUseF {} |
| 10 |
|
| 11 |
public class Uninit11 { |
| 12 |
|
| 13 |
@Unused(when = DoesNotUseF.class) |
| 14 |
public Object f; |
| 15 |
|
| 16 |
// parameter disambiguate_overloads is just to distinguish the overloaded constructors |
| 17 |
public @DoesNotUseF Uninit11(int disambiguate_overloads) {} |
| 18 |
|
| 19 |
// :: error: (initialization.fields.uninitialized) |
| 20 |
public Uninit11(boolean disambiguate_overloads) {} |
| 21 |
|
| 22 |
public Uninit11(long x) { |
| 23 |
f = new Object(); |
| 24 |
} |
| 25 |
} |