RFR: 8275163: Deflater::deflate methods omit javadoc for ReadOnlyBufferException

Lance Andersen lancea at openjdk.java.net
Wed Oct 13 18:28:56 UTC 2021


On Wed, 13 Oct 2021 18:20:03 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Hi all,
>> 
>> Please review the fix to  address a javadoc issue for the  Deflater::deflate methods that were added as part of JDK-6341887 that could throw a ReadOnlyBufferException. 
>> 
>> The` @throws ` clause for `ReadOnlyBufferException`  was inadvertently omitted from the javadoc for these new methods.
>> 
>> A CSR, JDK-8275164, has also been created for this issue.
>> 
>> Best
>> Lance
>
> src/java.base/share/classes/java/util/zip/Deflater.java line 498:
> 
>> 496:      * @return the actual number of bytes of compressed data written to the
>> 497:      *         output buffer
>> 498:      * @throws ReadOnlyBufferException if the given output buffer is read-only
> 
> It could equally well simply state
> 
> if the buffer is read-only
> 
> but this is fine.

I thought about that but  I decided to go with the wording used for the change to Inflater::inflate that was added as part of JDK-6341887.  If I were to change it, I would want to change Inflater::inflate as well.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5931


More information about the core-libs-dev mailing list