Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-28 Thread Alan Bateman
On Sun, 27 Nov 2022 17:49:25 GMT, Markus KARG wrote: >>> I think the public visibility of my Twitter account is not wide enough to >>> get really robust answers, unfortunately. >> >> One alternative is to search GitHub. It's amazing how fast they can search >> such a huge code corpus. >> >> E

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-27 Thread Markus KARG
On Mon, 21 Nov 2022 18:22:26 GMT, Jens Lidestrom wrote: >> I think the public visibility of my Twitter account is not wide enough to >> get *really robust* answers, unfortunately. So far, 92% answered that they >> not even used SIS in their whole life. So the users of two-args constructor >> m

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-21 Thread Jens Lidestrom
On Mon, 21 Nov 2022 17:43:58 GMT, Markus KARG wrote: > I think the public visibility of my Twitter account is not wide enough to get > really robust answers, unfortunately. One alternative is to search GitHub. It's amazing how fast they can search such a huge code corpus. Example: https://gi

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-21 Thread Markus KARG
On Mon, 21 Nov 2022 07:42:35 GMT, Alan Bateman wrote: >> N.B.: Regarding usage numbers, I will do a quick poll on Twitter. > >> Indeed my intention solely is to get rid of `Vector`, so I am fine with >> keeping a low profile and being full backwards compatible. I assume SIS is >> seldomly used,

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Alan Bateman
On Sun, 20 Nov 2022 16:58:56 GMT, Markus KARG wrote: >> Indeed my intention solely is to get rid of `Vector`, so I am fine with >> keeping a low profile and being full backwards compatible. I assume SIS is >> seldomly used, so opening a can of warms is not worth it (I think). I am >> perfectly

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Markus KARG
On Sun, 20 Nov 2022 16:49:16 GMT, Markus KARG wrote: >>> @AlanBateman WDYT? >> >> The long standing and undocumented behavior is unfortunate. I don't think >> the 1-arg constructor is fixable while still allowing for lazy behavior. So >> I think the only thing we can do is document the existin

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Markus KARG
On Sun, 20 Nov 2022 15:21:31 GMT, Alan Bateman wrote: >> @AlanBateman WDYT? > >> @AlanBateman WDYT? > > The long standing and undocumented behavior is unfortunate. I don't think the > 1-arg constructor is fixable while still allowing for lazy behavior. So I > think the only thing we can do is

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Alan Bateman
On Sun, 20 Nov 2022 13:06:40 GMT, Markus KARG wrote: > @AlanBateman WDYT? The long standing and undocumented behavior is unfortunate. I don't think the 1-arg constructor is fixable while still allowing for lazy behavior. So I think the only thing we can do is document the existing behavior tha

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Markus KARG
On Sun, 20 Nov 2022 12:06:55 GMT, Markus KARG wrote: >> The updated code now changes the behaviour in the other direction: >> >> In the original code, if `s2` was null a NPE was thrown in `peekNextStream` >> when `s1` was exhausted. >> >> In the current code, `s2` is silently ignored if it is

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Markus KARG
On Sun, 20 Nov 2022 09:47:35 GMT, Jens Lidestrom wrote: >> src/java.base/share/classes/java/io/SequenceInputStream.java line 82: >> >>> 80: * @param s2 the second input stream to read. >>> 81: */ >>> 82: public SequenceInputStream(InputStream s1, InputStream s2) { >> >> BTW, w

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Jens Lidestrom
On Sun, 20 Nov 2022 09:14:32 GMT, Markus KARG wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> allowing s2 to be null > > src/java.base/share/classes/java/io/SequenceInputStream.java line 82: > >> 80: * @param

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Markus KARG
On Sun, 20 Nov 2022 09:07:21 GMT, Markus KARG wrote: >> There is no need to use a temporary Vector within the constructor of >> SynchronizedInputStream, as more efficient (non-synchronized) alternative >> code (like List.of) will do the same in possibly less time. While the >> optimization is

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Markus KARG
On Sun, 20 Nov 2022 02:16:02 GMT, Jaikiran Pai wrote: >> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> allowing s2 to be null > > src/java.base/share/classes/java/io/SequenceInputStream.java line 83: > >> 81: */ >> 82

Re: RFR: JDK-8297299 SequenceInputStream should not use Vector [v2]

2022-11-20 Thread Markus KARG
> There is no need to use a temporary Vector within the constructor of > SynchronizedInputStream, as more efficient (non-synchronized) alternative > code (like List.of) will do the same in possibly less time. While the > optimization is not dramatic, it still makes sense to replace Vector unless