Invoke target.toString() safely in ReflectionTestUtils

ReflectionTestUtils invokes toString() on target objects in order to
build exception and logging messages, and prior to this commit problems
could occur if the invocation of toString() threw an exception.

This commit addresses this issue by ensuring that all invocations of
toString() on target objects within ReflectionTestUtils are performed
safely within try-catch blocks.

Issue: SPR-14363
This commit is contained in:
Sam Brannen
2016-06-14 20:08:26 +02:00
parent 2fd4462268
commit 045ee52232
5 changed files with 128 additions and 33 deletions

View File

@@ -25,6 +25,9 @@ log4j.logger.org.springframework.test.context.web=WARN
#log4j.logger.org.springframework.test.context.support.AbstractGenericContextLoader=INFO
#log4j.logger.org.springframework.test.context.support.AnnotationConfigContextLoader=INFO
# The following must be kept at DEBUG in order to test SPR-14363.
log4j.logger.org.springframework.test.util=DEBUG
log4j.logger.org.springframework.test.web.servlet.result=DEBUG
#log4j.logger.org.springframework.test=TRACE