[
https://issues.apache.org/jira/browse/GEODE-9469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Darrel Schneider updated GEODE-9469:
------------------------------------
Labels: Java16 Java17 (was: Java16)
> 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
> 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)