JAL-1354 use real var-args method signature to avoid ambiguity
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 21 Feb 2014 14:44:35 +0000 (14:44 +0000)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 21 Feb 2014 14:44:35 +0000 (14:44 +0000)
src/jalview/gui/AlignFrame.java
src/jalview/util/MessageManager.java

index 180a72c..d11bd31 100644 (file)
@@ -5302,7 +5302,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   ++i;
                   if (++icomp >= mcomp || i == (otherdb.size()))
                   {
-                    ifetch.setText(MessageManager.formatMessage("label.source_to_target",new String[]{imname,sname}));
+                    ifetch.setText(MessageManager.formatMessage("label.source_to_target",imname,sname));
                     dfetch.add(ifetch);
                     ifetch = new JMenu();
                     imname = null;
@@ -5314,7 +5314,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               ++dbi;
               if (comp >= mcomp || dbi >= (dbclasses.length))
               {
-                dfetch.setText(MessageManager.formatMessage("label.source_to_target",new String[]{mname,dbclass}));
+                dfetch.setText(MessageManager.formatMessage("label.source_to_target",mname,dbclass));
                 rfetch.add(dfetch);
                 dfetch = new JMenu();
                 mname = null;
index fcf2bfa..5f7f0e2 100644 (file)
@@ -61,7 +61,7 @@ public class MessageManager {
        public static Locale getLocale() {
                return loc;
        }
-       public static String formatMessage(String key, Object[] params){
-               return MessageFormat.format(rb.getString(key), params);
+       public static String formatMessage(String key, Object... params){
+               return MessageFormat.format(rb.getString(key), (Object[]) params);
        }
 }