Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-9469

CopyHelper.copy will fail on java 16 and later when copying instances of Clonable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core

    Description

      CopyHelper.copy is an API that allows geode users to make copies of objects. It is also used internally by a number of geode features. The copy-on-read region attribute is one example. If the object being copied is an instance of Cloneable then on java 16, copy will throw a RuntimeException which is an instance of java.lang.reflect.InaccessibleObjectException.

      The copy code tries to catch exceptions during the clone and instead use serialization to make a copy but it does not catch RuntimeException which is what java 16 throws from setAccessible. It would be pretty easy to fix this exception handling.

      The only work arounds are to not implement Cloneable or to start the jvm with the command line option: --illegal-access=permit.

       See: https://softwaregarden.dev/en/posts/new-java/illegal-access-in-java-16

       

      Attachments

        Activity

          People

            echobravo Ernest Burghardt
            dschneider Darrel Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: