Class SuppressWarningsPrefixTest
java.lang.Object
org.checkerframework.framework.source.SuppressWarningsPrefixTest
Unit tests for
SuppressWarningsPrefix inheritance across checker class hierarchies and
propagation from parent checkers to subcheckers.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase test checker with explicit prefixes.static classSubclass checker adding its own prefixes.static classChild subchecker with its own prefix.static final classParent compound checker.static classGrandparent checker with explicit prefix.static classSubclass checker without any annotation.static classParent checker that explicitly overrides its superclass prefix.static classTest checker with no annotation and no annotated superclass.static classUnannotated parent checker extending GrandparentPrefixChecker. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTests that a checker with no annotation defaults to its class-derived prefix.voidTests that a subchecker inherits the prefixes of its parent checker.voidTests that when a parent checker declares its own @SuppressWarningsPrefix, it overrides prefixes from its superclasses for propagation to subcheckers, avoiding prefix bleed.voidTests that a subchecker inherits prefixes declared on superclasses of its parent checker.voidTests that setParentChecker invalidates cached prefixes on the subchecker.voidTests that a subclass inherits prefixes declared on superclasses in the hierarchy.voidTests that an unannotated subclass inherits prefixes from an annotated superclass.
-
Constructor Details
-
SuppressWarningsPrefixTest
public SuppressWarningsPrefixTest()Default constructor.
-
-
Method Details
-
testSuperclassPrefixInheritance
public void testSuperclassPrefixInheritance()Tests that a subclass inherits prefixes declared on superclasses in the hierarchy. -
testUnannotatedSubclassInheritsSuperclassPrefix
public void testUnannotatedSubclassInheritsSuperclassPrefix()Tests that an unannotated subclass inherits prefixes from an annotated superclass. -
testDefaultPrefixWhenNoAnnotation
public void testDefaultPrefixWhenNoAnnotation()Tests that a checker with no annotation defaults to its class-derived prefix. -
testParentCheckerPrefixPropagation
public void testParentCheckerPrefixPropagation()Tests that a subchecker inherits the prefixes of its parent checker. -
testSetParentCheckerInvalidation
public void testSetParentCheckerInvalidation()Tests that setParentChecker invalidates cached prefixes on the subchecker. -
testParentSuperclassPrefixPropagation
public void testParentSuperclassPrefixPropagation()Tests that a subchecker inherits prefixes declared on superclasses of its parent checker. -
testParentPrefixOverridingSuperclassForSubcheckers
public void testParentPrefixOverridingSuperclassForSubcheckers()Tests that when a parent checker declares its own @SuppressWarningsPrefix, it overrides prefixes from its superclasses for propagation to subcheckers, avoiding prefix bleed.
-