diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java index 2faa3e5680..8ccb23bda9 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java @@ -37,6 +37,9 @@ import org.springframework.core.ResolvableType; */ class MapBinder extends AggregateBinder> { + private static final Bindable> STRING_STRING_MAP = Bindable + .mapOf(String.class, String.class); + MapBinder(BindContext context) { super(context); } @@ -58,7 +61,7 @@ class MapBinder extends AggregateBinder> { private Bindable resolveTarget(Bindable target) { Class type = target.getType().resolve(); if (Properties.class.isAssignableFrom(type)) { - return Bindable.mapOf(String.class, String.class); + return STRING_STRING_MAP; } return target; }