[
https://issues.apache.org/jira/browse/OAK-7942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16710161#comment-16710161
]
Francesco Mari commented on OAK-7942:
-------------------------------------
The first version of the patch wraps every usage of {{ByteBuffer}} into a new
class {{Buffer}}. The API and the semantics of the new class are the same,
{{Buffer}} being just a wrapper around {{ByteBuffer}}. I had to put {{Buffer}}
into an exported package because of the Azure Segment Store, so I chose
{{org.apache.jackrabbit.oak.segment.spi.persistence}}. The only other usage of
{{ByteBuffer}} in oak-segment-tar is in {{CharsetEncodingUtils}}, but none of
the usages is affected by the covariant return type of {{ByteBuffer}}.
[~mduerig], [~dulceanu], can you have a look at the patch?
> 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
(v7.6.3#76005)