Class GuiEffectVisitor
- All Implemented Interfaces:
- TreeVisitor<Void,- Void> 
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.checkerframework.common.basetype.BaseTypeVisitorBaseTypeVisitor.OverrideChecker
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final ArrayDeque<MethodTree>protected final booleanWhether or not to display debugging information.protected final ArrayDeque<Effect>Fields inherited from class org.checkerframework.common.basetype.BaseTypeVisitorassumePureGetters, atypeFactory, checker, DETERMINISTIC, IMPURE, methodTree, positions, PURE, qualHierarchy, showchecks, SIDE_EFFECT_FREE, TARGET, targetValueElement, typeHierarchy, typeValidator, unusedWhenElement, warnRedundantAnnotationsFields inherited from class org.checkerframework.framework.source.SourceVisitorelements, root, trees, treesWithSuppressWarnings, types
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcheckConstructorResult(AnnotatedTypeMirror.AnnotatedExecutableType constructorType, ExecutableElement constructorElement) Issue a warning if the result type of the constructor declaration is not top.protected voidcheckExtendsAndImplements(ClassTree classTree) In@A class X extends @B Y implements @C Z {}, enforce that@Amust be a subtype of@Band@C.protected voidcheckMethodInvocability(AnnotatedTypeMirror.AnnotatedExecutableType method, MethodInvocationTree tree) Tests whether the method can be invoked using the receiver of the 'tree' method invocation, and issues a "method.invocation" if the invocation is invalid.protected BaseTypeVisitor<GuiEffectTypeFactory>.OverrideCheckercreateOverrideChecker(Tree overriderTree, AnnotatedTypeMirror.AnnotatedExecutableType overrider, AnnotatedTypeMirror overridingType, AnnotatedTypeMirror overridingReturnType, AnnotatedTypeMirror.AnnotatedExecutableType overridden, AnnotatedTypeMirror.AnnotatedDeclaredType overriddenType, AnnotatedTypeMirror overriddenReturnType) Create an OverrideChecker.protected GuiEffectTypeFactoryConstructs an instance of the appropriate type factory for the implemented type system.protected AnnotationMirrorSetReturns a set of AnnotationMirrors that is a lower bound for exception parameters.booleanisValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType declarationType, AnnotatedTypeMirror.AnnotatedDeclaredType useType, Tree tree) Tests that the qualifiers present onuseTypeare valid qualifiers, given the qualifiers on the declaration of the type,declarationType.voidprocessClassTree(ClassTree classTree) Type-check classTree.voidprocessMethodTree(String className, MethodTree tree) Type-check methodTree.Performs a method invocation check.visitNewClass(NewClassTree tree, Void p) Performs a new class invocation check.protected voidwarnInvalidPolymorphicQualifier(ClassTree classTree) Issues an "invalid.polymorphic.qualifier" error for all polymorphic annotations written on the class declaration.Methods inherited from class org.checkerframework.common.basetype.BaseTypeVisitorcheckAccess, checkAccessAllowed, checkArguments, checkArrayInitialization, checkConditionalPostcondition, checkConstructorInvocation, checkContract, checkDefaultConstructor, checkExceptionParameter, checkExplicitAnnotationsOnIntersectionBounds, checkExtendsOrImplements, checkFieldInvariantDeclarations, checkMethodReferenceAsOverride, checkOverride, checkOverride, checkPostcondition, checkPreconditions, checkPurityAnnotations, checkQualifierParameter, checkSuperConstructorCall, checkThisConstructorCall, checkThisOrSuperConstructorCall, checkThrownExpression, checkTypeArguments, checkTypecastRedundancy, checkTypecastSafety, checkVarargs, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckStartDiagnostic, contractExpressionAndType, createTypeFactoryPublic, createTypeValidator, enclosingMemberSelect, enclosingStatement, getThrowUpperBoundAnnotations, getTypeFactory, isTypeCastSafe, isValidUse, isValidUse, reportMethodInvocabilityError, reportPurityErrors, scan, setRoot, shouldPerformContractInference, shouldSkipUses, shouldWarnAboutIrrelevantJavaTypes, skipReceiverSubtypeCheck, testAnnotationInsertion, testJointJavacJavaParserVisitor, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotatedType, visitAnnotatedType, visitAnnotation, visitAssignment, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitIdentifier, visitInstanceOf, visitMemberReference, visitMethod, visitNewArray, visitReturn, visitSwitchExpression17, visitThrow, visitTypeCast, visitTypeParameter, visitUnary, visitVariable, warnAboutIrrelevantJavaTypes, warnInvalidPolymorphicQualifier, warnRedundantAnnotationsMethods inherited from class org.checkerframework.framework.source.SourceVisitorvisitMethods inherited from class com.sun.source.util.TreePathScannergetCurrentPath, scanMethods inherited from class com.sun.source.util.TreeScannerreduce, scan, visitArrayAccess, visitArrayType, visitAssert, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitContinue, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitGuardedPattern, visitIf, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitMemberSelect, visitModifiers, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitParenthesizedPattern, visitPrimitiveType, visitProvides, visitRequires, visitSwitch, visitSwitchExpression, visitSynchronized, visitTry, visitUnionType, visitUses, visitWhileLoop, visitWildcard, visitYield
- 
Field Details- 
debugSpewprotected final boolean debugSpewWhether or not to display debugging information.
- 
effStack
- 
currentMethods
 
