jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1437933 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
Date Thu, 24 Jan 2013 10:29:20 GMT
Author: mduerig
Date: Thu Jan 24 10:29:20 2013
New Revision: 1437933

URL: http://svn.apache.org/viewvc?rev=1437933&view=rev
Log:
JCR-3499: Test cases should not rely on equality of node types

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java?rev=1437933&r1=1437932&r2=1437933&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/NodeMixinUtil.java
Thu Jan 24 10:29:20 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