You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Ernest Burghardt (Jira)" <ji...@apache.org> on 2022/05/09 16:39:00 UTC

[jira] [Assigned] (GEODE-9469) CopyHelper.copy will fail on java 16 and later when copying instances of Clonable

     [ https://issues.apache.org/jira/browse/GEODE-9469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ernest Burghardt reassigned GEODE-9469:
---------------------------------------

    Assignee: Ernest Burghardt

> CopyHelper.copy will fail on java 16 and later when copying instances of Clonable
> ---------------------------------------------------------------------------------
>
>                 Key: GEODE-9469
>                 URL: https://issues.apache.org/jira/browse/GEODE-9469
>             Project: Geode
>          Issue Type: Bug
>          Components: core
>            Reporter: Darrel Schneider
>            Assignee: Ernest Burghardt
>            Priority: Major
>              Labels: Java16, Java17
>
> 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|https://softwaregarden.dev/en/posts/new-java/illegal-access-in-java-16/]
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)