- 
- 
Constructor Details- 
GuiEffectVisitor
 
- 
- 
Method Details- 
createTypeFactoryDescription copied from class:BaseTypeVisitorConstructs an instance of the appropriate type factory for the implemented type system.The default implementation uses the checker naming convention to create the appropriate type factory. If no factory is found, it returns BaseAnnotatedTypeFactory. It reflectively invokes the constructor that accepts this checker and compilation unit tree (in that order) as arguments.Subclasses have to override this method to create the appropriate visitor if they do not follow the checker naming convention. - Overrides:
- createTypeFactoryin class- BaseTypeVisitor<GuiEffectTypeFactory>
- Returns:
- the appropriate type factory
 
- 
checkMethodInvocabilityprotected void checkMethodInvocability(AnnotatedTypeMirror.AnnotatedExecutableType method, MethodInvocationTree tree) Description copied from class:BaseTypeVisitorTests whether the method can be invoked using the receiver of the 'tree' method invocation, and issues a "method.invocation" if the invocation is invalid.This implementation tests whether the receiver in the method invocation is a subtype of the method receiver type. This behavior can be specialized by overriding skipReceiverSubtypeCheck. - Overrides:
- checkMethodInvocabilityin class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- method- the type of the invoked method
- tree- the method invocation tree
 
- 
createOverrideCheckerprotected BaseTypeVisitor<GuiEffectTypeFactory>.OverrideChecker createOverrideChecker(Tree overriderTree, AnnotatedTypeMirror.AnnotatedExecutableType overrider, AnnotatedTypeMirror overridingType, AnnotatedTypeMirror overridingReturnType, AnnotatedTypeMirror.AnnotatedExecutableType overridden, AnnotatedTypeMirror.AnnotatedDeclaredType overriddenType, AnnotatedTypeMirror overriddenReturnType) Description copied from class:BaseTypeVisitorCreate an OverrideChecker.This exists so that subclasses can subclass OverrideChecker and use their subclass instead of using OverrideChecker itself. - Overrides:
- createOverrideCheckerin class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- overriderTree- the AST node of the overriding method or method reference
- overrider- the type of the overriding method
- overridingType- the type enclosing the overrider method, usually an AnnotatedDeclaredType; for Method References may be something else
- overridingReturnType- the return type of the overriding method
- overridden- the type of the overridden method
- overriddenType- the declared type enclosing the overridden method
- overriddenReturnType- the return type of the overridden method
- Returns:
- an OverrideChecker
 
- 
getExceptionParameterLowerBoundAnnotationsDescription copied from class:BaseTypeVisitorReturns a set of AnnotationMirrors that is a lower bound for exception parameters.This implementation returns top; subclasses can change this behavior. Note: by default this method is called by BaseTypeVisitor.getThrowUpperBoundAnnotations(), so that this annotation is enforced.- Overrides:
- getExceptionParameterLowerBoundAnnotationsin class- BaseTypeVisitor<GuiEffectTypeFactory>
- Returns:
- set of annotation mirrors, one per hierarchy, that form a lower bound of annotations that can be written on an exception parameter
 
