RFR: 8343039: Remove jdk.internal.misc.InternalLock and usages from java.io
ExE Boss
duke at openjdk.org
Wed Nov 13 02:47:13 UTC 2024
On Tue, 12 Nov 2024 21:45:41 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> Uses of `InternalLock` are removed and `synchronized` is reinstated.
src/java.base/share/classes/java/io/BufferedInputStream.java line 241:
> 239: }
> 240: initialSize = size;
> 241: buf = new byte[size];
This should probably still retain the lazy buffer array creation:
Suggestion:
size;
if (getClass() == BufferedInputStream.class) {
// lazily create buffer when not subclassed
buf = EMPTY;
} else {
// eagerly create buffer when subclassed
buf = new byte[size];
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22048#discussion_r1839298849
More information about the core-libs-dev
mailing list