Class NullnessChecker

All Implemented Interfaces:
Processor, OptionConfiguration

@SupportedLintOptions({"noInitForMonotonicNonNull","redundantNullComparison","soundArrayCreationNullness","forbidnonnullarraycomponents","trustArrayLenZero","permitClearProperty"}) @SupportedOptions({"assumeKeyFor","assumeInitialized","jspecifyNullMarkedAlias","conservativeArgumentNullnessAfterInvocation"}) @StubFiles({"junit-assertions.astub","log4j.astub"}) public class NullnessChecker extends InitializationChecker
An implementation of the nullness type-system, parameterized by an initialization type-system for safe initialization. It uses freedom-before-commitment, augmented by type frames (which are crucial to obtain acceptable precision), as its initialization type system.

This checker uses the NullnessNoInitSubchecker to check for nullness and extends the InitializationChecker to also check that all non-null fields are properly initialized.

You can use the following SuppressWarnings prefixes with this checker:

  • @SuppressWarnings("nullness") suppresses warnings from the Nullness, Initialization, and KeyFor Checkers
  • @SuppressWarnings("nullnessinitialization") suppresses warnings from the Nullness and Initialization Checkers only, warnings from the KeyFor Checker are not suppressed
  • @SuppressWarnings("nullnesskeyfor") suppresses warnings from the Nullness and KeyFor Checkers only, warnings from the Initialization Checker are not suppressed @SuppressWarnings("nullnessnoinit") has the same effect as @SuppressWarnings("nullnesskeyfor")
  • @SuppressWarnings("nullnessonly") suppresses warnings from the Nullness Checker only, warnings from the Initialization and KeyFor Checkers are not suppressed
  • @SuppressWarnings("initialization") suppresses warnings from the Initialization Checker only, warnings from the Nullness and KeyFor Checkers are not suppressed
  • @SuppressWarnings("keyfor") suppresses warnings from the KeyFor Checker only, warnings from the Nullness and Initialization Checkers are not suppressed
See Also:
See the Checker Framework Manual:
Nullness Checker