- 
isValidUsepublic boolean isValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType declarationType, AnnotatedTypeMirror.AnnotatedDeclaredType useType, Tree tree) Description copied from class:BaseTypeVisitorTests that the qualifiers present onuseTypeare valid qualifiers, given the qualifiers on the declaration of the type,declarationType.The check is shallow, as it does not descend into generic or array types (i.e. only performing the validity check on the raw type or outermost array dimension). BaseTypeVisitor.validateTypeOf(Tree)would call this for each type argument or array dimension separately.In most cases, useTypesimply needs to be a subtype ofdeclarationType. If a type system makes exceptions to this rule, its implementation should override this method.This method is not called if BaseTypeValidator.shouldCheckTopLevelDeclaredOrPrimitiveType(AnnotatedTypeMirror, Tree)returns false -- by default, it is not called on the top level for locals and expressions. To enforce a type validity property everywhere, override methods such asBaseTypeValidator.visitDeclared(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedDeclaredType, com.sun.source.tree.Tree)rather than this method.- Overrides:
- isValidUsein class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- declarationType- the type of the class (TypeElement)
- useType- the use of the class (instance type)
- tree- the tree where the type is used
- Returns:
- true if the useType is a valid use of elemType
 
- 
visitLambdaExpression- Specified by:
- visitLambdaExpressionin interface- TreeVisitor<Void,- Void> 
- Overrides:
- visitLambdaExpressionin class- BaseTypeVisitor<GuiEffectTypeFactory>
 
- 
checkExtendsAndImplementsDescription copied from class:BaseTypeVisitorIn@A class X extends @B Y implements @C Z {}, enforce that@Amust be a subtype of@Band@C.Also validate the types of the extends and implements clauses. - Overrides:
- checkExtendsAndImplementsin class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- classTree- class tree to check
 
- 
checkConstructorResultprotected void checkConstructorResult(AnnotatedTypeMirror.AnnotatedExecutableType constructorType, ExecutableElement constructorElement) Description copied from class:BaseTypeVisitorIssue a warning if the result type of the constructor declaration is not top. If it is a supertype of the class, then a conflicting.annos error will also be issued byBaseTypeVisitor.isValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType,AnnotatedTypeMirror.AnnotatedDeclaredType,Tree).- Overrides:
- checkConstructorResultin class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- constructorType- the AnnotatedExecutableType for the constructor
- constructorElement- the element that declares the constructor
 
- 
warnInvalidPolymorphicQualifierDescription copied from class:BaseTypeVisitorIssues an "invalid.polymorphic.qualifier" error for all polymorphic annotations written on the class declaration.- Overrides:
- warnInvalidPolymorphicQualifierin class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- classTree- the class to check
 
- 
visitMethodInvocationDescription copied from class:BaseTypeVisitorPerforms a method invocation check.An invocation of a method, m, on the receiver, r is valid only if: - passed arguments are subtypes of corresponding m parameters
- r is a subtype of m receiver type
- if m is generic, passed type arguments are subtypes of m type variables
 - Specified by:
- visitMethodInvocationin interface- TreeVisitor<Void,- Void> 
- Overrides:
- visitMethodInvocationin class- BaseTypeVisitor<GuiEffectTypeFactory>
 
- 
processMethodTreeDescription copied from class:BaseTypeVisitorType-check methodTree. Subclasses should override this method instead ofBaseTypeVisitor.visitMethod(MethodTree, Void).- Overrides:
- processMethodTreein class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- className- the class that contains the method, for diagnostics only
- tree- the method to type-check
 
- 
visitNewClassDescription copied from class:BaseTypeVisitorPerforms a new class invocation check.An invocation of a constructor, c, is valid only if: - passed arguments are subtypes of corresponding c parameters
- if c is generic, passed type arguments are subtypes of c type variables
 - Specified by:
- visitNewClassin interface- TreeVisitor<Void,- Void> 
- Overrides:
- visitNewClassin class- BaseTypeVisitor<GuiEffectTypeFactory>
 
- 
processClassTreeDescription copied from class:BaseTypeVisitorType-check classTree. Subclasses should override this method instead ofBaseTypeVisitor.visitClass(ClassTree, Void).- Overrides:
- processClassTreein class- BaseTypeVisitor<GuiEffectTypeFactory>
- Parameters:
- classTree- class to check
 
 
-