Class InitializationFieldAccessSubchecker

All Implemented Interfaces:
Processor, OptionConfiguration

public class InitializationFieldAccessSubchecker extends BaseTypeChecker
Part of the freedom-before-commitment type system.

This checker does not actually do any type checking. It exists to provide its parent checker (the InitializationChecker.getTargetCheckerClass()) with declared initialization qualifiers via the InitializationFieldAccessTreeAnnotator.

Additionally, this checker performs the flow-sensitive type refinement for the fbc type system, which is necessary to avoid reporting follow-up errors related to initialization (see the AssignmentDuringInitialization test case). To avoid performing the same type refinement twice, the InitializationChecker performs no refinement, instead reusing the results from this checker.

See Also:
  • Constructor Details

    • InitializationFieldAccessSubchecker

      public InitializationFieldAccessSubchecker()
      Default constructor for InitializationFieldAccessSubchecker.
  • Method Details

    • reportError

      public void reportError(Object source, @CompilerMessageKey String messageKey, Object... args)
      Description copied from class: SourceChecker
      Reports an error. By default, prints it to the screen via the compiler's internal messager.
      Overrides:
      reportError in class SourceChecker
      Parameters:
      source - the source position information; may be an Element, a Tree, or null
      messageKey - the message key
      args - arguments for interpolation in the string corresponding to the given message key
    • reportWarning

      public void reportWarning(Object source, @CompilerMessageKey String messageKey, Object... args)
      Description copied from class: SourceChecker
      Reports a warning. By default, prints it to the screen via the compiler's internal messager.
      Overrides:
      reportWarning in class SourceChecker
      Parameters:
      source - the source position information; may be an Element, a Tree, or null
      messageKey - the message key
      args - arguments for interpolation in the string corresponding to the given message key