You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2015/07/09 15:11:30 UTC

[2/3] activemq git commit: remove some unchecked warns

remove some unchecked warns


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/c454fe31
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/c454fe31
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/c454fe31

Branch: refs/heads/master
Commit: c454fe31fc6b263eb52cda6cced8ed5e98f6b6e4
Parents: 802e968
Author: gtully <ga...@gmail.com>
Authored: Thu Jul 9 14:08:05 2015 +0100
Committer: gtully <ga...@gmail.com>
Committed: Thu Jul 9 14:08:05 2015 +0100

----------------------------------------------------------------------
 .../apache/activemq/openwire/tool/CHeadersGenerator.java  | 10 ++++------
 .../openwire/tool/CSharpMarshallingGenerator.java         |  8 +++-----
 .../apache/activemq/openwire/tool/CSourcesGenerator.java  |  2 +-
 .../activemq/openwire/tool/JavaMarshallingGenerator.java  |  6 ++----
 4 files changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/c454fe31/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java
----------------------------------------------------------------------
diff --git a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java
index e130dc7..6274819 100644
--- a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java
+++ b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java
@@ -95,13 +95,11 @@ public class CHeadersGenerator extends SingleSourceGenerator {
     /**
      * Sort the class list so that base classes come up first.
      */
-    protected List<JClass> sort(List source) {
+    protected List<JClass> sort(List<JClass> source) {
         LinkedHashMap<JClass, JClass> rc = new LinkedHashMap<JClass, JClass>();
-        ArrayList classes = new ArrayList(source);
-        Collections.sort(classes, new Comparator() {
-            public int compare(Object o1, Object o2) {
-                JClass c1 = (JClass)o1;
-                JClass c2 = (JClass)o2;
+        ArrayList<JClass> classes = new ArrayList<JClass>(source);
+        Collections.sort(classes, new Comparator<JClass>() {
+            public int compare(JClass c1, JClass c2) {
                 return c1.getSimpleName().compareTo(c2.getSimpleName());
             }
         });

http://git-wip-us.apache.org/repos/asf/activemq/blob/c454fe31/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpMarshallingGenerator.java
----------------------------------------------------------------------
diff --git a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpMarshallingGenerator.java b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpMarshallingGenerator.java
index f884a43..9359629 100644
--- a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpMarshallingGenerator.java
+++ b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSharpMarshallingGenerator.java
@@ -558,11 +558,9 @@ public class CSharpMarshallingGenerator extends JavaMarshallingGenerator {
         out.println("        {");
         out.println("            format.clearMarshallers();");
 
-        List list = new ArrayList(getConcreteClasses());
-        Collections.sort(list, new Comparator() {
-            public int compare(Object o1, Object o2) {
-                JClass c1 = (JClass)o1;
-                JClass c2 = (JClass)o2;
+        List<JClass> list = new ArrayList<JClass>(getConcreteClasses());
+        Collections.sort(list, new Comparator<JClass>() {
+            public int compare(JClass c1, JClass c2) {
                 return c1.getSimpleName().compareTo(c2.getSimpleName());
             }
         });

http://git-wip-us.apache.org/repos/asf/activemq/blob/c454fe31/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSourcesGenerator.java
----------------------------------------------------------------------
diff --git a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSourcesGenerator.java b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSourcesGenerator.java
index 8f02d3e..ae2188b 100644
--- a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSourcesGenerator.java
+++ b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CSourcesGenerator.java
@@ -40,7 +40,7 @@ public class CSourcesGenerator extends CHeadersGenerator {
         return super.run();
     }
 
-    protected List sort(List source) {
+    protected List<JClass> sort(List<JClass> source) {
         return source;
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/c454fe31/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaMarshallingGenerator.java
----------------------------------------------------------------------
diff --git a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaMarshallingGenerator.java b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaMarshallingGenerator.java
index 2354e47..6ffaf61 100644
--- a/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaMarshallingGenerator.java
+++ b/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/JavaMarshallingGenerator.java
@@ -309,10 +309,8 @@ public class JavaMarshallingGenerator extends MultiSourceGenerator {
         out.println("");
 
         List<JClass> list = new ArrayList<JClass>(getConcreteClasses());
-        Collections.sort(list, new Comparator() {
-            public int compare(Object o1, Object o2) {
-                JClass c1 = (JClass)o1;
-                JClass c2 = (JClass)o2;
+        Collections.sort(list, new Comparator<JClass>() {
+            public int compare(JClass c1, JClass c2) {
                 return c1.getSimpleName().compareTo(c2.getSimpleName());
             }
         });