]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
small correction of the compare algorithm.
authormka <mka@opencascade.com>
Mon, 11 Mar 2013 11:23:25 +0000 (11:23 +0000)
committermka <mka@opencascade.com>
Mon, 11 Mar 2013 11:23:25 +0000 (11:23 +0000)
Workspace/Siman-Common/src/org/splat/service/StudyServiceImpl.java

index 4749a98b0eb0a8ff643053e1dac495a7ce937fc1..7a48fb602b825423996f1417ddda6d4e35a1e155 100644 (file)
@@ -45,12 +45,12 @@ import org.splat.dal.bo.som.ProgressState;
 import org.splat.dal.bo.som.Publication;
 import org.splat.dal.bo.som.SimulationContext;
 import org.splat.dal.bo.som.Study;
+import org.splat.dal.bo.som.Study.Properties;
 import org.splat.dal.bo.som.ValidationCycle;
+import org.splat.dal.bo.som.ValidationCycle.Actor;
 import org.splat.dal.bo.som.ValidationCycleRelation;
 import org.splat.dal.bo.som.ValidationStep;
 import org.splat.dal.bo.som.Visibility;
-import org.splat.dal.bo.som.Study.Properties;
-import org.splat.dal.bo.som.ValidationCycle.Actor;
 import org.splat.dal.dao.som.DescriptionAttributeDAO;
 import org.splat.dal.dao.som.DocumentDAO;
 import org.splat.dal.dao.som.IDBuilderDAO;
@@ -1140,7 +1140,7 @@ public class StudyServiceImpl implements StudyService {
         * @see org.splat.service.StudyService#compare(java.util.List)
         */
        @Override
-       public String compare (final List<DocToCompareDTO> docsList, final String userName) throws IncompatibleDataException{
+       public String compare (final List<DocToCompareDTO> docsList, final String userName) throws IncompatibleDataException {
                
                String axis1Name = "";
                String axis2Name = "";
@@ -1167,6 +1167,10 @@ public class StudyServiceImpl implements StudyService {
                                //get the name of the axis.
                                if (input.hasNext()) {
                                        String[] tokens = input.nextLine().split(",");
+                                       
+                                       if (tokens.length < 2)
+                                               throw new IncompatibleDataException(MessageKeyEnum.IDT_000001.toString());
+                                       
                                        if ("".equals(axis1Name)) {
                                                axis1Name = tokens[0];
                                        } else if (!axis1Name.equals(tokens[0])) {