Fix to maintain Java 6 compatability 30/430/1
authorEd Warnicke <eaw@cisco.com>
Tue, 4 Jun 2013 20:01:22 +0000 (15:01 -0500)
committerEd Warnicke <eaw@cisco.com>
Tue, 4 Jun 2013 20:01:22 +0000 (15:01 -0500)
Swapped out the use of Integer.compare (which requires Java 7)
for Integer.valueOf(x).compareTo(Integer.valueOf(y)) which
is promised to return the identical value here:
http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#compare(int, int)

Change-Id: I78d325351dac312d120f5c598ec9155d31cfb689
Signed-off-by: Ed Warnicke <eaw@cisco.com>
opendaylight/commons/concepts/src/main/java/org/opendaylight/controller/concepts/tranform/CompositeConditionalTransformer.java

index a31d896..ad3cdbc 100644 (file)
@@ -17,10 +17,10 @@ import java.util.TreeSet;
 /**\r
  * Composite transformer which aggregates multiple implementation and selects\r
  * the one which accepts the input.\r
- * \r
- * \r
+ *\r
+ *\r
  * @author Tony Tkacik\r
- * \r
+ *\r
  * @param <I>\r
  *            Input class for transformation\r
  * @param <P>\r
@@ -35,7 +35,7 @@ public class CompositeConditionalTransformer<I, P> implements
         @Override\r
         public int compare(TransformerWithPriority<I, P> o1,\r
                 TransformerWithPriority<I, P> o2) {\r
-            return Integer.compare(o1.priority, o2.priority);\r
+            return Integer.valueOf(o1.priority).compareTo(Integer.valueOf(o2.priority));\r
         }\r
 \r
     };\r
@@ -106,13 +106,13 @@ public class CompositeConditionalTransformer<I, P> implements
             SimpleConditionalTransformer<I, P> {\r
         final int priority;\r
         final SimpleConditionalTransformer<I, P> transformer;\r
-    \r
+\r
         public TransformerWithPriority(\r
                 SimpleConditionalTransformer<I, P> transformer, int priority) {\r
             this.priority = priority;\r
             this.transformer = transformer;\r
         }\r
-    \r
+\r
         @Override\r
         public int hashCode() {\r
             final int prime = 31;\r
@@ -121,7 +121,7 @@ public class CompositeConditionalTransformer<I, P> implements
                     + ((transformer == null) ? 0 : transformer.hashCode());\r
             return result;\r
         }\r
-    \r
+\r
         @Override\r
         public boolean equals(Object obj) {\r
             if (this == obj)\r
@@ -138,20 +138,20 @@ public class CompositeConditionalTransformer<I, P> implements
                 return false;\r
             return true;\r
         }\r
-    \r
+\r
         @Override\r
         public boolean isAcceptable(I input) {\r
             return transformer.isAcceptable(input);\r
         }\r
-    \r
+\r
         @Override\r
         public P transform(I input) {\r
             return transformer.transform(input);\r
         }\r
-        \r
-    \r
-    \r
-    \r
-    \r
+\r
+\r
+\r
+\r
+\r
     }\r
 }\r