Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3215

Handle Java 9/11 additions of covariant return types to java.nio.ByteBuffer methods

    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              andor Andor Molnar
              softwareengg V
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h