8230648: Replace @exception tag with @throws in java.base

Minor coding style update of javadoc tag in any file in java.base

Reviewed-by: prappo, lancea
This commit is contained in:
Julia Boes 2019-09-20 11:07:52 +01:00
parent 2fc6c6459d
commit b15b322cf3
196 changed files with 1959 additions and 1962 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -54,7 +54,7 @@ class CheckedInputStream extends FilterInputStream {
/**
* Reads a byte. Will block if no input is available.
* @return the byte read, or -1 if the end of the stream is reached.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public int read() throws IOException {
int b = in.read();
@ -73,11 +73,11 @@ class CheckedInputStream extends FilterInputStream {
* @param len the maximum number of bytes read
* @return the actual number of bytes read, or -1 if the end
* of the stream is reached.
* @exception NullPointerException If <code>buf</code> is <code>null</code>.
* @exception IndexOutOfBoundsException If <code>off</code> is negative,
* @throws NullPointerException If <code>buf</code> is <code>null</code>.
* @throws IndexOutOfBoundsException If <code>off</code> is negative,
* <code>len</code> is negative, or <code>len</code> is greater than
* <code>buf.length - off</code>
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public int read(byte[] buf, int off, int len) throws IOException {
len = in.read(buf, off, len);
@ -91,7 +91,7 @@ class CheckedInputStream extends FilterInputStream {
* Skips specified number of bytes of input.
* @param n the number of bytes to skip
* @return the actual number of bytes skipped
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public long skip(long n) throws IOException {
byte[] buf = new byte[512];

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -55,7 +55,7 @@ class CheckedOutputStream extends FilterOutputStream {
/**
* Writes a byte. Will block until the byte is actually written.
* @param b the byte to be written
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void write(int b) throws IOException {
out.write(b);
@ -68,7 +68,7 @@ class CheckedOutputStream extends FilterOutputStream {
* @param b the data to be written
* @param off the start offset of the data
* @param len the number of bytes to be written
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void write(byte[] b, int off, int len) throws IOException {
out.write(b, off, len);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -364,7 +364,7 @@ public class Deflater {
* effect only after that invocation.
*
* @param strategy the new compression strategy
* @exception IllegalArgumentException if the compression strategy is
* @throws IllegalArgumentException if the compression strategy is
* invalid
*/
public void setStrategy(int strategy) {
@ -393,7 +393,7 @@ public class Deflater {
* take effect only after that invocation.
*
* @param level the new compression level (0-9)
* @exception IllegalArgumentException if the compression level is invalid
* @throws IllegalArgumentException if the compression level is invalid
*/
public void setLevel(int level) {
if ((level < 0 || level > 9) && level != DEFAULT_COMPRESSION) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -101,7 +101,7 @@ class DeflaterOutputStream extends FilterOutputStream {
* @param out the output stream
* @param def the compressor ("deflater")
* @param size the output buffer size
* @exception IllegalArgumentException if {@code size <= 0}
* @throws IllegalArgumentException if {@code size <= 0}
*/
public DeflaterOutputStream(OutputStream out, Deflater def, int size) {
this(out, def, size, false);
@ -180,7 +180,7 @@ class DeflaterOutputStream extends FilterOutputStream {
* Writes a byte to the compressed output stream. This method will
* block until the byte can be written.
* @param b the byte to be written
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void write(int b) throws IOException {
byte[] buf = new byte[1];
@ -194,7 +194,7 @@ class DeflaterOutputStream extends FilterOutputStream {
* @param b the data to be written
* @param off the start offset of the data
* @param len the length of the data
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void write(byte[] b, int off, int len) throws IOException {
if (def.finished()) {
@ -217,7 +217,7 @@ class DeflaterOutputStream extends FilterOutputStream {
* Finishes writing compressed data to the output stream without closing
* the underlying stream. Use this method when applying multiple filters
* in succession to the same output stream.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void finish() throws IOException {
if (!def.finished()) {
@ -231,7 +231,7 @@ class DeflaterOutputStream extends FilterOutputStream {
/**
* Writes remaining compressed data to the output stream and closes the
* underlying stream.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void close() throws IOException {
if (!closed) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -69,10 +69,10 @@ class GZIPInputStream extends InflaterInputStream {
* @param in the input stream
* @param size the input buffer size
*
* @exception ZipException if a GZIP format error has occurred or the
* @throws ZipException if a GZIP format error has occurred or the
* compression method used is unsupported
* @exception IOException if an I/O error has occurred
* @exception IllegalArgumentException if {@code size <= 0}
* @throws IOException if an I/O error has occurred
* @throws IllegalArgumentException if {@code size <= 0}
*/
public GZIPInputStream(InputStream in, int size) throws IOException {
super(in, new Inflater(true), size);
@ -84,9 +84,9 @@ class GZIPInputStream extends InflaterInputStream {
* Creates a new input stream with a default buffer size.
* @param in the input stream
*
* @exception ZipException if a GZIP format error has occurred or the
* @throws ZipException if a GZIP format error has occurred or the
* compression method used is unsupported
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public GZIPInputStream(InputStream in) throws IOException {
this(in, 512);
@ -102,12 +102,12 @@ class GZIPInputStream extends InflaterInputStream {
* @return the actual number of bytes read, or -1 if the end of the
* compressed input stream is reached
*
* @exception NullPointerException If <code>buf</code> is <code>null</code>.
* @exception IndexOutOfBoundsException If <code>off</code> is negative,
* @throws NullPointerException If <code>buf</code> is <code>null</code>.
* @throws IndexOutOfBoundsException If <code>off</code> is negative,
* <code>len</code> is negative, or <code>len</code> is greater than
* <code>buf.length - off</code>
* @exception ZipException if the compressed input data is corrupt.
* @exception IOException if an I/O error has occurred.
* @throws ZipException if the compressed input data is corrupt.
* @throws IOException if an I/O error has occurred.
*
*/
public int read(byte[] buf, int off, int len) throws IOException {
@ -130,7 +130,7 @@ class GZIPInputStream extends InflaterInputStream {
/**
* Closes this input stream and releases any system resources associated
* with the stream.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void close() throws IOException {
if (!closed) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -61,8 +61,8 @@ class GZIPOutputStream extends DeflaterOutputStream {
*
* @param out the output stream
* @param size the output buffer size
* @exception IOException If an I/O error has occurred.
* @exception IllegalArgumentException if {@code size <= 0}
* @throws IOException If an I/O error has occurred.
* @throws IllegalArgumentException if {@code size <= 0}
*/
public GZIPOutputStream(OutputStream out, int size) throws IOException {
this(out, size, false);
@ -80,8 +80,8 @@ class GZIPOutputStream extends DeflaterOutputStream {
* this instance flushes the compressor with flush mode
* {@link Deflater#SYNC_FLUSH} before flushing the output
* stream, otherwise only flushes the output stream
* @exception IOException If an I/O error has occurred.
* @exception IllegalArgumentException if {@code size <= 0}
* @throws IOException If an I/O error has occurred.
* @throws IllegalArgumentException if {@code size <= 0}
*
* @since 1.7
*/
@ -104,7 +104,7 @@ class GZIPOutputStream extends DeflaterOutputStream {
* the 2-argument constructor GZIPOutputStream(out, false).
*
* @param out the output stream
* @exception IOException If an I/O error has occurred.
* @throws IOException If an I/O error has occurred.
*/
public GZIPOutputStream(OutputStream out) throws IOException {
this(out, 512, false);
@ -122,7 +122,7 @@ class GZIPOutputStream extends DeflaterOutputStream {
* {@link Deflater#SYNC_FLUSH} before flushing the output
* stream, otherwise only flushes the output stream
*
* @exception IOException If an I/O error has occurred.
* @throws IOException If an I/O error has occurred.
*
* @since 1.7
*/
@ -138,7 +138,7 @@ class GZIPOutputStream extends DeflaterOutputStream {
* @param buf the data to be written
* @param off the start offset of the data
* @param len the length of the data
* @exception IOException If an I/O error has occurred.
* @throws IOException If an I/O error has occurred.
*/
public synchronized void write(byte[] buf, int off, int len)
throws IOException
@ -151,7 +151,7 @@ class GZIPOutputStream extends DeflaterOutputStream {
* Finishes writing compressed data to the output stream without closing
* the underlying stream. Use this method when applying multiple filters
* in succession to the same output stream.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void finish() throws IOException {
if (!def.finished()) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -76,7 +76,7 @@ class InflaterInputStream extends FilterInputStream {
* @param in the input stream
* @param inf the decompressor ("inflater")
* @param size the input buffer size
* @exception IllegalArgumentException if {@code size <= 0}
* @throws IllegalArgumentException if {@code size <= 0}
*/
public InflaterInputStream(InputStream in, Inflater inf, int size) {
super(in);
@ -116,7 +116,7 @@ class InflaterInputStream extends FilterInputStream {
* Reads a byte of uncompressed data. This method will block until
* enough input is available for decompression.
* @return the byte read, or -1 if end of compressed input is reached
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public int read() throws IOException {
ensureOpen();
@ -132,12 +132,12 @@ class InflaterInputStream extends FilterInputStream {
* @param len the maximum number of bytes read
* @return the actual number of bytes read, or -1 if the end of the
* compressed input is reached or a preset dictionary is needed
* @exception NullPointerException If <code>b</code> is <code>null</code>.
* @exception IndexOutOfBoundsException If <code>off</code> is negative,
* @throws NullPointerException If <code>b</code> is <code>null</code>.
* @throws IndexOutOfBoundsException If <code>off</code> is negative,
* <code>len</code> is negative, or <code>len</code> is greater than
* <code>b.length - off</code>
* @exception ZipException if a ZIP format error has occurred
* @exception IOException if an I/O error has occurred
* @throws ZipException if a ZIP format error has occurred
* @throws IOException if an I/O error has occurred
*/
public int read(byte[] b, int off, int len) throws IOException {
ensureOpen();
@ -173,7 +173,7 @@ class InflaterInputStream extends FilterInputStream {
* of bytes that could be read without blocking.
*
* @return 1 before EOF and 0 after EOF.
* @exception IOException if an I/O error occurs.
* @throws IOException if an I/O error occurs.
*
*/
public int available() throws IOException {
@ -195,8 +195,8 @@ class InflaterInputStream extends FilterInputStream {
* Skips specified number of bytes of uncompressed data.
* @param n the number of bytes to skip
* @return the actual number of bytes skipped.
* @exception IOException if an I/O error has occurred
* @exception IllegalArgumentException if {@code n < 0}
* @throws IOException if an I/O error has occurred
* @throws IllegalArgumentException if {@code n < 0}
*/
public long skip(long n) throws IOException {
if (n < 0) {
@ -223,7 +223,7 @@ class InflaterInputStream extends FilterInputStream {
/**
* Closes this input stream and releases any system resources associated
* with the stream.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void close() throws IOException {
if (!closed) {
@ -236,7 +236,7 @@ class InflaterInputStream extends FilterInputStream {
/**
* Fills input buffer with more data to decompress.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
protected void fill() throws IOException {
ensureOpen();
@ -283,7 +283,7 @@ class InflaterInputStream extends FilterInputStream {
* <code>InflaterInputStream</code> does nothing except throw an
* <code>IOException</code>.
*
* @exception IOException if this method is invoked.
* @throws IOException if this method is invoked.
* @see java.io.InputStream#mark(int)
* @see java.io.IOException
*/

View file

@ -110,8 +110,8 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
* Reads the next ZIP file entry and positions the stream at the
* beginning of the entry data.
* @return the next ZIP file entry, or null if there are no more entries
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O error has occurred
* @throws ZipException if a ZIP file error has occurred
* @throws IOException if an I/O error has occurred
*/
public ZipEntry getNextEntry() throws IOException {
ensureOpen();
@ -133,8 +133,8 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
/**
* Closes the current ZIP entry and positions the stream for reading the
* next entry.
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O error has occurred
* @throws ZipException if a ZIP file error has occurred
* @throws IOException if an I/O error has occurred
*/
public void closeEntry() throws IOException {
ensureOpen();
@ -150,7 +150,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
* of bytes that could be read without blocking.
*
* @return 1 before EOF and 0 after EOF has reached for current entry.
* @exception IOException if an I/O error occurs.
* @throws IOException if an I/O error occurs.
*
*/
public int available() throws IOException {
@ -172,12 +172,12 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
* @param len the maximum number of bytes read
* @return the actual number of bytes read, or -1 if the end of the
* entry is reached
* @exception NullPointerException if <code>b</code> is <code>null</code>.
* @exception IndexOutOfBoundsException if <code>off</code> is negative,
* @throws NullPointerException if <code>b</code> is <code>null</code>.
* @throws IndexOutOfBoundsException if <code>off</code> is negative,
* <code>len</code> is negative, or <code>len</code> is greater than
* <code>b.length - off</code>
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O error has occurred
* @throws ZipException if a ZIP file error has occurred
* @throws IOException if an I/O error has occurred
*/
public int read(byte[] b, int off, int len) throws IOException {
ensureOpen();
@ -231,9 +231,9 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
* Skips specified number of bytes in the current ZIP entry.
* @param n the number of bytes to skip
* @return the actual number of bytes skipped
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O error has occurred
* @exception IllegalArgumentException if {@code n < 0}
* @throws ZipException if a ZIP file error has occurred
* @throws IOException if an I/O error has occurred
* @throws IllegalArgumentException if {@code n < 0}
*/
public long skip(long n) throws IOException {
if (n < 0) {
@ -260,7 +260,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
/**
* Closes this input stream and releases any system resources associated
* with the stream.
* @exception IOException if an I/O error has occurred
* @throws IOException if an I/O error has occurred
*/
public void close() throws IOException {
if (!closed) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -140,8 +140,8 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
/**
* Sets the ZIP file comment.
* @param comment the comment string
* @exception IllegalArgumentException if the length of the specified
* @param comment the comment string
* @throws IllegalArgumentException if the length of the specified
* ZIP file comment is greater than 0xFFFF bytes
*/
public void setComment(String comment) {
@ -156,8 +156,8 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
* Sets the default compression method for subsequent entries. This
* default will be used whenever the compression method is not specified
* for an individual ZIP file entry, and is initially set to DEFLATED.
* @param method the default compression method
* @exception IllegalArgumentException if the specified compression method
* @param method the default compression method
* @throws IllegalArgumentException if the specified compression method
* is invalid
*/
public void setMethod(int method) {
@ -170,8 +170,8 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
/**
* Sets the compression level for subsequent entries which are DEFLATED.
* The default setting is DEFAULT_COMPRESSION.
* @param level the compression level (0-9)
* @exception IllegalArgumentException if the compression level is invalid
* @param level the compression level (0-9)
* @throws IllegalArgumentException if the compression level is invalid
*/
public void setLevel(int level) {
def.setLevel(level);
@ -183,9 +183,9 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
* The default compression method will be used if no compression method
* was specified for the entry, and the current time will be used if
* the entry has no set modification time.
* @param e the ZIP entry to be written
* @exception ZipException if a ZIP format error has occurred
* @exception IOException if an I/O error has occurred
* @param e the ZIP entry to be written
* @throws ZipException if a ZIP format error has occurred
* @throws IOException if an I/O error has occurred
*/
public void putNextEntry(ZipEntry e) throws IOException {
ensureOpen();
@ -242,8 +242,8 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
/**
* Closes the current ZIP entry and positions the stream for writing
* the next entry.
* @exception ZipException if a ZIP format error has occurred
* @exception IOException if an I/O error has occurred
* @throws ZipException if a ZIP format error has occurred
* @throws IOException if an I/O error has occurred
*/
public void closeEntry() throws IOException {
ensureOpen();
@ -307,11 +307,11 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
/**
* Writes an array of bytes to the current ZIP entry data. This method
* will block until all the bytes are written.
* @param b the data to be written
* @param off the start offset in the data
* @param len the number of bytes that are written
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O error has occurred
* @param b the data to be written
* @param off the start offset in the data
* @param len the number of bytes that are written
* @throws ZipException if a ZIP file error has occurred
* @throws IOException if an I/O error has occurred
*/
public synchronized void write(byte[] b, int off, int len)
throws IOException
@ -349,8 +349,8 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
* Finishes writing the contents of the ZIP output stream without closing
* the underlying stream. Use this method when applying multiple filters
* in succession to the same output stream.
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O exception has occurred
* @throws ZipException if a ZIP file error has occurred
* @throws IOException if an I/O exception has occurred
*/
public void finish() throws IOException {
ensureOpen();
@ -370,8 +370,8 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
/**
* Closes the ZIP output stream as well as the stream being filtered.
* @exception ZipException if a ZIP file error has occurred
* @exception IOException if an I/O error has occurred
* @throws ZipException if a ZIP file error has occurred
* @throws IOException if an I/O error has occurred
*/
public void close() throws IOException {
if (!closed) {