[jbosstools-commits] JBoss Tools SVN: r41585 - trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu May 31 13:13:55 EDT 2012


Author: elvisisking
Date: 2012-05-31 13:13:54 -0400 (Thu, 31 May 2012)
New Revision: 41585

Modified:
   trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java
Log:
JBIDE-12056 Exception Adding/Editing Property Definition's Value Constraint In CND Editor. Fixed same issue with add/editing default values.

Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java	2012-05-31 16:47:55 UTC (rev 41584)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr.ui/src/org/jboss/tools/modeshape/jcr/ui/cnd/PropertyDialog.java	2012-05-31 17:13:54 UTC (rev 41585)
@@ -1135,8 +1135,12 @@
 
                         // check for duplicate
                         currentDefaultValues.add(newValue);
-                        return CndValidator.validateDefaultValues(propDefn.getName(), propDefn.getType(), currentDefaultValues,
-                                                                  accessExistingNamespacePrefixes());
+                        MultiValidationStatus validationStatus = CndValidator.validateDefaultValues(propDefn.getName(),
+                                                                                                    propDefn.getType(),
+                                                                                                    currentDefaultValues,
+                                                                                                    accessExistingNamespacePrefixes());
+                        currentDefaultValues.remove(newValue);
+                        return validationStatus;
                     }
                 };
 
@@ -1192,7 +1196,8 @@
 
                         // check for duplicate
                         currentConstraints.add(newValue);
-                        MultiValidationStatus validationStatus = CndValidator.validateValueConstraints(propDefn.getName(), currentConstraints);
+                        MultiValidationStatus validationStatus = CndValidator.validateValueConstraints(propDefn.getName(),
+                                                                                                       currentConstraints);
                         currentConstraints.remove(newValue);
                         return validationStatus;
                     }
@@ -1304,8 +1309,12 @@
 
                         // check for duplicate
                         currentDefaultValues.add(newValue);
-                        return CndValidator.validateDefaultValues(propDefn.getName(), propDefn.getType(), currentDefaultValues,
-                                                                  accessExistingNamespacePrefixes());
+                        MultiValidationStatus validationStatus = CndValidator.validateDefaultValues(propDefn.getName(),
+                                                                                                    propDefn.getType(),
+                                                                                                    currentDefaultValues,
+                                                                                                    accessExistingNamespacePrefixes());
+                        currentDefaultValues.remove(newValue);
+                        return validationStatus;
                     }
                 };
 
@@ -1381,7 +1390,10 @@
 
                         // check for duplicate
                         currentConstraints.add(newValue);
-                        return CndValidator.validateValueConstraints(propDefn.getName(), currentConstraints);
+                        MultiValidationStatus validationStatus = CndValidator.validateValueConstraints(propDefn.getName(),
+                                                                                                       currentConstraints);
+                        currentConstraints.remove(newValue);
+                        return validationStatus;
                     }
                 };
 



More information about the jbosstools-commits mailing list