< prev index next >

src/com/sun/javatest/finder/BinaryTestWriter.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

*** 276,286 **** if (ts == null) throw new NullPointerException(); try { ! Class c = Class.forName(finder); testFinder = (TestFinder) (c.newInstance()); testFinder.init(args, ts, null); } catch (ClassNotFoundException e) { throw new Fault("Error: Can't find class for test finder specified: " + finder); --- 276,286 ---- if (ts == null) throw new NullPointerException(); try { ! Class<?> c = Class.forName(finder); testFinder = (TestFinder) (c.newInstance()); testFinder.init(args, ts, null); } catch (ClassNotFoundException e) { throw new Fault("Error: Can't find class for test finder specified: " + finder);
*** 384,397 **** if (tests.length == 0 && files.length == 0) return null; Arrays.sort(files); ! Arrays.sort(tests, new Comparator() { ! public int compare(Object o1, Object o2) { ! TestDescription td1 = (TestDescription) o1; ! TestDescription td2 = (TestDescription) o2; return td1.getRootRelativeURL().compareTo(td2.getRootRelativeURL()); } }); Vector<TestTree.Node> v = new Vector<>(); --- 384,395 ---- if (tests.length == 0 && files.length == 0) return null; Arrays.sort(files); ! Arrays.sort(tests, new Comparator<TestDescription>() { ! public int compare(TestDescription td1, TestDescription td2) { return td1.getRootRelativeURL().compareTo(td2.getRootRelativeURL()); } }); Vector<TestTree.Node> v = new Vector<>();
*** 461,472 **** /** * Add all the strings used in a test description to the table. */ void add(TestDescription test) { ! for (Iterator i = test.getParameterKeys(); i.hasNext(); ) { ! String key = (String) (i.next()); String param = test.getParameter(key); add(key); add(param); } } --- 459,470 ---- /** * Add all the strings used in a test description to the table. */ void add(TestDescription test) { ! for (Iterator<String> i = test.getParameterKeys(); i.hasNext(); ) { ! String key = (i.next()); String param = test.getParameter(key); add(key); add(param); } }
*** 667,678 **** * followed by that many name-value pairs of string references. */ private void write(TestDescription td, DataOutputStream o) throws IOException { // should consider using load/save here writeInt(o, td.getParameterCount()); ! for (Iterator i = td.getParameterKeys(); i.hasNext(); ) { ! String key = (String) (i.next()); String value = td.getParameter(key); stringTable.writeRef(key, o); stringTable.writeRef(value, o); } } --- 665,676 ---- * followed by that many name-value pairs of string references. */ private void write(TestDescription td, DataOutputStream o) throws IOException { // should consider using load/save here writeInt(o, td.getParameterCount()); ! for (Iterator<String> i = td.getParameterKeys(); i.hasNext(); ) { ! String key = (i.next()); String value = td.getParameter(key); stringTable.writeRef(key, o); stringTable.writeRef(value, o); } }
< prev index next >