< prev index next >

src/com/sun/javatest/TestResultCache.java

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

@@ -674,11 +674,11 @@
         // merge any tests in testsToWrite
         // testsToWrite is a thread-safe fifo, so it is safe to keep reading
         // it till its empty, even though some tests may even have been added
         // after the worker woke up
         TestResult tr;
-        while ((tr = (TestResult) (testsToWrite.remove())) != null) {
+        while ((tr = testsToWrite.remove()) != null) {
             // check if test is in the set we've just read
             String name = tr.getTestName();
             TestResult tr2 = tests.get(name);
             // if the cache file contains a conflicting entry,
             // reload the test from the .jtr file; otherwise, add it to the cache

@@ -692,12 +692,12 @@
         raf.seek(0);
         long now = System.currentTimeMillis();
         lastSerial = (int) ((now >> 16) + (now & 0xffff));
         raf.writeInt(lastSerial);
 
-        for (Iterator iter = tests.values().iterator(); iter.hasNext(); ) {
-            tr = (TestResult) (iter.next());
+        for (Iterator<TestResult> iter = tests.values().iterator(); iter.hasNext(); ) {
+            tr = iter.next();
             writeCacheEntry(tr);
         }
 
         if (DEBUG_WORK)
             Debug.println("TRC.writeCache write all (" + tests.size() + " tests)");

@@ -712,11 +712,11 @@
         // it till its empty, even though some tests may even have been added
         // after the worker woke up
         int debugCount = 0;
         raf.seek(lastFileSize);
         TestResult tr;
-        while ((tr = (TestResult) (testsToWrite.remove())) != null) {
+        while ((tr = testsToWrite.remove()) != null) {
             if (tests != null) {
                 // check if test is in the set we've just read
                 String name = tr.getTestName();
                 TestResult tr2 = tests.get(name);
                 if (tr2 != null) {

@@ -881,11 +881,11 @@
     private boolean fullUpdateRequested;
     private boolean compressNeeded;
     private boolean compressRequested;
     private boolean flushRequested;
     private boolean shutdownRequested;
-    private Fifo testsToWrite = new Fifo();
+    private Fifo<TestResult> testsToWrite = new Fifo<>();
 
     private static final String V1_FILENAME = "ResultCache.jtw";
     private static final String V1_LOCKNAME = V1_FILENAME + ".lck";
     private static final String V2_FILENAME = "ResultCache2.jtw";
     private static final String V2_LOCKNAME = V2_FILENAME + ".lck";
< prev index next >