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

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

@@ -41,13 +41,13 @@
  * byte order interpretation, buffering, mark/reset, discarding,
  * closing, and disposing.
  */
 public abstract class ImageInputStreamImpl implements ImageInputStream {
 
-    private Stack markByteStack = new Stack();
+    private Stack<Long> markByteStack = new Stack<>();
 
-    private Stack markBitStack = new Stack();
+    private Stack<Integer> markBitStack = new Stack<>();
 
     private boolean isClosed = false;
 
     // Length of the buffer used for readFully(type[], int, int)
     private static final int BYTE_BUF_LENGTH = 8192;

@@ -796,18 +796,18 @@
     public void reset() throws IOException {
         if (markByteStack.empty()) {
             return;
         }
 
-        long pos = ((Long)markByteStack.pop()).longValue();
+        long pos = markByteStack.pop().longValue();
         if (pos < flushedPos) {
             throw new IIOException
                 ("Previous marked position has been discarded!");
         }
         seek(pos);
 
-        int offset = ((Integer)markBitStack.pop()).intValue();
+        int offset = markBitStack.pop().intValue();
         setBitOffset(offset);
     }
 
     public void flushBefore(long pos) throws IOException {
         checkClosed();