Merge branch 'develop' into develop_m2_8_1_2
[jalview.git] / src / jalview / ws / rest / RestJob.java
index 72dbb64..c89f241 100644 (file)
@@ -93,6 +93,7 @@ public class RestJob extends AWsJob
     // for formatters
     ArrayList<InputType> alinp = new ArrayList<InputType>();
     int paramsWithData = 0;
+    // TODO: JAL-715 - generalise the following validation logic for all parameter types
     // we cheat for moment - since we know a-priori what data is available and
     // what inputs we have implemented so far
     for (Map.Entry<String, InputType> prm : rsd.inputParams.entrySet())
@@ -105,11 +106,11 @@ public class RestJob extends AWsJob
         }
         else
         {
-          // TODO: move validation of input data to SeqGroupIndexVector
-          if ((prm.getValue() instanceof SeqGroupIndexVector)
-                  && (_input.getGroups() != null && _input.getGroups()
-                          .size() >= prm.getValue().min))
+          if (prm.getValue() instanceof SeqGroupIndexVector
+                  && _input.getGroups() != null
+                  && _input.getGroups().size() >= -1 + prm.getValue().min)
           {
+            // the test above is not rigorous but fixes JAL-1298, since submission will fail if the partition set doesn't contain at least one partition
             alinp.add(prm.getValue());
           }
           else