Allow configprops endpoint stringify primitive wrappers

Update `ConfigurationPropertiesReportEndpoint` so that primitive
wrapper input values in the Environment are stringified for display.

Fixes gh-36076
This commit is contained in:
Phillip Webb
2023-07-02 13:55:30 +01:00
parent 4d1defdea4
commit 51ee702dac
2 changed files with 29 additions and 1 deletions

View File

@@ -394,7 +394,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
}
private Object stringifyIfNecessary(Object value) {
if (value == null || value.getClass().isPrimitive()) {
if (value == null || ClassUtils.isPrimitiveOrWrapper(value.getClass()) || value instanceof String) {
return value;
}
if (CharSequence.class.isAssignableFrom(value.getClass())) {