Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-7457

"Covariant return type change detected" warnings with java10

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.18.0
    • Component/s: documentmk, segment-tar
    • Labels:
      None

      Description

      We have quite a few warnings of type "Covariant return type change detected":

      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\broadcast\TCPBroadcaster.java:327: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.flip() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.flip()
      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\broadcast\UDPBroadcaster.java:135: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.limit(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.limit(int)
      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\broadcast\UDPBroadcaster.java:138: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\broadcast\TCPBroadcaster.java:226: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\broadcast\InMemoryBroadcaster.java:35: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\PersistentCache.java:519: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.limit(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.limit(int)
      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\PersistentCache.java:522: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-store-document\src\main\java\org\apache\jackrabbit\oak\plugins\document\persistentCache\PersistentCache.java:535: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\data\SegmentDataV12.java:196: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\data\SegmentDataV12.java:197: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.limit(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.limit(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\data\SegmentDataUtils.java:57: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\data\SegmentDataUtils.java:58: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.limit(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.limit(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexWriter.java:110: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV1.java:62: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.mark() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.mark()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV1.java:64: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.reset() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.reset()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV1.java:72: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.mark() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.mark()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV1.java:101: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.reset() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.reset()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV2.java:62: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.mark() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.mark()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV2.java:64: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.reset() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.reset()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV2.java:72: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.mark() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.mark()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\index\IndexLoaderV2.java:101: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.reset() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.reset()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoader.java:71: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoader.java:73: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.rewind() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.rewind()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV1.java:61: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.limit(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.limit(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV1.java:63: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV1.java:82: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.mark() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.mark()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV1.java:84: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.reset() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.reset()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV2.java:61: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.limit(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.limit(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV2.java:63: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV2.java:82: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.mark() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.mark()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\binaries\BinaryReferencesIndexLoaderV2.java:84: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.reset() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.reset()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\GraphLoader.java:78: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.mark() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.mark()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\GraphLoader.java:80: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.reset() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.reset()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\SegmentTarWriter.java:142: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.rewind() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.rewind()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\FileAccess.java:72: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\FileAccess.java:73: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.limit(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.limit(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\tar\SegmentTarManager.java:209: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\file\FileStore.java:489: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.rewind() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.rewind()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\memory\MemoryStore.java:118: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.rewind() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.rewind()
      [INFO] C:\projects\apache\oak\trunk\oak-segment-tar\src\main\java\org\apache\jackrabbit\oak\segment\SegmentStream.java:156: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.position(int) has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.position(int)
      [INFO] C:\projects\apache\oak\trunk\oak-segment-azure\src\main\java\org\apache\jackrabbit\oak\segment\azure\AzureUtilities.java:69: Covariant return type change detected: java.nio.Buffer java.nio.ByteBuffer.rewind() has been changed to java.nio.ByteBuffer java.nio.ByteBuffer.rewind()
      

      I believe these will cause problems if we compile with java 10 but run on an earlier VM.

      See also https://jira.mongodb.org/browse/JAVA-2559

        Attachments

        1. fix-covariant-return-type-changed-OAK-7457.patch
          4 kB
          José Andrés Cordero Benítez

          Issue Links

            Activity

              People

              • Assignee:
                mreutegg Marcel Reutegger
                Reporter:
                reschke Julian Reschke
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: