JAL-1620 version bump and release notes
[jalview.git] / src / jalview / ws / jws2 / JabaParamStore.java
index 7ce1115..19af7b8 100644 (file)
@@ -1,19 +1,21 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
  * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  * Jalview is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
  *  
  * Jalview is distributed in the hope that it will be useful, but 
  * WITHOUT ANY WARRANTY; without even the implied warranty 
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  * PURPOSE.  See the GNU General Public License for more details.
  * 
- * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.ws.jws2;
@@ -33,6 +35,7 @@ import compbio.metadata.Preset;
 import compbio.metadata.PresetManager;
 import compbio.metadata.RunnerConfig;
 
+import jalview.util.MessageManager;
 import jalview.ws.jws2.dm.JabaOption;
 import jalview.ws.jws2.dm.JabaParameter;
 import jalview.ws.jws2.dm.JabaWsParamSet;
@@ -164,9 +167,7 @@ public class JabaParamStore implements ParamDatastoreI
       }
       if (narg == null)
       {
-        throw new Error(
-                "Implementation Error: Cannot handle Jaba parameter object "
-                        + rg.getClass());
+        throw new Error(MessageManager.formatMessage("error.implementation_error_cannot_handle_jaba_param", new String[]{rg.getClass().toString()}));
       }
       else
       {
@@ -182,12 +183,12 @@ public class JabaParamStore implements ParamDatastoreI
     String[] rgssorton = rgnames.toArray(new String[rgs.size()]);
     jalview.util.QuickSort.sort(rgssorton, rgssort);
     ArgumentI tmp1;
-    int i=0;
-    while (rgssort.length-i>i)
+    int i = 0;
+    while (rgssort.length - i > i)
     {
-      tmp1=rgssort[rgssort.length-i-1];
-      rgssort[rgssort.length-i-1] = rgssort[i];
-      rgssort[i++]=tmp1;
+      tmp1 = rgssort[rgssort.length - i - 1];
+      rgssort[rgssort.length - i - 1] = rgssort[i];
+      rgssort[i++] = tmp1;
     }
     return Arrays.asList(rgssort);
   }
@@ -201,9 +202,7 @@ public class JabaParamStore implements ParamDatastoreI
               .getOption() : null;
       if (narg == null)
       {
-        throw new Error(
-                "Implementation Error: Cannot handle Jaba parameter object "
-                        + rg.getClass());
+          throw new Error(MessageManager.formatMessage("error.implementation_error_cannot_handle_jaba_param", new String[]{rg.getClass().toString()}));
       }
       else
       {
@@ -241,8 +240,7 @@ public class JabaParamStore implements ParamDatastoreI
     }
     if (servicePresets.containsKey(name))
     {
-      throw new Error(
-              "Implementation error: Attempt to delete a service preset!");
+      throw new Error(MessageManager.getString("error.implementation_error_attempt_to_delete_service_preset"));
     }
   }
 
@@ -268,9 +266,7 @@ public class JabaParamStore implements ParamDatastoreI
             : getPreset(presetName));
     if (jps == null)
     {
-      throw new Error("Implementation error: Can't locate either oldname ("
-              + oldName + ") or presetName (" + presetName
-              + "in the datastore!");
+      throw new Error(MessageManager.formatMessage("error.implementation_error_cannot_locate_oldname_presetname", new String[]{oldName,presetName}));
     }
     jps.setName(presetName);
     jps.setDescription(text);
@@ -320,8 +316,7 @@ public class JabaParamStore implements ParamDatastoreI
   {
     if (!involves(urls))
     {
-      throw new IOException(
-              "Implementation error: Cannot find service url in the given url set!");
+      throw new IOException(MessageManager.getString("error.implementation_error_cannot_find_service_url_in_given_set"));
 
     }
     JabaWsParamSet wsp = new JabaWsParamSet();
@@ -346,15 +341,11 @@ public class JabaParamStore implements ParamDatastoreI
   {
     if (!involves(pset.getApplicableUrls()))
     {
-      throw new IOException(
-              "Implementation error: Cannot find service url in the given url set for this service parameter store ("
-                      + service.getUri() + ") !");
-
+      throw new IOException(MessageManager.formatMessage("error.implementation_error_cannot_find_service_url_in_given_set_param_store", new String[]{service.getUri()}));
     }
     if (!(pset instanceof JabaWsParamSet))
     {
-      throw new Error(
-              "Implementation error: JabaWsParamSets can only be handled by JabaParamStore");
+      throw new Error(MessageManager.getString("error.implementation_error_jabaws_param_set_only_handled_by"));
     }
 
     StringBuffer rslt = new StringBuffer();