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 e130dc7ea5..627481926c 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 sort(List source) { + protected List sort(List source) { LinkedHashMap rc = new LinkedHashMap(); - 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 classes = new ArrayList(source); + Collections.sort(classes, new Comparator() { + public int compare(JClass c1, JClass c2) { return c1.getSimpleName().compareTo(c2.getSimpleName()); } }); 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 f884a43f8f..9359629080 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 list = new ArrayList(getConcreteClasses()); + Collections.sort(list, new Comparator() { + public int compare(JClass c1, JClass c2) { return c1.getSimpleName().compareTo(c2.getSimpleName()); } }); 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 8f02d3e913..ae2188b94a 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 sort(List source) { return source; } 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 2354e47bbb..6ffaf61d55 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 list = new ArrayList(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() { + public int compare(JClass c1, JClass c2) { return c1.getSimpleName().compareTo(c2.getSimpleName()); } });