public class TranslatingJavacPhaseTracer extends Object implements JavacPhaseTracer, AutoCloseable
JavacPhaseTracer that translates the trace data to be more useful.
The phases of compilation are described here. The doc describes annotation processing as conceptually occuring before compilation, but actually occurring somewhat out-of-phase with the conceptual model.
Javac calls TracingTaskListener according to the conceptual model described in that
document: annotation processing starts at the very beginning of the run, and ends after the last
annotation processor is run in the last round of processing. Then there is one last parse and
enter before going into analyze and generate. This is problematic from a performance perspective,
because some of the work attributed to annotation processing would have happened regardless.
This class translates the tracing data from the conceptual model back into something that more closely matches the actual implementation:
| Constructor and Description |
|---|
TranslatingJavacPhaseTracer(JavacPhaseEventLogger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginAnalyze() |
void |
beginAnnotationProcessingRound() |
void |
beginEnter() |
void |
beginGenerate(String filename,
String typename) |
void |
beginParse(String filename) |
void |
close() |
void |
endAnalyze(List<String> filenames,
List<String> typenames) |
void |
endAnnotationProcessingRound() |
void |
endEnter(List<String> filenames) |
void |
endGenerate() |
void |
endParse() |
void |
setIsLastRound(boolean isLastRound) |
public TranslatingJavacPhaseTracer(JavacPhaseEventLogger logger)
public void beginParse(@Nullable String filename)
beginParse in interface JavacPhaseTracerpublic void endParse()
endParse in interface JavacPhaseTracerpublic void beginEnter()
beginEnter in interface JavacPhaseTracerpublic void endEnter(List<String> filenames)
endEnter in interface JavacPhaseTracerpublic void setIsLastRound(boolean isLastRound)
setIsLastRound in interface JavacPhaseTracerpublic void beginAnnotationProcessingRound()
beginAnnotationProcessingRound in interface JavacPhaseTracerpublic void endAnnotationProcessingRound()
endAnnotationProcessingRound in interface JavacPhaseTracerpublic void beginAnalyze()
beginAnalyze in interface JavacPhaseTracerpublic void endAnalyze(List<String> filenames, List<String> typenames)
endAnalyze in interface JavacPhaseTracerpublic void beginGenerate(@Nullable String filename, @Nullable String typename)
beginGenerate in interface JavacPhaseTracerpublic void endGenerate()
endGenerate in interface JavacPhaseTracerpublic void close()
close in interface AutoCloseable