checkers.jcip
Class JCIPVisitor
java.lang.Object
com.sun.source.util.TreeScanner<R,P>
com.sun.source.util.TreePathScanner<R,P>
checkers.source.SourceVisitor<R,P>
checkers.basetype.BaseTypeVisitor<Void,Void>
checkers.jcip.JCIPVisitor
- All Implemented Interfaces:
- TreeVisitor<Void,Void>
public class JCIPVisitor
- extends BaseTypeVisitor<Void,Void>
A type-checking visitor for the JCIP concurrency type system.
The visitor reports errors or warnings for violations for the
following cases:
- A guarded field is dereferenced without holding its lock
- A guarded non-final non-volatile field is accessed
(merely referenced) without holding its lock
TODO: Doesn't make sense to separate dereferencing and accessing?
- A method is invoked without the caller holding the locks
it requires
Self-accesses (via this
or super
) can always be dereferenced.
- See Also:
NullnessChecker
Methods inherited from class checkers.basetype.BaseTypeVisitor |
checkArguments, checkArrayInitialization, checkAssignability, checkConstructorInvocation, checkMethodInvocability, checkOverride, checkTypeArguments, checkTypecastSafety, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheck, scan, shouldSkip, shouldSkip, validateTypeOf, visitAnnotation, visitAssignment, visitClass, visitCompilationUnit, visitCompoundAssignment, visitEnhancedForLoop, visitInstanceOf, visitMethodInvocation, visitNewArray, visitNewClass, visitParameterizedType, visitReturn, visitTypeCast, visitUnary, visitVariable |
Methods inherited from class com.sun.source.util.TreeScanner |
reduce, scan, visitAnnotatedType, visitArrayAccess, visitArrayType, visitAssert, visitBinary, visitBlock, visitBreak, visitCase, visitCatch, visitConditionalExpression, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExpressionStatement, visitForLoop, visitIf, visitImport, visitLabeledStatement, visitLiteral, visitMemberSelect, visitModifiers, visitOther, visitParenthesized, visitPrimitiveType, visitSwitch, visitThrow, visitTry, visitTypeParameter, visitWhileLoop, visitWildcard |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JCIPVisitor
public JCIPVisitor(BaseTypeChecker checker,
CompilationUnitTree root)
visitMethod
public Void visitMethod(MethodTree node,
Void p)
- Description copied from class:
BaseTypeVisitor
- Performs pseudo-assignment check: checks that the method obeys override
and subtype rules to all overridden methods.
The override rule specifies that a method, m1, may override a method
m2 only if:
- m1 return type is a subtype of m2
- m1 receiver type is a supertype of m2
-
- m1 parameters are supertypes of corresponding m2 parameters
Also, it issues a "missing.this" error for static method annotated
receivers.
- Specified by:
visitMethod
in interface TreeVisitor<Void,Void>
- Overrides:
visitMethod
in class BaseTypeVisitor<Void,Void>
visitSynchronized
public Void visitSynchronized(SynchronizedTree node,
Void p)
- Specified by:
visitSynchronized
in interface TreeVisitor<Void,Void>
- Overrides:
visitSynchronized
in class TreeScanner<Void,Void>
visitIdentifier
public Void visitIdentifier(IdentifierTree node,
Void p)
- Specified by:
visitIdentifier
in interface TreeVisitor<Void,Void>
- Overrides:
visitIdentifier
in class TreeScanner<Void,Void>