jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r668147 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Date Mon, 16 Jun 2008 13:04:31 GMT
Author: stefan
Date: Mon Jun 16 06:04:31 2008
New Revision: 668147

URL: http://svn.apache.org/viewvc?rev=668147&view=rev
Log:
JCR-1651: Node.addNode(String, String) doesn't prevent use of mixin types as primary type

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=668147&r1=668146&r2=668147&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Mon Jun 16 06:04:31 2008
@@ -2121,6 +2121,9 @@
         sanityCheck();
 
         NodeTypeImpl nt = (NodeTypeImpl) session.getNodeTypeManager().getNodeType(nodeTypeName);
+        if (nt.isMixin()) {
+            throw new RepositoryException(nodeTypeName + ": not a primary node type");
+        }
         return internalAddNode(relPath, nt);
     }
 



Mime
View raw message