[
https://issues.apache.org/jira/browse/LANG-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18079907#comment-18079907
]
Gary D. Gregory edited comment on LANG-1711 at 5/10/26 10:19 PM:
-----------------------------------------------------------------
[~oksiblack]
Please see {{AbstractReflection.AbstractBuilder.setForceAccessible(boolean)}}
from PR [#1558|https://github.com/apache/commons-lang/pull/1558].
was (Author: garydgregory):
[~oksiblack]
Please see Make object accessibility optional with
{{AbstractReflection.AbstractBuilder.setForceAccessible(boolean)}} from PR
[#1558|https://github.com/apache/commons-lang/pull/1558].
> Modify ReflectionToStringBuilder to use trySetAccessible and not throw
> exceptions
> ---------------------------------------------------------------------------------
>
> Key: LANG-1711
> URL: https://issues.apache.org/jira/browse/LANG-1711
> Project: Commons Lang
> Issue Type: Improvement
> Reporter: Oksana
> Priority: Major
>
> org.apache.commons.lang3.builder.ReflectionToStringBuilder#appendFieldsIn
> uses following method
> _AccessibleObject.setAccessible(fields, true);_
> It will throw exception when it is not possible to perform action. I think,
> better approach - just to skip not accessible fields and report only
> accessible once. Since Java 9 there is a method trySetAccessible for that.
> [https://github.com/apache/commons-lang/pull/1102]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)