diff --git a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationChecker.java b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationChecker.java index 8aa8cdd3db3..e1bd711e790 100644 --- a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationChecker.java +++ b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationChecker.java @@ -91,7 +91,10 @@ public InitializationChecker() {} /** * Also handle {@code AnnotatedFor} annotations for this checker. See {@link * InitializationFieldAccessSubchecker#getUpstreamCheckerNames()} and the two implementations - * should be kept in sync. + * should be kept in sync. The name of this checker is also added in {@link + * #getSuppressWarningsPrefixes()}. + * + * @return the list of checkers that should be run before this checker */ @Override public List<@FullyQualifiedName String> getUpstreamCheckerNames() { @@ -102,6 +105,13 @@ public InitializationChecker() {} return upstreamCheckerNames; } + /** + * Manually add the default prefix "initialization" to the set of prefixes that can be used to + * suppress warnings. The checker is also added in {@link #getUpstreamCheckerNames()} for + * AnnotatedFor annotations to be recognized by this checker. + * + * @return the set of prefixes that can be used to suppress warnings + */ @Override public NavigableSet getSuppressWarningsPrefixes() { NavigableSet result = super.getSuppressWarningsPrefixes();