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:
Processor,OptionConfiguration
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:
-
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, visitorFields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for InitializationFieldAccessSubchecker. -
Method Summary
Modifier and TypeMethodDescriptionvoidreportError(Object source, @CompilerMessageKey String messageKey, Object... args) Reports an error.voidreportWarning(Object source, @CompilerMessageKey String messageKey, 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, warnUnneededSuppressionsMethods 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, warnUnneededSuppressionsMethods inherited from class org.checkerframework.javacutil.AbstractTypeProcessor
getCompilerLog, processMethods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.checkerframework.framework.util.OptionConfiguration
getStringsOption, getStringsOption
-
Constructor Details
-
InitializationFieldAccessSubchecker
public InitializationFieldAccessSubchecker()Default constructor for InitializationFieldAccessSubchecker.
-
-
Method Details
-
reportError
Description copied from class:SourceCheckerReports an error. By default, prints it to the screen via the compiler's internal messager.- Overrides:
reportErrorin 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
Description copied from class:SourceCheckerReports a warning. By default, prints it to the screen via the compiler's internal messager.- Overrides:
reportWarningin 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
-