You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReflectionTestUtils invokes toString() on target objects in order to create messages for exceptions and logging; however, as discussed in #14205, this practice can lead to problems if the invocation of toString() throws an exception.
The upgrade to Gradle 2.14 in #18934 made it apparent that ReflectionTestUtils.setField() in fact fails with an exception if the log level for ReflectionTestUtils is set to DEBUG. A quick inspection of the rest of the code in ReflectionTestUtils reveals that all other methods would fail in a similar fashion.
Deliverables
Ensure that all invocations of toString() on target objects within ReflectionTestUtils are performed defensively (i.e., by catching any exceptions).
Sam Brannen opened SPR-14363 and commented
Status Quo
ReflectionTestUtilsinvokestoString()on target objects in order to create messages for exceptions and logging; however, as discussed in #14205, this practice can lead to problems if the invocation oftoString()throws an exception.The upgrade to Gradle 2.14 in #18934 made it apparent that
ReflectionTestUtils.setField()in fact fails with an exception if the log level forReflectionTestUtilsis set toDEBUG. A quick inspection of the rest of the code inReflectionTestUtilsreveals that all other methods would fail in a similar fashion.Deliverables
toString()on target objects withinReflectionTestUtilsare performed defensively (i.e., by catching any exceptions).Affects: 3.2.17
Issue Links:
Referenced from: commits 045ee52