< 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,19 +207,17 @@
         private void updateContent() {
             setEnv(params.getEnv());
         }
     };
 
-    private class EnvEntryComparator implements Comparator {
+    private class EnvEntryComparator implements Comparator<TestEnvironment.Element> {
         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;
+        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,12 +272,12 @@
             currEnv = env;
 
             if (currEnv == null)
                 elems = null;
             else {
-                Collection e = currEnv.elements();
-                elems = (TestEnvironment.Element[]) (e.toArray(new TestEnvironment.Element[e.size()]));
+                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,11 +319,11 @@
 
         public String getColumnName(int columnIndex) {
             return headings[columnIndex];
         }
 
-        public Class getColumnClass(int 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 >