On Thu, 14 Dec 2023 19:22:18 GMT, Brian Burkhalter <b...@openjdk.org> wrote:
>> src/java.base/share/classes/java/io/SequenceInputStream.java line 249: >> >>> 247: transferred = Math.addExact(transferred, >>> in.transferTo(out)); >>> 248: } catch (ArithmeticException ignore) { >>> 249: return Long.MAX_VALUE; >> >> @bplb , this looks like a bug to me: once `transferred` reaches >> `Long.MAX_VALUE` the transfer loop will terminate and the transfer will stop >> even in the case there are more streams available in the sequence. >> >> I think the proper code should be `transferred = Long.MAX_VALUE` instead of >> `return Long.MAX_VALUE` (and there should be no `if (transferred < >> Long.MAX_VALUE)` check) >> >> What do you think? > >> What do you think? > > I think that you are looking at an obsolete repository: > > https://github.com/openjdk/jdk/blob/c328f9589ddc3a981a2c63801bd991f8e593e69f/src/java.base/share/classes/java/io/InputStream.java#L802 I mean SequenceInputStream, not the base class: https://github.com/openjdk/jdk/blob/c328f9589ddc3a981a2c63801bd991f8e593e69f/src/java.base/share/classes/java/io/SequenceInputStream.java#L249 Could you please double-check? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/11403#discussion_r1427231492