-
Enhancement
-
Resolution: Fixed
-
P3
-
None
-
b15
When javac resolves a file with many yet-to-be generated types, a CompletionFailure is created while trying to resolve each one. In order to create those objects, a new JCDiagnostic is also created. In profiles of large compilations with annotation processing, I've seen the JCDiagnostic creation continually show up as taking anywhere from 700ms - 3s depending on the compilation/structure of the generated code. In the case of annotation processing, these diagnostics may never be reported to the messager if a later round generates the types.
I propose that instead of taking a JCDiagnostic, we change CompletionFailure to take a Supplier<JCDiagnostic>, similar to the approach taken inJDK-8215368.
I propose that instead of taking a JCDiagnostic, we change CompletionFailure to take a Supplier<JCDiagnostic>, similar to the approach taken in