public class TypeOutputtingChecker extends SourceChecker
TypeElement
. In particular
it tests that the types read from classfiles are the same to the ones
from java files.
For testing, you need to do the following:
1. Run the Checker on the source file like any checker:
java -processor checkers.util.debug.TypeOutputtingChecker [source-file]
2. Run the Checker on the bytecode, by simply running the main and passing
the qualified name, e.g.
java checkers.util.debug.TypeOutputtingChecker [qualified-name]
3. Apply a simple diff on the two outputsModifier and Type | Class and Description |
---|---|
static class |
TypeOutputtingChecker.Visitor
Prints the types of the class and all of its enclosing
fields, methods, and inner classes
|
SourceChecker.CheckerError
currentPath, currentRoot, DETAILS_SEPARATOR, messager, messages, trees
processingEnv
Constructor and Description |
---|
TypeOutputtingChecker() |
Modifier and Type | Method and Description |
---|---|
protected SourceVisitor<?,?> |
createSourceVisitor(CompilationUnitTree root)
Provides the
SourceVisitor that the checker should use to scan
input source trees. |
static void |
main(String[] args) |
protected static void |
printClassType(TypeElement typeElt,
AnnotatedTypeFactory atypeFactory)
Prints the types of the class and all of its enclosing
fields, methods, and inner classes
|
void |
run(String[] args) |
createFactory, createSupportedLintOptions, errorAbort, errorAbort, formatStackTrace, fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getProperties, getSupportedAnnotationTypes, getSupportedLintOptions, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, initChecker, message, printStats, report, setLintOption, setSupportedLintOptions, shouldAddShutdownHook, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shutdownHook, typeProcess, typeProcessingStart
init, process, typeProcessingOver
getCompletions, isInitialized, toString
protected SourceVisitor<?,?> createSourceVisitor(CompilationUnitTree root)
SourceChecker
SourceVisitor
that the checker should use to scan
input source trees.createSourceVisitor
in class SourceChecker
root
- the AST rootSourceVisitor
to use to scan source treespublic static void main(String[] args)
public void run(String[] args)
protected static void printClassType(TypeElement typeElt, AnnotatedTypeFactory atypeFactory)