RFR: JDK-8262435: Clarify the behavior of a few inherited ZipInputStream methods [v2]
Lance Andersen
lancea at openjdk.org
Fri Nov 11 17:16:39 UTC 2022
On Fri, 11 Nov 2022 12:22:32 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Lance Andersen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Addressed latest set of input on the javadoc
>
> src/java.base/share/classes/java/util/zip/ZipInputStream.java line 222:
>
>> 220: * <p> The behavior for the case where the input stream is <i>asynchronously
>> 221: * closed</i>, or the thread interrupted during the read, is highly input
>> 222: * stream specific, and therefore not specified.
>
> I'm not 100% sure about copying this paragraph from InputStream.readAllBytes because ZipInputStream is a specific InputStream implementation. I would be tempted to just drop it.
Removed the paragraph
> src/java.base/share/classes/java/util/zip/ZipInputStream.java line 263:
>
>> 261: * <p> The behavior for the case where the input stream is <i>asynchronously
>> 262: * closed</i>, or the thread interrupted during the read, is highly input
>> 263: * stream specific, and therefore not specified.
>
> This is another case where we might drop a paragraph because it's there to allow for a wide range of input stream implementations.
Removed the paragraph
> src/java.base/share/classes/java/util/zip/ZipInputStream.java line 355:
>
>> 353: * invoked to read a single byte, and if it returns {@code -1}, then an
>> 354: * {@code EOFException} is thrown. Any exception thrown by {@code skip()}
>> 355: * or {@code read()} will be propagated.
>
> implSpec is usually for methods with a default or overrideable implementation. Yes, it's possible to extend ZipInputStream and override the skipNBytes method but it feels a bit too deep in the hierarchy to have this in the javadoc.
Removed the implSpec
-------------
PR: https://git.openjdk.org/jdk/pull/10995
More information about the core-libs-dev
mailing list