Author: stillalex
Date: Fri Sep 28 09:54:08 2018
New Revision: 1842227
URL: http://svn.apache.org/viewvc?rev=1842227&view=rev
Log:
OAK-7786 Make the NamespaceEditor less strict when enforcing changes to
rep:nsdata node
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceEditor.java
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceEditor.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceEditor.java?rev=1842227&r1=1842226&r2=1842227&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceEditor.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceEditor.java
Fri Sep 28 09:54:08 2018
@@ -46,6 +46,14 @@ import org.apache.jackrabbit.oak.spi.sta
*/
class NamespaceEditor extends DefaultEditor {
+ /**
+ * Flag controlling the strictness of the check to disallow modifications
to
+ * the internal node 'ns:data'. If enabled, any changes will throw a
+ * CommitFailedException, otherwise the index node will be rebuilt on any
+ * external change.
+ */
+ private static final boolean strictIntegrityCheck =
Boolean.getBoolean("oak.strictIntegrityCheck");
+
private final NodeBuilder builder;
private boolean modified = false;
@@ -137,7 +145,11 @@ class NamespaceEditor extends DefaultEdi
public Editor childNodeChanged(String name, NodeState before,
NodeState after) throws CommitFailedException {
if (REP_NSDATA.equals(name) && !before.equals(after)) {
- throw modificationNotAllowed(name);
+ if (strictIntegrityCheck) {
+ throw modificationNotAllowed(name);
+ } else {
+ modified = true;
+ }
}
return null;
}