public class Check extends Object
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Class and Description |
---|---|
static interface |
Check.CheckContext
A check context is an object that can be used to perform compatibility
checks - depending on the check context, meaning of 'compatibility' might
vary significantly.
|
Modifier and Type | Field and Description |
---|---|
protected static Context.Key<Check> |
checkKey |
Map<Name,Symbol.ClassSymbol> |
compiled
A table mapping flat names of all compiled classes in this run to their
symbols; maintained from outside.
|
Modifier | Constructor and Description |
---|---|
protected |
Check(Context context) |
Modifier and Type | Method and Description |
---|---|
Warner |
castWarner(JCDiagnostic.DiagnosticPosition pos,
Type found,
Type expected) |
void |
checkCanonical(JCTree tree)
Check that a qualified name is in canonical form (for import decls).
|
void |
checkClassOverrideEqualsAndHashIfNeeded(JCDiagnostic.DiagnosticPosition pos,
Symbol.ClassSymbol someClass) |
boolean |
checkCompatibleAbstracts(JCDiagnostic.DiagnosticPosition pos,
Type t1,
Type t2)
Check that classes (or interfaces) do not each define an abstract
method with same name and arguments but incompatible return types.
|
boolean |
checkCompatibleAbstracts(JCDiagnostic.DiagnosticPosition pos,
Type t1,
Type t2,
Type site) |
void |
checkCompatibleConcretes(JCDiagnostic.DiagnosticPosition pos,
Type site)
Check that a class does not inherit two concrete methods
with the same signature.
|
void |
checkFunctionalInterface(JCTree.JCClassDecl tree,
Symbol.ClassSymbol cs) |
void |
checkRedundantCast(Env<AttrContext> env,
JCTree.JCTypeCast tree)
Check for redundant casts (i.e.
|
boolean |
checkValidGenericType(Type t)
Check that type 't' is a valid instantiation of a generic class
(see JLS 4.5)
|
Type |
completionError(JCDiagnostic.DiagnosticPosition pos,
Symbol.CompletionFailure ex)
Report a failure to complete a class.
|
Warner |
convertWarner(JCDiagnostic.DiagnosticPosition pos,
Type found,
Type expected) |
static Check |
instance(Context context) |
List<Type> |
intersect(List<Type> ts1,
List<Type> ts2)
Form the intersection of two type lists.
|
protected boolean |
isTypeAnnotation(JCTree.JCAnnotation a,
boolean isTypeParameter)
Is the annotation applicable to types?
|
void |
reportDeferredDiagnostics()
Report any deferred diagnostics.
|
boolean |
validateAnnotationDeferErrors(JCTree.JCAnnotation a)
Check an annotation value.
|
void |
validateAnnotations(List<JCTree.JCAnnotation> annotations,
Symbol s)
Check the annotations of a symbol.
|
void |
validateRepeatable(Symbol.TypeSymbol s,
Attribute.Compound repeatable,
JCDiagnostic.DiagnosticPosition pos)
Validate the proposed container 'repeatable' on the
annotation type symbol 's'.
|
void |
validateTypeAnnotation(JCTree.JCAnnotation a,
boolean isTypeParameter) |
void |
validateTypeAnnotations(List<JCTree.JCAnnotation> annotations,
boolean isTypeParameter)
Check the type annotations.
|
void |
warnStatic(JCDiagnostic.DiagnosticPosition pos,
String msg,
Object... args) |
void |
warnSunApi(JCDiagnostic.DiagnosticPosition pos,
String msg,
Object... args)
Warn about using proprietary API.
|
void |
warnUnchecked(JCDiagnostic.DiagnosticPosition pos,
String msg,
Object... args)
Warn about unchecked operation.
|
protected static final Context.Key<Check> checkKey
public Map<Name,Symbol.ClassSymbol> compiled
protected Check(Context context)
public void warnUnchecked(JCDiagnostic.DiagnosticPosition pos, String msg, Object... args)
pos
- Position to be used for error reporting.msg
- A string describing the problem.public void warnSunApi(JCDiagnostic.DiagnosticPosition pos, String msg, Object... args)
pos
- Position to be used for error reporting.msg
- A string describing the problem.public void warnStatic(JCDiagnostic.DiagnosticPosition pos, String msg, Object... args)
public void reportDeferredDiagnostics()
public Type completionError(JCDiagnostic.DiagnosticPosition pos, Symbol.CompletionFailure ex)
pos
- Position to be used for error reporting.ex
- The failure to report.public void checkRedundantCast(Env<AttrContext> env, JCTree.JCTypeCast tree)
public boolean checkValidGenericType(Type t)
t
- class type to be checkedpublic List<Type> intersect(List<Type> ts1, List<Type> ts2)
public void checkCompatibleConcretes(JCDiagnostic.DiagnosticPosition pos, Type site)
pos
- Position to be used for error reporting.site
- The class type to be checked.public boolean checkCompatibleAbstracts(JCDiagnostic.DiagnosticPosition pos, Type t1, Type t2)
pos
- Position to be used for error reporting.t1
- The first argument type.t2
- The second argument type.public boolean checkCompatibleAbstracts(JCDiagnostic.DiagnosticPosition pos, Type t1, Type t2, Type site)
public void checkClassOverrideEqualsAndHashIfNeeded(JCDiagnostic.DiagnosticPosition pos, Symbol.ClassSymbol someClass)
public void validateAnnotations(List<JCTree.JCAnnotation> annotations, Symbol s)
public void validateTypeAnnotations(List<JCTree.JCAnnotation> annotations, boolean isTypeParameter)
public void validateTypeAnnotation(JCTree.JCAnnotation a, boolean isTypeParameter)
public void validateRepeatable(Symbol.TypeSymbol s, Attribute.Compound repeatable, JCDiagnostic.DiagnosticPosition pos)
s
- The (annotation)type declaration annotated with a @Repeatablerepeatable
- the @Repeatable on 's'pos
- where to report errorsprotected boolean isTypeAnnotation(JCTree.JCAnnotation a, boolean isTypeParameter)
public boolean validateAnnotationDeferErrors(JCTree.JCAnnotation a)
a
- The annotation tree to checkpublic void checkCanonical(JCTree tree)
public Warner castWarner(JCDiagnostic.DiagnosticPosition pos, Type found, Type expected)
public Warner convertWarner(JCDiagnostic.DiagnosticPosition pos, Type found, Type expected)
public void checkFunctionalInterface(JCTree.JCClassDecl tree, Symbol.ClassSymbol cs)
Copyright © 2015. All rights reserved.