jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r779225 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Date Wed, 27 May 2009 16:10:52 GMT
Author: angela
Date: Wed May 27 16:10:51 2009
New Revision: 779225

URL: http://svn.apache.org/viewvc?rev=779225&view=rev
Log:
JCR-1104: JSR 283 support

- Node.setPrimaryType should throws ConstraintViolation if nodetype is abstract. check was
missing
- Node.setPrimaryType should throws ConstraintViolation instead of RepositoryException if
the node type is mixin

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=779225&r1=779224&r2=779225&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
Wed May 27 16:10:51 2009
@@ -4684,8 +4684,11 @@
         }
 
         NodeTypeManagerImpl ntMgr = session.getNodeTypeManager();
-        if (ntMgr.getNodeType(ntName).isMixin()) {
-            throw new RepositoryException(nodeTypeName + ": not a primary node type");
+        NodeType nt = ntMgr.getNodeType(ntName);
+        if (nt.isMixin()) {
+            throw new ConstraintViolationException(nodeTypeName + ": not a primary node type.");
+        } else if (nt.isAbstract()) {
+            throw new ConstraintViolationException(nodeTypeName + ": is an abstract node
type.");
         }
 
         // build effective node type of new primary type & existing mixin's



Mime
View raw message