jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francesco Mari (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-7942) Fix covariant return type changes in ByteBuffer
Date Wed, 05 Dec 2018 16:23:00 GMT

    [ https://issues.apache.org/jira/browse/OAK-7942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16710285#comment-16710285

Francesco Mari commented on OAK-7942:

[~mduerig], thanks for reviewing. I will make {{Buffer}} final and add comments about its
usage and its reason to exist. Your IDE is way too smart!

Regarding regressions, I can't prevent future code from using {{ByteBuffer}} or from using
it in an incompatible way. On the other hand, since {{Buffer}} is used consistently across
the codebase, and since there is no way to convert directly a {{Buffer}} into a {{ByteBuffer}}
and the other way around, I expected new code to just follow along and use {{Buffer}}.

Regarding backport, there is really nothing I can do. I tried to keep the amount of changes
to a minimum. The method names and the usage patterns of {{Buffer}} are the same as the ones
of {{ByteBuffer}}. The only changes that will make backporting more annoying in the future
is change in method signatures and return values, but they are quite trivial to figure out
and solve.

> Fix covariant return type changes in ByteBuffer
> -----------------------------------------------
>                 Key: OAK-7942
>                 URL: https://issues.apache.org/jira/browse/OAK-7942
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: segment-tar
>            Reporter: Francesco Mari
>            Assignee: Francesco Mari
>            Priority: Major
>             Fix For: 1.10
>         Attachments: OAK-7942-01.patch
> Many methods in {{ByteBuffer}} now return an instance of {{ByteBuffer}} instead of {{Buffer}}.
This results in {{NoSuchMethodError}} when code compiled in Java 9 is executed in an older
JVM. See [this|https://jira.mongodb.org/browse/JAVA-2559] and [this|https://github.com/plasma-umass/doppio/issues/497#issuecomment-334740243]
for reference and proposed fixes.

This message was sent by Atlassian JIRA

View raw message