jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1182929 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java
Date Thu, 13 Oct 2011 16:00:55 GMT
Author: stefan
Date: Thu Oct 13 16:00:55 2011
New Revision: 1182929

URL: http://svn.apache.org/viewvc?rev=1182929&view=rev
Log:
JCR-3112: NodeTypeDefDiff.PropDefDiff.init() constraints change check bugs

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java?rev=1182929&r1=1182928&r2=1182929&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java
Thu Oct 13 16:00:55 2011
@@ -512,16 +512,25 @@ public class NodeTypeDefDiff {
 
                 if (!set1.equals(set2)) {
                     // valueConstraints have been modified
-                    if (set2.containsAll(set1)) {
-                        // new set is a superset of old set
-                        // => constraints have been removed
-                        // (TRIVIAL change, since constraints are OR'ed)
+                    if (set2.isEmpty()) {
+                        // all existing constraints have been cleared
+                        // => TRIVIAL change
+                        type = TRIVIAL;
+                    } else if (set1.isEmpty()) {
+                        // constraints have been set on a previously unconstrained property
+                        // => MAJOR change
+                        type = MAJOR;
+                    } else if (set2.containsAll(set1)) {
+                        // new set is a superset of old set,
+                        // i.e. constraints have been weakened
+                        // (since constraints are OR'ed)
+                        // => TRIVIAL change
                         type = TRIVIAL;
                     } else {
                         // constraint have been removed/modified (MAJOR change);
                         // since we're unable to semantically compare
                         // value constraints (e.g. regular expressions), all
-                        // modifications are considered a MAJOR change.
+                        // such modifications are considered a MAJOR change.
                         type = MAJOR;
                     }
                 }



Mime
View raw message