Class InitializationFieldAccessSubchecker
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- org.checkerframework.javacutil.AbstractTypeProcessor
-
- org.checkerframework.framework.source.SourceChecker
-
- org.checkerframework.common.basetype.BaseTypeChecker
-
- org.checkerframework.checker.initialization.InitializationFieldAccessSubchecker
-
- All Implemented Interfaces:
javax.annotation.processing.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 theInitializationFieldAccessTreeAnnotator
.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:
InitializationChecker
-
-
Field Summary
-
Fields inherited from class org.checkerframework.framework.source.SourceChecker
currentRoot, DETAILS_SEPARATOR, elements, elementsWithSuppressedWarnings, errsOnLastExit, javacErrored, messager, messagesProperties, MSGS_FILE, OPTION_SEPARATOR, parentChecker, SUPPRESS_ALL_MESSAGE_KEY, SUPPRESS_ALL_PREFIX, treePathCacher, trees, types, UNNEEDED_SUPPRESSION_KEY, upstreamCheckerNames, useAllcheckersPrefix, visitor
-
-
Constructor Summary
Constructors Constructor Description InitializationFieldAccessSubchecker()
Default constructor for InitializationFieldAccessSubchecker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
reportError(java.lang.Object source, @CompilerMessageKey java.lang.String messageKey, java.lang.Object... args)
Reports an error.void
reportWarning(java.lang.Object source, @CompilerMessageKey java.lang.String messageKey, java.lang.Object... args)
Reports a warning.-
Methods inherited from class org.checkerframework.common.basetype.BaseTypeChecker
createSourceVisitor, createSourceVisitorPublic, getAnnotationProvider, getExtraStubFiles, getImmediateSubcheckerClasses, getOptions, getOptionsNoSubcheckers, getRelatedClassName, getSubchecker, getSubcheckers, getSupportedLintOptions, getSupportedOptions, getSuppressWarningsPrefixesOfSubcheckers, getTypeFactory, getTypeFactoryOfSubcheckerOrNull, getUltimateParentChecker, getVisitor, hasOptionNoSubcheckers, initChecker, invokeConstructorFor, printOrStoreMessage, processErrorMessageArg, setRoot, shouldAddShutdownHook, shouldResolveReflection, shutdownHook, typeProcess, typeProcessingOver, warnUnneededSuppressions
-
Methods inherited from class org.checkerframework.framework.source.SourceChecker
addOptions, createSupportedLintOptions, expandCFOptions, fullMessageOf, getBooleanOption, getBooleanOption, getElementUtils, getLintOption, getLintOption, getMessagesProperties, getOption, getOption, getOptionConfiguration, getParentChecker, getPathToCompilationUnit, getProcessingEnvironment, getProperties, getStandardSuppressWarningsPrefixes, getStringsOption, getStringsOption, getSupportedAnnotationTypes, getSupportedSourceVersion, getSuppressWarningsPrefixes, getTreePathCacher, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, getWarningMessagePrefix, hasOption, init, message, message, messageKeyMatches, printOrStoreMessage, printStats, report, setLintOption, setParentChecker, setProcessingEnvironment, setSupportedLintOptions, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, shouldSuppressWarnings, typeProcessingStart, useConservativeDefault, warnUnneededSuppressions
-
Methods inherited from class org.checkerframework.javacutil.AbstractTypeProcessor
getCompilerLog, process
-
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.checkerframework.framework.util.OptionConfiguration
getStringsOption, getStringsOption
-
-
-
-
Method Detail
-
reportError
public void reportError(java.lang.Object source, @CompilerMessageKey java.lang.String messageKey, java.lang.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 classSourceChecker
- Parameters:
source
- the source position information; may be an Element, a Tree, or nullmessageKey
- the message keyargs
- arguments for interpolation in the string corresponding to the given message key
-
reportWarning
public void reportWarning(java.lang.Object source, @CompilerMessageKey java.lang.String messageKey, java.lang.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 classSourceChecker
- Parameters:
source
- the source position information; may be an Element, a Tree, or nullmessageKey
- the message keyargs
- arguments for interpolation in the string corresponding to the given message key
-
-