You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/01/08 20:11:02 UTC

[GitHub] vivekpatani opened a new pull request #760: ZOOKEEPER-3215: Handle Java 9/11 additions of covariant return types …

vivekpatani opened a new pull request #760: ZOOKEEPER-3215: Handle Java 9/11 additions of covariant return types …
URL: https://github.com/apache/zookeeper/pull/760
 
 
   …to java.nio.ByteBuffer methods
   
   Co-authored-by: Brandon Miles <br...@apple.com>
   
   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.
   
   To fix this, we must cast the ByteBuffer instances to Buffer before we call the method. The methods that need this are:
   
   - position(int newPosition)
   - limit(int newLimit)
   - flip()
   - clear()
   - mark()
   - reset()
   - rewind()
   
   Signed-off-by: Vivek Patani <so...@pm.me>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services