You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2012/01/27 16:28:48 UTC

svn commit: r1236716 - in /jackrabbit/branches/2.1: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java

Author: jukka
Date: Fri Jan 27 15:28:47 2012
New Revision: 1236716

URL: http://svn.apache.org/viewvc?rev=1236716&view=rev
Log:
2.1: Merged revision 1236709 (JCR-3223)

Modified:
    jackrabbit/branches/2.1/   (props changed)
    jackrabbit/branches/2.1/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java

Propchange: jackrabbit/branches/2.1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 27 15:28:47 2012
@@ -3,4 +3,4 @@
 /jackrabbit/sandbox/JCR-1456:774917-886178
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:931121,931479,931483-931484,931504,931609,931613,931838,931919,932318-932319,933144,933197,933203,933213,933216,933554,933646,933694,934405,934412,934849,935557,936668,938099,945528,950440,950680,955222,955229,955307,955852,961487,961626,964362,965539,986682,986686,986715,991144,995406,995411-995412,996810,999298-999299,999965,1000912,1000947,1001707,1002065-1002066,1002084,1002101-1002102,1002168,1002170,1002589,1002608,1002657,1002729,1003423,1003470,1003542,1003773,1004182,1004184,1004223-1004224,1004652,1005057,1005112,1032621,1036117,1036336-1036337,1038201,1039064,1039423,1040090,1064760,1065599,1069831,1071562,1071573,1087304,1089436,1100242,1101046,1102601,1104027,1165609,1173196
+/jackrabbit/trunk:931121,931479,931483-931484,931504,931609,931613,931838,931919,932318-932319,933144,933197,933203,933213,933216,933554,933646,933694,934405,934412,934849,935557,936668,938099,945528,950440,950680,955222,955229,955307,955852,961487,961626,964362,965539,986682,986686,986715,991144,995406,995411-995412,996810,999298-999299,999965,1000912,1000947,1001707,1002065-1002066,1002084,1002101-1002102,1002168,1002170,1002589,1002608,1002657,1002729,1003423,1003470,1003542,1003773,1004182,1004184,1004223-1004224,1004652,1005057,1005112,1032621,1036117,1036336-1036337,1038201,1039064,1039423,1040090,1064760,1065599,1069831,1071562,1071573,1087304,1089436,1100242,1101046,1102601,1104027,1165609,1173196,1236709

Modified: jackrabbit/branches/2.1/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.1/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=1236716&r1=1236715&r2=1236716&view=diff
==============================================================================
--- jackrabbit/branches/2.1/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java (original)
+++ jackrabbit/branches/2.1/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java Fri Jan 27 15:28:47 2012
@@ -77,6 +77,20 @@ public class NodeTypeRegistry implements
             "custom_nodetypes.xml";
 
     /**
+     * Feature flag for the unfortunate behavior in Jackrabbit 2.1 and 2.2
+     * where the exception from {@link #checkForReferencesInContent(Name)}
+     * was never thrown because of a mistaken commit for
+     * <a href="https://issues.apache.org/jira/browse/JCR-2587">JCR-2587</a>.
+     * Setting this flag to <code>true</code> (the default value comes from
+     * the "disableCheckForReferencesInContentException" system property)
+     * will disable the exception thrown by default by the method.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/JCR-3223">JCR-3223</a>
+     */
+    public static volatile boolean disableCheckForReferencesInContentException =
+            Boolean.getBoolean("disableCheckForReferencesInContentException");
+
+    /**
      * resource holding custom node type definitions which are represented as
      * nodes in the repository; it is needed in order to make the registrations
      * persistent.
@@ -950,7 +964,18 @@ public class NodeTypeRegistry implements
      */
     protected void checkForReferencesInContent(Name nodeTypeName)
             throws RepositoryException {
-        throw new RepositoryException("not yet implemented");
+        if (!disableCheckForReferencesInContentException) {
+            throw new RepositoryException(
+                    "The check for the existence of content using the"
+                    + " given node type is not yet implemented, so to"
+                    + " guarantee repository consistency the request to"
+                    + " unregister the type is denied. Contributions to"
+                    + " implement this feature would be welcome! To restore"
+                    + " the broken behavior of previous Jackrabbit versions"
+                    + " where this check was simply skipped, please set the"
+                    + " disableCheckForReferencesInContentException system"
+                    + " property to true.");
+        }
     }
 
     //-------------------------------------------------------< implementation >