[
https://issues.apache.org/jira/browse/LANG-1710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory updated LANG-1710:
----------------------------------
External issue URL: https://github.com/apache/commons-lang/pull/1086
> ReflectionToStringBuilder changes in version 3.13.0 has broken the logic for
> overriding classes
> -----------------------------------------------------------------------------------------------
>
> Key: LANG-1710
> URL: https://issues.apache.org/jira/browse/LANG-1710
> Project: Commons Lang
> Issue Type: Bug
> Reporter: Oksana
> Priority: Major
>
> It is said that overriding classes should overload to methods
> #getValue(java.lang.reflect.Field)} and #accept(java.lang.reflect.Field)}.
> But since 3.13.0 getValue(java.lang.reflect.Field)} no longer called in
> appendFieldsIn.
> * System.out.println("An object: " +
> ReflectionToStringBuilder.toString(anObject));
> * </pre>
> * <p>
> * A subclass can control field output by overriding the methods:
> * </p>
> * <ul>
> * <li>\{@link #accept(java.lang.reflect.Field)}</li>
> * <li>\{@link #getValue(java.lang.reflect.Field)}</li>
> Also consider to use trySetAccessible instead of
> AccessibleObject.setAccessible(fields, true); and skip not accessible fields.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)