[
https://issues.apache.org/jira/browse/LANG-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18050866#comment-18050866
]
Gary D. Gregory commented on LANG-1711:
---------------------------------------
We need a comprehensive solution for the entire package, not a one-off solution
for this or that aspect of it.
Additionally, we need to consider compatibility and avoid surprising users with
an invisible and unexpected change.
I propose to make this an opt-in feature: Please see
[https://github.com/apache/commons-lang/pull/1557]
> 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)