langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
changeset 1472 1e09e143438c
parent 1471 57506cdfb7b4
child 1591 e5a618442f5f
equal deleted inserted replaced
1471:57506cdfb7b4 1472:1e09e143438c
    39 
    39 
    40     /**
    40     /**
    41      * Create a formatter based on the supplied options.
    41      * Create a formatter based on the supplied options.
    42      * @param msgs
    42      * @param msgs
    43      */
    43      */
    44     public RawDiagnosticFormatter(JavacMessages msgs) {
    44     public RawDiagnosticFormatter(Options opts) {
    45         super(null);
    45         super(null, opts, false);
    46     }
    46     }
    47 
    47 
    48     //provide common default formats
    48     //provide common default formats
    49     public String format(JCDiagnostic d, Locale l) {
    49     public String format(JCDiagnostic d, Locale l) {
    50         try {
    50         try {
    59             }
    59             }
    60             else
    60             else
    61                 buf.append('-');
    61                 buf.append('-');
    62             buf.append(' ');
    62             buf.append(' ');
    63             buf.append(formatMessage(d, null));
    63             buf.append(formatMessage(d, null));
       
    64             if (displaySource(d))
       
    65                 buf.append("\n" + formatSourceLine(d));
    64             return buf.toString();
    66             return buf.toString();
    65         }
    67         }
    66         catch (Exception e) {
    68         catch (Exception e) {
    67             e.printStackTrace();
    69             e.printStackTrace();
    68             return null;
    70             return null;
    92             buf.append(o);
    94             buf.append(o);
    93             sep = ", ";
    95             sep = ", ";
    94         }
    96         }
    95         return buf.toString();
    97         return buf.toString();
    96     }
    98     }
    97 
       
    98     public boolean displaySource(JCDiagnostic d) {
       
    99         return false;
       
   100     }
       
   101 }
    99 }