< prev index next >

src/com/sun/javatest/KnownFailuresList.java

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

@@ -275,11 +275,11 @@
             return table.values().iterator();
         else {
             // flatten the enumeration into a vector, then
             // enumerate that
             List<Entry> v = new ArrayList<>(table.size());
-            for (Iterator<Entry> iter = table.values().iterator(); iter.hasNext(); ) {
+            for (Iterator<Object> iter = table.values().iterator(); iter.hasNext(); ) {
                 Object o = iter.next();
                 if (o instanceof Entry)
                     v.add((Entry)o);
                 else {
                     Entry[] entries = (Entry[])o;

@@ -300,12 +300,12 @@
      * @param other the exclude list to be merged with this one.
      *
      */
     public void merge(KnownFailuresList other) {
         synchronized (table) {
-            for (Iterator iter = other.getIterator(false); iter.hasNext(); ) {
-                Entry otherEntry = (Entry) (iter.next());
+            for (Iterator<Entry> iter = other.getIterator(false); iter.hasNext(); ) {
+                Entry otherEntry = iter.next();
                 Key key = new Key(otherEntry.relativeURL);
                 Object o = table.get(key);
                 if (o == null) {
                     // Easy case: nothing already exists in the table, so just
                     // add this one

@@ -705,11 +705,11 @@
     }
 
     /**
      * An entry in the exclude list.
      */
-    public static final class Entry implements Comparable {
+    public static final class Entry implements Comparable<Entry> {
         /**
          * Create an ExcludeList entry.
          * @param u The URL for the test, specified relative to the test suite root.
          * @param tc One or more test cases within the test to be excluded.
          * @param b An array of bug identifiers, justifying why the test is excluded.

@@ -730,12 +730,11 @@
             testCase = tc;
             bugIdStrings = b;
             notes = s;
         }
 
-        public int compareTo(Object o) {
-            Entry e = (Entry) o;
+        public int compareTo(Entry e) {
             int n = relativeURL.compareTo(e.relativeURL);
             if (n == 0) {
                 if (testCase == null && e.testCase == null)
                     return 0;
                 else if (testCase == null)
< prev index next >