jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1417461 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Date Wed, 05 Dec 2012 14:57:38 GMT
Author: angela
Date: Wed Dec  5 14:57:38 2012
New Revision: 1417461

URL: http://svn.apache.org/viewvc?rev=1417461&view=rev
Log:
OAK-493 : Drop fallback in Node#getPrimaryType

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java?rev=1417461&r1=1417460&r2=1417461&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
Wed Dec  5 14:57:38 2012
@@ -60,7 +60,6 @@ import static com.google.common.base.Pre
 import static javax.jcr.PropertyType.UNDEFINED;
 import static org.apache.jackrabbit.JcrConstants.JCR_MIXINTYPES;
 import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
-import static org.apache.jackrabbit.JcrConstants.NT_UNSTRUCTURED;
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 import static org.apache.jackrabbit.oak.api.Type.STRINGS;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.NODE_TYPES_PATH;
@@ -299,8 +298,7 @@ public abstract class ReadOnlyNodeTypeMa
             String ntName = jcrPrimaryType.getValue(STRING);
             primaryType = getNodeType(ntName);
         } else {
-            log.warn("Item at {} has no primary type. Assuming nt:unstructured", tree.getPath());
-            primaryType = getNodeType(NT_UNSTRUCTURED);
+            throw new RepositoryException("Node at "+tree.getPath()+" has no primary type.");
         }
         queue.add(primaryType);
 

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=1417461&r1=1417460&r2=1417461&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
Wed Dec  5 14:57:38 2012
@@ -816,13 +816,13 @@ public class NodeImpl extends ItemImpl<N
         return sessionDelegate.perform(new SessionOperation<NodeType>() {
             @Override
             public NodeType perform() throws RepositoryException {
-                // TODO: check if transient changes to mixin-types are reflected here
                 NodeTypeManager ntMgr = sessionDelegate.getNodeTypeManager();
                 String primaryNtName;
-                primaryNtName = hasProperty(Property.JCR_PRIMARY_TYPE)
-                        ? getProperty(Property.JCR_PRIMARY_TYPE).getString()
-                        : NodeType.NT_UNSTRUCTURED;
-
+                if (hasProperty(Property.JCR_PRIMARY_TYPE)) {
+                    primaryNtName = getProperty(Property.JCR_PRIMARY_TYPE).getString();
+                } else {
+                    throw new RepositoryException("Node " + getPath() + " doesn't have primary
type set.");
+                }
                 return ntMgr.getNodeType(primaryNtName);
             }
         });



Mime
View raw message