jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1213809 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype: NodeDefTest.java NodeTypeTest.java
Date Tue, 13 Dec 2011 18:00:01 GMT
Author: reschke
Date: Tue Dec 13 18:00:01 2011
New Revision: 1213809

URL: http://svn.apache.org/viewvc?rev=1213809&view=rev
Log:
JCR-3177: Remove jdk 1.4 restriction for jcr-tests

Reduce warning noise on nodetype tests

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

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java?rev=1213809&r1=1213808&r2=1213809&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeDefTest.java
Tue Dec 13 18:00:01 2011
@@ -195,12 +195,12 @@ public class NodeDefTest extends Abstrac
             
             for (int i = 0; i < defs.length; i++) {
                 NodeType requiredPrimaryTypes[] = defs[i].getRequiredPrimaryTypes();
-                Set rptnames = new HashSet();
+                Set<String> rptnames = new HashSet<String>();
                 for (int j = 0; j < requiredPrimaryTypes.length; j++) {
                     rptnames.add(requiredPrimaryTypes[j].getName());
                 }
                 
-                Set rptnames2 = new HashSet(Arrays.asList(defs[i].getRequiredPrimaryTypeNames()));
+                Set<String> rptnames2 = new HashSet<String>(Arrays.asList(defs[i].getRequiredPrimaryTypeNames()));
                 assertEquals("names returned from getRequiredPrimaryTypeNames should match
types returned from getRequiredPrimaryTypes", rptnames, rptnames2);
             }
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeTest.java?rev=1213809&r1=1213808&r2=1213809&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeTest.java
Tue Dec 13 18:00:01 2011
@@ -208,15 +208,15 @@ public class NodeTypeTest extends Abstra
         for (NodeTypeIterator types = manager.getAllNodeTypes(); types.hasNext(); ) {
             NodeType type = types.nextNodeType();
 
-            Set declaredSupertypeNames = asSetOfNames(type.getDeclaredSupertypes());
-            Set supertypeNames = asSetOfNames(type.getSupertypes());
+            Set<String> declaredSupertypeNames = asSetOfNames(type.getDeclaredSupertypes());
+            Set<String> supertypeNames = asSetOfNames(type.getSupertypes());
             
             assertTrue("all declared supertypes must be supertypes: "
-                    + (new HashSet(declaredSupertypeNames).removeAll(supertypeNames)),
+                    + (new HashSet<String>(declaredSupertypeNames).removeAll(supertypeNames)),
                     supertypeNames.containsAll(declaredSupertypeNames));
             
             assertEquals("getDeclaredSuperTypes and getDeclaredSuperTypeNames must be consistent",
-                    declaredSupertypeNames, new HashSet(Arrays.asList(type.getDeclaredSupertypeNames())));
+                    declaredSupertypeNames, new HashSet<String>(Arrays.asList(type.getDeclaredSupertypeNames())));
         }
     }
 
@@ -234,26 +234,26 @@ public class NodeTypeTest extends Abstra
             NodeType type = types.nextNodeType();
             String name = type.getName();
 
-            Set declaredSubtypeNames = asSetOfNames(type.getDeclaredSubtypes());
-            Set subtypeNames = asSetOfNames(type.getSubtypes());
+            Set<String> declaredSubtypeNames = asSetOfNames(type.getDeclaredSubtypes());
+            Set<String> subtypeNames = asSetOfNames(type.getSubtypes());
             
             assertTrue("all declared subtypes must be subtypes: "
-                    + (new HashSet(declaredSubtypeNames).removeAll(subtypeNames)),
+                    + (new HashSet<String>(declaredSubtypeNames).removeAll(subtypeNames)),
                     subtypeNames.containsAll(declaredSubtypeNames));
             
             // check the reverse relation
-            for (Iterator it = subtypeNames.iterator(); it.hasNext(); ) {
-                String subtypename = (String) it.next();
+            for (Iterator<String> it = subtypeNames.iterator(); it.hasNext(); ) {
+                String subtypename = it.next();
                 boolean isDeclared = declaredSubtypeNames.contains(subtypename);
                 
                 NodeType subtype = manager.getNodeType(subtypename);
-                Set supertypeNames = asSetOfNames(subtype.getSupertypes());
+                Set<String> supertypeNames = asSetOfNames(subtype.getSupertypes());
                 
                 assertTrue(name + " should occur in set of super types: " + supertypeNames,
                         supertypeNames.contains(name));
                 
                 if (isDeclared) {
-                    Set declaredSupertypeNames = asSetOfNames(subtype.getDeclaredSupertypes());
+                    Set<String> declaredSupertypeNames = asSetOfNames(subtype.getDeclaredSupertypes());
                     assertTrue(name + " should occur in set of declared super types: " +
declaredSupertypeNames,
                             declaredSupertypeNames.contains(name));
                 }
@@ -444,8 +444,8 @@ public class NodeTypeTest extends Abstra
     /**
      * Return the set of node type names for the specified node types.
      */
-    private Set asSetOfNames(NodeType[] types) {
-        Set result = new HashSet();
+    private Set<String> asSetOfNames(NodeType[] types) {
+        Set<String> result = new HashSet<String>();
         for (int i = 0; i < types.length; i++) {
             result.add(types[i].getName());
         }
@@ -455,8 +455,8 @@ public class NodeTypeTest extends Abstra
     /**
      * Return the set of node type names for the specified node types.
      */
-    private Set asSetOfNames(NodeTypeIterator it) {
-        Set result = new HashSet();
+    private Set<String> asSetOfNames(NodeTypeIterator it) {
+        Set<String> result = new HashSet<String>();
         while (it.hasNext()) {
             result.add(it.nextNodeType().getName());
         }



Mime
View raw message