jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1414761 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java
Date Wed, 28 Nov 2012 15:32:25 GMT
Author: alexparvulescu
Date: Wed Nov 28 15:32:24 2012
New Revision: 1414761

URL: http://svn.apache.org/viewvc?rev=1414761&view=rev
Log:
OAK-478 NPE in the TypeValidator when using the Lucene Index

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java?rev=1414761&r1=1414760&r2=1414761&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/ValidatingHook.java
Wed Nov 28 15:32:24 2012
@@ -151,7 +151,19 @@ public class ValidatingHook implements C
 
         @Override
         public void childNodeAdded(String name, NodeState after) {
-            childNodeChanged(name, EMPTY_NODE, after);
+            if (NodeStateUtils.isHidden(name)) {
+                return;
+            }
+            if (exception == null) {
+                try {
+                    Validator v = validator.childNodeAdded(name, after);
+                    if (v != null) {
+                        validate(v, EMPTY_NODE, after);
+                    }
+                } catch (CommitFailedException e) {
+                    exception = e;
+                }
+            }
         }
 
         @Override
@@ -175,7 +187,19 @@ public class ValidatingHook implements C
 
         @Override
         public void childNodeDeleted(String name, NodeState before) {
-            childNodeChanged(name, before, EMPTY_NODE);
+            if (NodeStateUtils.isHidden(name)) {
+                return;
+            }
+            if (exception == null) {
+                try {
+                    Validator v = validator.childNodeDeleted(name, before);
+                    if (v != null) {
+                        validate(v, before, EMPTY_NODE);
+                    }
+                } catch (CommitFailedException e) {
+                    exception = e;
+                }
+            }
         }
 
     }



Mime
View raw message