JAL-1807
[jalview.git] / src / jalview / util / MessageManager.java
index 4001cb2..5a5c70f 100644 (file)
@@ -26,6 +26,8 @@ import java.util.ResourceBundle;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javajs.J2SRequireImport;
+
 /**
  * 
  * @author David Roldan Martinez
@@ -33,6 +35,7 @@ import java.util.logging.Logger;
  * 
  * 
  */
+@J2SRequireImport ({java.text.MessageFormat.class})
 public class MessageManager
 {
 
@@ -53,7 +56,8 @@ public class MessageManager
       /* Getting messages for GV */
       log.info("Getting messages for lang: " + loc);
       rb = ResourceBundle.getBundle("lang.Messages", loc);
-      if (log.isLoggable(Level.FINEST))
+      // BH rb == null just throws the exception 
+      if (rb == null || log.isLoggable(Level.FINEST))
       {
         // this might take a while, so we only do it if it will be shown
         log.finest("Language keys: " + rb.keySet());
@@ -92,12 +96,12 @@ public class MessageManager
 
   public static String formatMessage(String key, Object... params)
   {
-    return MessageFormat.format(rb.getString(key), params);
+    return MessageFormat.format(getString(key), params); // BH not rb.getString
   }
 
   public static String formatMessage(String key, String[] params)
   {
-    return MessageFormat.format(rb.getString(key), (Object[]) params);
+    return MessageFormat.format(getString(key), (Object[]) params); // BH not rb.getString
   }
 
   /**