On Mon, 24 Apr 2023 19:55:34 GMT, Weijun Wang <wei...@openjdk.org> wrote:

>> src/java.base/share/classes/com/sun/crypto/provider/DHKEM.java line 366:
>> 
>>> 364:     private static byte[] concat(byte[]... inputs) {
>>> 365:         ByteArrayOutputStream o = new ByteArrayOutputStream();
>>> 366:         Arrays.stream(inputs).forEach(o::writeBytes);
>> 
>> Unless I'm missing something there is no `stream(byte[])` support, so I'm 
>> not sure how this is compiling.  I didn't think  the generics would work 
>> with this.
>> More importantly, `forEach()` the API states that stream is in a 
>> non-deterministic order.  I think you want `forEachOrdered()`
>
> `inputs` is `byte[][]` and there is a `Arrays.stream(T[])`.
> 
> The above method says a `sequential Stream` is returned. Does that mean 
> calling `forEach` is safe?

Ok, this is fine, I didn't realize sequential streams were default

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13256#discussion_r1179500876

Reply via email to