jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject svn commit: r1539638 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Date Thu, 07 Nov 2013 13:45:56 GMT
Author: unico
Date: Thu Nov  7 13:45:56 2013
New Revision: 1539638

URL: http://svn.apache.org/r1539638
Log:
JCR-3690 apply patch by Frank van Lankvelt

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=1539638&r1=1539637&r2=1539638&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Thu Nov  7 13:45:56 2013
@@ -429,40 +429,11 @@ public class NodeTypeRegistry implements
                 return getEffectiveNodeType(name);
             }
 
-            if (!diff.isTrivial()) {
-
-                // TODO Implement checkForConflictingContent()
-                // make sure existing content would not conflict
-                // with new node type definition
-                //checkForConflictingContent(ntd);
-                //
-                // unregister old node type definition
-                //internalUnregister(name);
-                // register new definition
-                //EffectiveNodeType entNew = internalRegister(ntd);
-                //
-                // persist modified node type definitions
-                //customNTDefs.remove(name);
-                //customNTDefs.add(ntd);
-                //persistCustomNodeTypeDefs(customNTDefs);
-                //
-                // notify listeners
-                //notifyReRegistered(name);
-                //return entNew;
-
-                String message =
-                    "The following node type change contains non-trivial changes."
-                    + "Up until now only trivial changes are supported."
-                    + " (see javadoc for "
-                    + NodeTypeDefDiff.class.getName()
-                    + "):\n" + diff.toString();
-                throw new RepositoryException(message);
-            }
+            // make sure existing content would not conflict
+            // with new node type definition
+            checkForConflictingContent(ntd, diff);
 
             /**
-             * the change is trivial and has no effect on current content
-             * (e.g. that would be the case when non-mandatory properties had
-             * been added);
              * re-register node type definition and update caches &
              * notify listeners on re-registration
              */
@@ -949,20 +920,37 @@ public class NodeTypeRegistry implements
      * the above checks/actions are absolutely necessary in order to
      * guarantee integrity of repository content.
      *
+     *
      * @param ntd The node type definition replacing the former node type
      *            definition of the same name.
+     * @param diff
      * @throws RepositoryException If there is conflicting content or if the
      *                             check failed for some other reason.
      */
-    protected void checkForConflictingContent(QNodeTypeDefinition ntd)
+    protected void checkForConflictingContent(QNodeTypeDefinition ntd, final NodeTypeDefDiff
diff)
             throws RepositoryException {
+
+        if (!diff.isTrivial()) {
+            /**
+             * collect names of node types that have dependencies on the given
+             * node type
+             */
+            //Set dependentNTs = getDependentNodeTypes(ntd.getName());
+
+            String message =
+                    "The following node type change contains non-trivial changes."
+                            + "Up until now only trivial changes are supported."
+                            + " (see javadoc for "
+                            + NodeTypeDefDiff.class.getName()
+                            + "):\n" + diff.toString();
+            throw new RepositoryException(message);
+        }
+
         /**
-         * collect names of node types that have dependencies on the given
-         * node type
+         * the change is trivial and has no effect on current content
+         * (e.g. that would be the case when non-mandatory properties had
+         * been added);
          */
-        //Set dependentNTs = getDependentNodeTypes(ntd.getName());
-
-        throw new RepositoryException("not yet implemented");
     }
 
     /**



Mime
View raw message