jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1447940 - in /jackrabbit/oak/trunk/oak-jcr/src: main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java test/java/org/apache/jackrabbit/oak/jcr/CRUDTest.java
Date Tue, 19 Feb 2013 21:55:52 GMT
Author: mduerig
Date: Tue Feb 19 21:55:52 2013
New Revision: 1447940

URL: http://svn.apache.org/r1447940
Log:
OAK-642: NPE trying to add a node to an nt:folder node

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CRUDTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1447940&r1=1447939&r2=1447940&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Tue Feb 19 21:55:52 2013
@@ -250,11 +250,10 @@ public class NodeImpl<T extends NodeDele
                 String ntName = primaryNodeTypeName;
                 if (ntName == null) {
                     DefinitionProvider dp = sessionDelegate.getDefinitionProvider();
-                    try {
-                        String childName = sessionDelegate.getOakName(PathUtils.getName(relPath));
-                        NodeDefinition def = dp.getDefinition(new NodeImpl<NodeDelegate>(parent),
childName);
-                        ntName = def.getDefaultPrimaryTypeName();
-                    } catch (RepositoryException e) {
+                    String childName = sessionDelegate.getOakName(PathUtils.getName(relPath));
+                    NodeDefinition def = dp.getDefinition(new NodeImpl<NodeDelegate>(parent),
childName);
+                    ntName = def.getDefaultPrimaryTypeName();
+                    if (ntName == null) {
                         throw new ConstraintViolationException(
                                 "no matching child node definition found for " + relPath);
                     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CRUDTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CRUDTest.java?rev=1447940&r1=1447939&r2=1447940&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CRUDTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/CRUDTest.java
Tue Feb 19 21:55:52 2013
@@ -24,7 +24,6 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.ConstraintViolationException;
 
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static junit.framework.Assert.assertEquals;
@@ -119,7 +118,6 @@ public class CRUDTest extends AbstractRe
     }
     
     @Test(expected = ConstraintViolationException.class)
-    @Ignore("OAK-642")
     public void nodeType() throws RepositoryException {
             Session s = getAdminSession();
             s.getRootNode().addNode("a", "nt:folder").addNode("b");



Mime
View raw message