Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The code of MarkShieldInputStream#reset is as follows:
public void reset() throws IOException { throw new IOException("mark/reset not supported"); }
The message indicates that it is better to throw UnsupportedOperationException. Indeed, otehr classes throw that exception in similar contexts:
WindowsLineEndingInputStream#mark
public synchronized void mark(final int readlimit) { throw new UnsupportedOperationException("Mark not supported"); }
NullReader#reset:
public synchronized void reset() throws IOException { if (!markSupported) { throw new UnsupportedOperationException("Mark not supported"); } if (mark < 0) { throw new IOException("No position has been marked"); } if (position > mark + readlimit) { throw new IOException("Marked position [" + mark + "] is no longer valid - passed the read limit [" + readlimit + "]"); } position = mark; eof = false; }