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

Michael Dürig commented on OAK-7942:
------------------------------------

What a mess, we should not need to have to put up with such things :(

The patch itself looks good to me apart from a few minor issues:
 * Consider making {{org.apache.jackrabbit.oak.segment.spi.persistence.Buffer}} 
final as potential subclasses have no way of correctly implementing {{equals}}.
 * Please add comments to 
{{org.apache.jackrabbit.oak.segment.spi.persistence.Buffer}} explaining why 
those casts to {{java.nio.Buffer}} are necessary. Since we need to stay 
compatible with Java 8 most people will use this in development. In my case my 
IDE tells me that this cast is redundant and I should remove it.

On a more general note:
 * How can we guard against regressions? It seems all to easy to introduce 
usages of {{ByteBuffer}} again further down the line.
 * The patch will cause further backporting nightmares as it touches so many 
files.

> 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)

Reply via email to