jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770219 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
Date Thu, 30 Apr 2009 13:35:34 GMT
Author: jukka
Date: Thu Apr 30 13:35:34 2009
New Revision: 770219

URL: http://svn.apache.org/viewvc?rev=770219&view=rev
Log:
JCR-1591: JSR 283: NodeType Management

Change method signature to match JSR 283 PFD version

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

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java?rev=770219&r1=770218&r2=770219&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
Thu Apr 30 13:35:34 2009
@@ -619,11 +619,9 @@
      * @since JCR 2.0
      */
     public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate)
-            throws InvalidNodeTypeDefinitionException, NodeTypeExistsException,
-            UnsupportedRepositoryOperationException, RepositoryException {
-        HashSet defs = new HashSet();
-        defs.add(ntd);
-        return (NodeType) registerNodeTypes(defs, allowUpdate).next();
+            throws RepositoryException {
+        NodeTypeDefinition[] ntds = new NodeTypeDefinition[] { ntd };
+        return registerNodeTypes(ntds, allowUpdate).nextNodeType();
     }
 
     /**
@@ -664,8 +662,8 @@
      * @throws RepositoryException if another error occurs.
      * @since JCR 2.0
      */
-    public NodeTypeIterator registerNodeTypes(Collection definitions,
-                                              boolean allowUpdate)
+    public NodeTypeIterator registerNodeTypes(
+            NodeTypeDefinition[] definitions, boolean allowUpdate)
             throws InvalidNodeTypeDefinitionException, NodeTypeExistsException,
             UnsupportedRepositoryOperationException, RepositoryException {
         // split the node types into new and already registered node types.
@@ -673,8 +671,7 @@
         // registered node types which make circular dependencies possible
         List addedDefs = new ArrayList();
         List modifiedDefs = new ArrayList();
-        for (Iterator iter = definitions.iterator(); iter.hasNext();) {
-            NodeTypeDefinition definition = (NodeTypeDefinition) iter.next();
+        for (NodeTypeDefinition definition : definitions) {
             // convert to NodeTypeDef
             NodeTypeDef def = toNodeTypeDef(definition);
             if (ntReg.isRegistered(def.getName())) {
@@ -956,4 +953,5 @@
         ps.println();
         ntReg.dump(ps);
     }
+
 }



Mime
View raw message