Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
It is said that overriding classes should overload two 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));
- A subclass can control field output by overriding the methods:
- <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.