-
Enhancement
-
Resolution: Fixed
-
P4
-
7
-
b32
-
generic
-
generic
-
Not verified
Currently, Log is still a big class handling 3 roles.
1) It is the class used by the majority of the compiler to report errors. As such it is the "front end" to the diagnostic system.
2) It handles the presentation of diagnostics, in conjuction with the diagnostic formatter system.
3) It handles (deferred) access to the source code for presentation as part of a diagnostic.
It would be good to separate (1) from (2) so that we can separate how the compiler creates diagnostics from when and where they are presented. This is useful in the MT work for the
compiler, where we wish to buffer the diagnostics from concurrent parser threads.
Separating (1) from (2) necessitates (3) because creating diagnostic objects currently creates objects with an ugly hidden reference to the enclosing Log, because of the need to access line/column info and potentially the source line.
The proposal is to factor out all the methods for creating diagnostics into a new abstract class BasicLog. This will use the existing single report method to communicate with the back end of Log. In addition, the JCDiagnostic.DiagnosticSource interface will be changed to a new top level class in the Context, providing better cleaner access to cached source files.
Note: the proposed changed are entirely within the javac.util package; no changes to the rest of the compiler will be required.
1) It is the class used by the majority of the compiler to report errors. As such it is the "front end" to the diagnostic system.
2) It handles the presentation of diagnostics, in conjuction with the diagnostic formatter system.
3) It handles (deferred) access to the source code for presentation as part of a diagnostic.
It would be good to separate (1) from (2) so that we can separate how the compiler creates diagnostics from when and where they are presented. This is useful in the MT work for the
compiler, where we wish to buffer the diagnostics from concurrent parser threads.
Separating (1) from (2) necessitates (3) because creating diagnostic objects currently creates objects with an ugly hidden reference to the enclosing Log, because of the need to access line/column info and potentially the source line.
The proposal is to factor out all the methods for creating diagnostics into a new abstract class BasicLog. This will use the existing single report method to communicate with the back end of Log. In addition, the JCDiagnostic.DiagnosticSource interface will be changed to a new top level class in the Context, providing better cleaner access to cached source files.
Note: the proposed changed are entirely within the javac.util package; no changes to the rest of the compiler will be required.
- relates to
-
JDK-6733837 Recent work on javac diagnostic affected javac output
- Closed
-
JDK-6403465 javac should defer diagnostics until it can be determined they are persistent
- Closed
-
JDK-6740348 javac crashes when a variable is not declared
- Closed
-
JDK-6852595 Accessing scope using JSR199 API on erroneous tree causes Illegal Argument Exception
- Closed