langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java
changeset 1471 57506cdfb7b4
parent 1109 853d8c191eac
child 1472 1e09e143438c
--- a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Thu Oct 09 16:04:29 2008 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Thu Oct 09 16:07:38 2008 +0100
@@ -59,9 +59,9 @@
      * Create a basic formatter based on the supplied options.
      *
      * @param opts list of command-line options
-     * @param msgs Messages object used for i18n
+     * @param msgs JavacMessages object used for i18n
      */
-    BasicDiagnosticFormatter(Options opts, Messages msgs) {
+    BasicDiagnosticFormatter(Options opts, JavacMessages msgs) {
         this(msgs); //common init
         String fmt = opts.get("diags");
         if (fmt != null) {
@@ -80,9 +80,9 @@
     /**
      * Create a standard basic formatter
      *
-     * @param msgs Messages object used for i18n
+     * @param msgs JavacMessages object used for i18n
      */
-    public BasicDiagnosticFormatter(Messages msgs) {
+    public BasicDiagnosticFormatter(JavacMessages msgs) {
         super(msgs);
         availableFormats = new HashMap<BasicFormatKind, String>();
         availableFormats.put(DEFAULT_POS_FORMAT, "%f:%l:%_%t%m");
@@ -91,6 +91,8 @@
     }
 
     public String format(JCDiagnostic d, Locale l) {
+        if (l == null)
+            l = messages.getCurrentLocale();
         String format = selectFormat(d);
         StringBuilder buf = new StringBuilder();
         for (int i = 0; i < format.length(); i++) {