< prev index next >

src/com/sun/javatest/exec/EnvironmentBrowser.java

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

*** 207,225 **** private void updateContent() { setEnv(params.getEnv()); } }; ! private class EnvEntryComparator implements Comparator { EnvEntryComparator(int sortMode, String[] inherits) { this.sortMode = sortMode; this.inherits = inherits; } ! public int compare(Object o1, Object o2) { ! TestEnvironment.Element e1 = (TestEnvironment.Element)o1; ! TestEnvironment.Element e2 = (TestEnvironment.Element)o2; // the following should be a switch statement, but JDK // 1.1.7 can't compile it: doesn't recognize KEY etc as // constants. if (sortMode == KEY) // key should always be unique, so should be enough to sort on that --- 207,223 ---- private void updateContent() { setEnv(params.getEnv()); } }; ! private class EnvEntryComparator implements Comparator<TestEnvironment.Element> { EnvEntryComparator(int sortMode, String[] inherits) { this.sortMode = sortMode; this.inherits = inherits; } ! public int compare(TestEnvironment.Element e1, TestEnvironment.Element e2) { // the following should be a switch statement, but JDK // 1.1.7 can't compile it: doesn't recognize KEY etc as // constants. if (sortMode == KEY) // key should always be unique, so should be enough to sort on that
*** 274,285 **** currEnv = env; if (currEnv == null) elems = null; else { ! Collection e = currEnv.elements(); ! elems = (TestEnvironment.Element[]) (e.toArray(new TestEnvironment.Element[e.size()])); Arrays.sort(elems, new EnvEntryComparator(KEY, currEnv.getInherits())); } int newRowCount = getRowCount(); int commonRowCount = Math.min(oldRowCount, newRowCount); --- 272,283 ---- currEnv = env; if (currEnv == null) elems = null; else { ! Collection<TestEnvironment.Element> e = currEnv.elements(); ! elems = e.toArray(new TestEnvironment.Element[e.size()]); Arrays.sort(elems, new EnvEntryComparator(KEY, currEnv.getInherits())); } int newRowCount = getRowCount(); int commonRowCount = Math.min(oldRowCount, newRowCount);
*** 321,331 **** public String getColumnName(int columnIndex) { return headings[columnIndex]; } ! public Class getColumnClass(int columnIndex) { return String.class; } public synchronized Object getValueAt(int rowIndex, int columnIndex) { if (rowIndex < 0 || rowIndex >= getRowCount() --- 319,329 ---- public String getColumnName(int columnIndex) { return headings[columnIndex]; } ! public Class<?> getColumnClass(int columnIndex) { return String.class; } public synchronized Object getValueAt(int rowIndex, int columnIndex) { if (rowIndex < 0 || rowIndex >= getRowCount()
< prev index next >