[
https://issues.apache.org/jira/browse/LANG-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oksana updated LANG-1711:
-------------------------
Description:
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]
was:
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 skip not accessible fields and report only accessible.
Since Java 9 there is a method trySetAccessible for that.
[https://github.com/apache/commons-lang/pull/1102]
> 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)