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 JavacPhaseTracer
public void endParse()
endParse
in interface JavacPhaseTracer
public void beginEnter()
beginEnter
in interface JavacPhaseTracer
public void endEnter(List<String> filenames)
endEnter
in interface JavacPhaseTracer
public void setIsLastRound(boolean isLastRound)
setIsLastRound
in interface JavacPhaseTracer
public void beginAnnotationProcessingRound()
beginAnnotationProcessingRound
in interface JavacPhaseTracer
public void endAnnotationProcessingRound()
endAnnotationProcessingRound
in interface JavacPhaseTracer
public void beginAnalyze()
beginAnalyze
in interface JavacPhaseTracer
public void endAnalyze(List<String> filenames, List<String> typenames)
endAnalyze
in interface JavacPhaseTracer
public void beginGenerate(@Nullable String filename, @Nullable String typename)
beginGenerate
in interface JavacPhaseTracer
public void endGenerate()
endGenerate
in interface JavacPhaseTracer
public void close()
close
in interface AutoCloseable