[ 
https://issues.apache.org/jira/browse/LANG-1667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17398005#comment-17398005
 ] 

Gary D. Gregory commented on LANG-1667:
---------------------------------------

The POM needs to enable access to reflection on Java 16 and above. Feel free to 
provide a PR.

> Cannot Use ReflectionToStringBuilder for ArrayList on Java 16 Due to Module 
> Access
> ----------------------------------------------------------------------------------
>
>                 Key: LANG-1667
>                 URL: https://issues.apache.org/jira/browse/LANG-1667
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.builder.*
>    Affects Versions: 3.12.0
>         Environment: JDK 16
>            Reporter: Andrew Thomas
>            Priority: Major
>
> In Java 16, many classes in java.base module are not able to be made 
> accessible due to access restrictions on the module. An example is ArrayList.
>  
> In ToStringBuilderTest.testReflectionHierarchyArrayList(), the test fails 
> with the following error:
> {code:java}
> java.lang.reflect.InaccessibleObjectException: Unable to make field private 
> static final java.lang.Object[] 
> java.util.ArrayList.DEFAULTCAPACITY_EMPTY_ELEMENTDATA accessible: module 
> java.base does not "opens java.util" to unnamed module @3339ad8e{code}
>  
> This is causing build failures for all open PRs.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to