8073213: javadoc of PushbackInputStream methods should specify NullPointerExceptions

Lance Andersen lance.andersen at oracle.com
Tue Jul 16 17:19:25 UTC 2019


+1
> On Jul 16, 2019, at 12:08 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> 
> https://bugs.openjdk.java.net/browse/JDK-8073213 <https://bugs.openjdk.java.net/browse/JDK-8073213>
> 
> Add javadoc of NPEs missing from two unread() methods; see below.
> 
> It would not hurt in this class to also change <code>…</code> to {@code …} and @exception to @throws but that would clutter up the review.
> 
> Thanks,
> 
> Brian
> 
> @@ -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 {

 <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>





More information about the core-libs-dev mailing list