remove some unchecked warns

This commit is contained in:
gtully 2015-07-09 14:08:05 +01:00
parent 802e968f93
commit c454fe31fc
4 changed files with 10 additions and 16 deletions

View File

@ -95,13 +95,11 @@ public class CHeadersGenerator extends SingleSourceGenerator {
/** /**
* Sort the class list so that base classes come up first. * 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>(); LinkedHashMap<JClass, JClass> rc = new LinkedHashMap<JClass, JClass>();
ArrayList classes = new ArrayList(source); ArrayList<JClass> classes = new ArrayList<JClass>(source);
Collections.sort(classes, new Comparator() { Collections.sort(classes, new Comparator<JClass>() {
public int compare(Object o1, Object o2) { public int compare(JClass c1, JClass c2) {
JClass c1 = (JClass)o1;
JClass c2 = (JClass)o2;
return c1.getSimpleName().compareTo(c2.getSimpleName()); return c1.getSimpleName().compareTo(c2.getSimpleName());
} }
}); });

View File

@ -558,11 +558,9 @@ public class CSharpMarshallingGenerator extends JavaMarshallingGenerator {
out.println(" {"); out.println(" {");
out.println(" format.clearMarshallers();"); out.println(" format.clearMarshallers();");
List list = new ArrayList(getConcreteClasses()); List<JClass> list = new ArrayList<JClass>(getConcreteClasses());
Collections.sort(list, new Comparator() { Collections.sort(list, new Comparator<JClass>() {
public int compare(Object o1, Object o2) { public int compare(JClass c1, JClass c2) {
JClass c1 = (JClass)o1;
JClass c2 = (JClass)o2;
return c1.getSimpleName().compareTo(c2.getSimpleName()); return c1.getSimpleName().compareTo(c2.getSimpleName());
} }
}); });

View File

@ -40,7 +40,7 @@ public class CSourcesGenerator extends CHeadersGenerator {
return super.run(); return super.run();
} }
protected List sort(List source) { protected List<JClass> sort(List<JClass> source) {
return source; return source;
} }

View File

@ -309,10 +309,8 @@ public class JavaMarshallingGenerator extends MultiSourceGenerator {
out.println(""); out.println("");
List<JClass> list = new ArrayList<JClass>(getConcreteClasses()); List<JClass> list = new ArrayList<JClass>(getConcreteClasses());
Collections.sort(list, new Comparator() { Collections.sort(list, new Comparator<JClass>() {
public int compare(Object o1, Object o2) { public int compare(JClass c1, JClass c2) {
JClass c1 = (JClass)o1;
JClass c2 = (JClass)o2;
return c1.getSimpleName().compareTo(c2.getSimpleName()); return c1.getSimpleName().compareTo(c2.getSimpleName());
} }
}); });