You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2011/12/14 14:47:06 UTC

svn commit: r1214241 - /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java

Author: reschke
Date: Wed Dec 14 13:47:05 2011
New Revision: 1214241

URL: http://svn.apache.org/viewvc?rev=1214241&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/PredefinedNodeTypeTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java?rev=1214241&r1=1214240&r2=1214241&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java Wed Dec 14 13:47:05 2011
@@ -55,7 +55,7 @@ import org.apache.jackrabbit.test.NotExe
  */
 public class PredefinedNodeTypeTest extends AbstractJCRTest {
 
-    private static final Map SUPERTYPES = new HashMap();
+    private static final Map<String, String[]> SUPERTYPES = new HashMap<String, String[]>();
 
     static {
         SUPERTYPES.put("mix:created", new String[]{});
@@ -334,15 +334,15 @@ public class PredefinedNodeTypeTest exte
             assertEquals("Predefined node type " + name, expected, current);
 
             // check minimum declared supertypes
-            Set declaredSupertypes = new HashSet();
-            for (Iterator it = Arrays.asList(
+            Set<String> declaredSupertypes = new HashSet<String>();
+            for (Iterator<NodeType> it = Arrays.asList(
                     type.getDeclaredSupertypes()).iterator(); it.hasNext(); ) {
-                NodeType nt = (NodeType) it.next();
+                NodeType nt = it.next();
                 declaredSupertypes.add(nt.getName());
             }
-            for (Iterator it = Arrays.asList(
-                    (String[]) SUPERTYPES.get(name)).iterator(); it.hasNext(); ) {
-                String supertype = (String) it.next();
+            for (Iterator<String> it = Arrays.asList(
+                    SUPERTYPES.get(name)).iterator(); it.hasNext(); ) {
+                String supertype = it.next();
                 assertTrue("Predefined node type " + name + " does not " +
                         "declare supertype " + supertype,
                         declaredSupertypes.contains(supertype));
@@ -518,10 +518,8 @@ public class PredefinedNodeTypeTest exte
      * Comparator for ordering node definition arrays. Node definitions are
      * ordered by name, with the wildcard item definition ("*") ordered last.
      */
-    private static final Comparator NODE_DEF_COMPARATOR = new Comparator() {
-        public int compare(Object a, Object b) {
-            NodeDefinition nda = (NodeDefinition) a;
-            NodeDefinition ndb = (NodeDefinition) b;
+    private static final Comparator<NodeDefinition> NODE_DEF_COMPARATOR = new Comparator<NodeDefinition>() {
+        public int compare(NodeDefinition nda, NodeDefinition ndb) {
             if (nda.getName().equals("*") && !ndb.getName().equals("*")) {
                 return 1;
             } else if (!nda.getName().equals("*") && ndb.getName().equals("*")) {
@@ -537,10 +535,8 @@ public class PredefinedNodeTypeTest exte
      * are ordered by name, with the wildcard item definition ("*") ordered
      * last, and isMultiple flag, with <code>isMultiple==true</code> ordered last.
      */
-    private static final Comparator PROPERTY_DEF_COMPARATOR = new Comparator() {
-        public int compare(Object a, Object b) {
-            PropertyDefinition pda = (PropertyDefinition) a;
-            PropertyDefinition pdb = (PropertyDefinition) b;
+    private static final Comparator<PropertyDefinition> PROPERTY_DEF_COMPARATOR = new Comparator<PropertyDefinition>() {
+        public int compare(PropertyDefinition pda, PropertyDefinition pdb) {
             if (pda.getName().equals("*") && !pdb.getName().equals("*")) {
                 return 1;
             } else if (!pda.getName().equals("*") && pdb.getName().equals("*")) {
@@ -564,10 +560,8 @@ public class PredefinedNodeTypeTest exte
      * Comparator for ordering node type arrays. Node types are ordered by
      * name, with all primary node types ordered before mixin node types.
      */
-    private static final Comparator NODE_TYPE_COMPARATOR = new Comparator() {
-        public int compare(Object a, Object b) {
-            NodeType nta = (NodeType) a;
-            NodeType ntb = (NodeType) b;
+    private static final Comparator<NodeType> NODE_TYPE_COMPARATOR = new Comparator<NodeType>() {
+        public int compare(NodeType nta, NodeType ntb) {
             if (nta.isMixin() && !ntb.isMixin()) {
                 return 1;
             } else if (!nta.isMixin() && ntb.isMixin()) {