langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
changeset 1472 1e09e143438c
parent 1471 57506cdfb7b4
child 1591 e5a618442f5f
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Thu Oct 09 16:07:38 2008 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Thu Oct 09 16:19:13 2008 +0100
@@ -41,8 +41,8 @@
      * Create a formatter based on the supplied options.
      * @param msgs
      */
-    public RawDiagnosticFormatter(JavacMessages msgs) {
-        super(null);
+    public RawDiagnosticFormatter(Options opts) {
+        super(null, opts, false);
     }
 
     //provide common default formats
@@ -61,6 +61,8 @@
                 buf.append('-');
             buf.append(' ');
             buf.append(formatMessage(d, null));
+            if (displaySource(d))
+                buf.append("\n" + formatSourceLine(d));
             return buf.toString();
         }
         catch (Exception e) {
@@ -94,8 +96,4 @@
         }
         return buf.toString();
     }
-
-    public boolean displaySource(JCDiagnostic d) {
-        return false;
-    }
 }