On Sat, 17 Jan 2026 17:17:23 GMT, Daniel Gredler <[email protected]> wrote:
>> ByteArrayOutputStream.ensureCapacity(int) is currently private. It would be >> useful if it were protected, so that it can be more easily extended by >> subclasses. >> >> Mailing list discussion: >> https://mail.openjdk.org/pipermail/core-libs-dev/2026-January/156983.html > > Daniel Gredler has updated the pull request incrementally with one additional > commit since the last revision: > > Update per latest feedback Thanks for the feedback, I've pushed a revision which I think addresses most of it. The two existing write methods will now call subclass-provided `ensureCapacity` methods. The test verifies this behavior. I've added some subclassing advice to the class-level JavaDoc, let me know if it meets the needs. I've added a "since" tag to the JavaDoc for the existing (promoted) method, because this will be the first time that it is visible to users. The handling of non-positive input does not change, subclasses are trusted to validate input before calling `ensureCapacity` or face the consequences (possible OOME). ------------- PR Comment: https://git.openjdk.org/jdk/pull/29180#issuecomment-3764123759
