< prev index next >

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

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

@@ -995,24 +995,24 @@
      * changed.  If the cache is not invalidated at certain points, rendering
      * of the tree may be incorrect.
      */
     void invalidateNodeInfo() {
         synchronized (htLock) {
-            Enumeration e = cache.keys();
+            Enumeration<TestResultTable.TreeNode> e = cache.keys();
             while (e.hasMoreElements()) {
                 (cache.get(e.nextElement())).invalidate();
             }   // while
 
             cache = new Hashtable<>();
             cacheQueue = new LinkedList<>();
             suspendedQueue = new LinkedList<>();
         }
 
         // reprocess any needed nodes
-        Iterator it = relevantNodes.iterator();
+        Iterator<TT_TreeNode> it = relevantNodes.iterator();
         while (it.hasNext()) {
-            TT_TreeNode tn = (TT_TreeNode) it.next();
+            TT_TreeNode tn = it.next();
             if (tn instanceof TT_BasicNode) {
                 getNodeInfo(((TT_BasicNode) tn).getTableNode(), false);
             }
         }       // while
     }

@@ -1335,11 +1335,11 @@
             // note must already have htLock
             // note with this algo., the suspend and cache queues are
             //      basically equivalent
             TT_NodeCache selected = null;
             int depth = -1;
-            LinkedList theList = cacheQueue;
+            LinkedList<TT_NodeCache> theList = cacheQueue;
             boolean notDone = true;
             int count = 0;
 
             if (cacheQueue.size() == 0) {
                 if (suspendedQueue.size() == 0) {

@@ -1349,11 +1349,11 @@
                 }
             } else {
             }
 
             while (notDone) {
-                TT_NodeCache possible = (TT_NodeCache) (theList.get(count));
+                TT_NodeCache possible = (theList.get(count));
                 int thisDepth = TestResultTable.getObjectPath(possible.getNode()).length;
 
                 if (thisDepth > depth) {
                     theList.remove(count);
 
< prev index next >