langtools/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java
changeset 22163 3651128c74eb
parent 17582 4079713129dd
child 25010 64c8d860c984
equal deleted inserted replaced
22162:3b3e23e67329 22163:3651128c74eb
    48  */
    48  */
    49 public class JCDiagnostic implements Diagnostic<JavaFileObject> {
    49 public class JCDiagnostic implements Diagnostic<JavaFileObject> {
    50     /** A factory for creating diagnostic objects. */
    50     /** A factory for creating diagnostic objects. */
    51     public static class Factory {
    51     public static class Factory {
    52         /** The context key for the diagnostic factory. */
    52         /** The context key for the diagnostic factory. */
    53         protected static final Context.Key<JCDiagnostic.Factory> diagnosticFactoryKey =
    53         protected static final Context.Key<JCDiagnostic.Factory> diagnosticFactoryKey = new Context.Key<>();
    54             new Context.Key<JCDiagnostic.Factory>();
       
    55 
    54 
    56         /** Get the Factory instance for this context. */
    55         /** Get the Factory instance for this context. */
    57         public static Factory instance(Context context) {
    56         public static Factory instance(Context context) {
    58             Factory instance = context.get(diagnosticFactoryKey);
    57             Factory instance = context.get(diagnosticFactoryKey);
    59             if (instance == null)
    58             if (instance == null)
   290          * @param key A string used to create the resource key for the diagnostic.
   289          * @param key A string used to create the resource key for the diagnostic.
   291          */
   290          */
   292         DiagnosticType(String key) {
   291         DiagnosticType(String key) {
   293             this.key = key;
   292             this.key = key;
   294         }
   293         }
   295     };
   294     }
   296 
   295 
   297     /**
   296     /**
   298      * A DiagnosticPosition provides information about the positions in a file
   297      * A DiagnosticPosition provides information about the positions in a file
   299      * that gave rise to a diagnostic. It always defines a "preferred" position
   298      * that gave rise to a diagnostic. It always defines a "preferred" position
   300      * that most accurately defines the location of the diagnostic, it may also
   299      * that most accurately defines the location of the diagnostic, it may also