jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1440102 - in /jackrabbit/branches/2.6: ./ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
Date Tue, 29 Jan 2013 20:30:30 GMT
Author: jukka
Date: Tue Jan 29 20:30:30 2013
New Revision: 1440102

URL: http://svn.apache.org/viewvc?rev=1440102&view=rev
Log:
2.6: Merged revision 1437933 (JCR-3499)

Modified:
    jackrabbit/branches/2.6/   (props changed)
    jackrabbit/branches/2.6/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java

Propchange: jackrabbit/branches/2.6/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1437933

Modified: jackrabbit/branches/2.6/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java?rev=1440102&r1=1440101&r2=1440102&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
Tue Jan 29 20:30:30 2013
@@ -16,8 +16,8 @@
  */
 package org.apache.jackrabbit.test.api;
 
-import java.util.Arrays;
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
@@ -58,12 +58,16 @@ public class NodeMixinUtil {
     public static String getNotAssignedMixinName(Session session, Node node) throws RepositoryException
{
         NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
         NodeTypeIterator mixins = manager.getMixinNodeTypes();
-        List<NodeType> existingMixins = Arrays.asList(node.getMixinNodeTypes());
+
+        Set<String> existingMixins = new HashSet<String>();
+        for (NodeType nt : node.getMixinNodeTypes()) {
+            existingMixins.add(nt.getName());
+        }
 
         while (mixins.hasNext()) {
-            NodeType nt = mixins.nextNodeType();
-            if (!existingMixins.contains(nt)) {
-                return nt.getName();
+            String ntName = mixins.nextNodeType().getName();
+            if (!existingMixins.contains(ntName)) {
+                return ntName;
             }
         }
         return null;



Mime
View raw message