RFR: 8330748: ByteArrayOutputStream.writeTo(OutputStream) pins carrier [v2]

Alan Bateman alanb at openjdk.org
Wed Apr 24 07:10:27 UTC 2024


On Tue, 23 Apr 2024 18:08:34 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> I was thinking more of a subclass that counted invocations to public methods or metering which would cause subclass to double the counts when calling via virtual thread.
>
> So do we think it better not to invoke `toByteArray` here?

Using a subclass to count the number of invocations of toByteArray seems a bit strange but in general it is more robust to not rely on a method that may be overridden by a subclass. So I think the suggestion is good.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18901#discussion_r1577388594


More information about the core-libs-dev mailing list