|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.annotation.processing.AbstractProcessor com.sun.source.util.AbstractTypeProcessor checkers.source.SourceChecker checkers.basetype.BaseTypeChecker checkers.lock.LockChecker
public class LockChecker extends BaseTypeChecker
A typechecker plug-in for the JCIP type system qualifier that finds (and verifies the absence of) locking and concurrency errors.
GuardedBy
Modifier and Type | Field and Description |
---|
Fields inherited from class checkers.source.SourceChecker |
---|
currentPath, currentRoot, env, messager, messages, trees |
Fields inherited from class javax.annotation.processing.AbstractProcessor |
---|
processingEnv |
Constructor and Description |
---|
LockChecker()
|
Modifier and Type | Method and Description |
---|---|
protected QualifierHierarchy |
createQualifierHierarchy()
Returns the type qualifier hierarchy graph to be used by this processor. |
boolean |
isValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType declarationType,
AnnotatedTypeMirror.AnnotatedDeclaredType useType)
Tests that the qualifiers present on the useType are valid qualifiers, given the qualifiers on the declaration of the type, declarationType. |
Methods inherited from class checkers.basetype.BaseTypeChecker |
---|
createFactory, createSourceVisitor, createSupportedTypeQualifiers, createTypeHierarchy, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, init, isAssignable, isSubtype |
Methods inherited from class checkers.source.SourceChecker |
---|
fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, message, report, typeProcess |
Methods inherited from class com.sun.source.util.AbstractTypeProcessor |
---|
process, typeProcessingOver |
Methods inherited from class javax.annotation.processing.AbstractProcessor |
---|
getCompletions, isInitialized, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LockChecker()
Method Detail |
---|
protected QualifierHierarchy createQualifierHierarchy()
BaseTypeChecker
BaseTypeChecker.getSupportedTypeQualifiers()
using the
meta-annotations found in them. The current implementation returns an
instance of GraphQualifierHierarchy
.
Subclasses may override this method to express any relationships that
cannot be inferred using meta-annotations (e.g. due to lack of
meta-annotations).
createQualifierHierarchy
in class BaseTypeChecker
public boolean isValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType declarationType, AnnotatedTypeMirror.AnnotatedDeclaredType useType)
BaseTypeChecker
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.
For instance, in the IGJ type system, a @Mutable
is an invalid
qualifier for String
, as String
is declared as
@Immutable String
.
In most cases, useType
simply needs to be a subtype of
declarationType
, but there are exceptions. In IGJ, a variable may be
declared @ReadOnly String
, even though String
is
@Immutable String
; ReadOnly
is not a subtype of
Immutable
.
isValidUse
in class BaseTypeChecker
declarationType
- the type of the class (TypeElement)useType
- the use of the class (instance type)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |