On Tue, 1 Dec 2026 01:25:14 GMT, Jaikiran Pai <[email protected]> wrote:
>> src/java.base/share/classes/java/util/zip/ZipInputStream.java line 560:
>>
>>> 558: e.csize == ZIP64_MAGICVAL || e.size ==
>>> ZIP64_MAGICVAL, true);
>>> 559: } catch (IllegalArgumentException ex) {
>>> 560: throw (ZipException) new ZipException(
>>
>> This cast seems superfluous and can be removed?
>
> On first sight, yes :) I've been confused about similar casts in this code in
> the past. However, that cast isn't for the `new ZipException(...)` call,
> instead it's for the `initCause(...)` call which returns a `Throwable`.
Oh! Sorry, I overlooked this detail.
Sadly there is no `ZipException(String message, Throwable cause)` constructor
that would make this problem go away.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/34121#discussion_r4754225615