RFR: 8299513: Cleanup java.io [v2]

Per Minborg pminborg at openjdk.org
Thu Jan 5 12:34:12 UTC 2023


On Thu, 5 Jan 2023 01:42:15 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> I assume this is done so that "lock" is only set once during construction (StringWriter is a bit unusual in that it uses the SB as the lock object). A downside of the change is that it introduces casts. Another is that the expression to super is a bit complicated and forces the reader to locate checkSize at the end of the file to find the check/exception specified by the constructor. So two minds on this part, maybe it should be left unchanged.
>
> I think the casts are worth it to set `lock` only once during construction, but would be inclined to leave out the addition of `checkSize`.

I have added a new proposal in the hope that the `requireNonNegative` method name and parameters should be trivial enough for users to directly understand without scrolling down. Let me know your thought on this.

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

PR: https://git.openjdk.org/jdk/pull/11848


More information about the core-libs-dev mailing list