zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] vivekpatani opened a new pull request #760: ZOOKEEPER-3215: Handle Java 9/11 additions of covariant return types …
Date Tue, 08 Jan 2019 20:11:02 GMT
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 <brandon_miles@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 <softwareengg@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

Mime
View raw message