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

Gary D. Gregory closed LANG-1746.
---------------------------------
    Resolution: Duplicate

> using ReflectionToStringBuilder.toString on the "Arraylist"
> -----------------------------------------------------------
>
>                 Key: LANG-1746
>                 URL: https://issues.apache.org/jira/browse/LANG-1746
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.builder.*
>    Affects Versions: 3.14.0
>         Environment: jdk18
>            Reporter: Wang Hailong
>            Priority: Major
>
> throw 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 @37f8bb67
> test code is :
> {color:#bbb529}@Test
> {color}{color:#cc7832}public void 
> {color}{color:#ffc66d}testReflectionArrayListWithFormat{color}() {
> ArrayList<String> list = {color:#cc7832}new 
> {color}ArrayList<>(){color:#cc7832};
> {color}{color:#cc7832} {color}String result = 
> ReflectionToStringBuilder.toString(list{color:#cc7832}, 
> null{color}){color:#cc7832};
> {color}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to