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

Mate Szalay-Beko commented on ZOOKEEPER-3215:
---------------------------------------------

[~busbey], Vivek Patani, thank you for raising this issues again! we had a 
discussion on the zookeeper dev mailing list and concluded on a fix proposed by 
[~ctubbsii] that introduces some maven magic: we are detecting now the Java 
compiler with maven and adding “--release 8” switch to all Java compilers with 
version 9+. It turned out that the master branch already contained the fix, now 
we are backporting it to the active 3.5 and 3.6 branches.

Just for the record, the verification steps we are using:
- build ZK from source with openjdk 13.0.2
- run server with JDK 8 (e.g. Oracle 1.8.0_201)
- connect zkcli with both java versions
- run some smoke tests
- make sure there is no exceptions like "NoSuchMethodError" in the logs

Once we tested the backports, I will resolve this ticket, marked as fixed in 
the next releases.

> Handle Java 9/11 additions of covariant return types to java.nio.ByteBuffer 
> methods
> -----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-3215
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3215
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.13
>            Reporter: V
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Java 9 introduces covariant return types which allows one to have different 
> return types if return type in the overridden method is a sub type. Since 
> Java 9, few functions return ByteBuffer, whereas the parent method return 
> Buffer, resulting in causing issues for Java 8 and below since for them the 
> method does not exist.
> Steps To Reproduce:
> 1. Setup ZooKeeper Server with JDK11.
> 2. Setup ZooKeeper Client with JDK8.
> 3. Try connecting the client and server.
> Results:
> Cast ByteBuffer instances to Buffer before calling the method.
>  
> Notes:
> There was a similar bug in the MongoDB community - 
> [https://jira.mongodb.org/browse/JAVA-2559]
>  
> This is not a contribution.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to