src/share/classes/javax/imageio/stream/MemoryCache.java

Print this page
rev 9344 : 8034998: Fix raw and unchecked lint warnings in javax.imageio
Reviewed-by: darcy, prr

@@ -56,11 +56,11 @@
  */
 class MemoryCache {
 
     private static final int BUFFER_LENGTH = 8192;
 
-    private ArrayList cache = new ArrayList();
+    private ArrayList<byte[]> cache = new ArrayList<>();
 
     private long cacheStart = 0L;
 
     /**
      * The largest position ever written to the cache.

@@ -72,11 +72,11 @@
         if (blockOffset > Integer.MAX_VALUE) {
             // This can only happen when the cache hits 16 terabytes of
             // contiguous data...
             throw new IOException("Cache addressing limit exceeded!");
         }
-        return (byte[])cache.get((int)blockOffset);
+        return cache.get((int)blockOffset);
     }
 
     /**
      * Ensures that at least <code>pos</code> bytes are cached,
      * or the end of the source is reached.  The return value