RFR: 4619075: (ch) newChannel() should return Gathering/ScatteringByteChannel [v2]
Brian Burkhalter
bpb at openjdk.java.net
Wed Oct 13 16:58:27 UTC 2021
On Wed, 13 Oct 2021 16:44:32 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> src/java.base/share/classes/java/nio/channels/Channels.java line 271:
>>
>>> 269: * @return A new readable byte channel
>>> 270: */
>>> 271: public static ScatteringByteChannel newChannel(InputStream in) {
>>
>> This looks like a binary incompatible change, are you sure that existing code won't fail at runtime with NoSuchMethodError?
>
> Right; covariant overrides are only compatible for instance methods, not static methods.
I added a number of non-static covariant overrides to `MappedByteBuffer` previously and so overlooked the static issue here.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5922
More information about the nio-dev
mailing list