Summary
Add javadoc of thrown NullPointerExceptions to the two unread() methods of java.io.PushbackInputStream which accept a byte array parameter.
Problem
The methods unread(byte[]) and unread(byte[],int,int) of java.io.PushbackInputStream do not have a throws clause for NullPointerException even though these methods may throw such an exception if the byte array parameter is null.
Solution
Add
@exception NullPointerException If <code>b</code> is <code>null</code>.
to the javadoc of unread(byte[]) and unread(byte[],int,int).
Specification
@@ -213,14 +213,15 @@
* of the pushback buffer. After this method returns, the next byte to be
* read will have the value <code>b[off]</code>, the byte after that will
* have the value <code>b[off+1]</code>, and so forth.
*
* @param b the byte array to push back.
* @param off the start offset of the data.
* @param len the number of bytes to push back.
+ * @exception NullPointerException If <code>b</code> is <code>null</code>.
* @exception IOException If there is not enough room in the pushback
* buffer for the specified number of bytes,
* or this input stream has been closed by
* invoking its {@link #close()} method.
* @since 1.1
*/
public void unread(byte[] b, int off, int len) throws IOException {
@@ -235,14 +236,15 @@
/**
* Pushes back an array of bytes by copying it to the front of the
* pushback buffer. After this method returns, the next byte to be read
* will have the value <code>b[0]</code>, the byte after that will have the
* value <code>b[1]</code>, and so forth.
*
* @param b the byte array to push back
+ * @exception NullPointerException If <code>b</code> is <code>null</code>.
* @exception IOException If there is not enough room in the pushback
* buffer for the specified number of bytes,
* or this input stream has been closed by
* invoking its {@link #close()} method.
* @since 1.1
*/
public void unread(byte[] b) throws IOException {
- csr of
-
JDK-8073213 javadoc of PushbackInputStream methods should specify NullPointerExceptions
-
- Resolved
-