diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java index c33b2ae92e..57e6234ee7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,8 +64,7 @@ class MapBinder extends AggregateBinder> { getContext().setConfigurationProperty(property); Object result = property.getValue(); result = getContext().getPlaceholdersResolver().resolvePlaceholders(result); - result = getContext().getConverter().convert(result, target); - return result; + return getContext().getConverter().convert(result, target); } source = source.filter(name::isAncestorOf); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java index 1bbcebf94e..1a4306298f 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -615,7 +615,8 @@ class MapBinderTests { DefaultConversionService conversionService = new DefaultConversionService(); conversionService.addConverter(new MapConverter()); StandardEnvironment environment = new StandardEnvironment(); - Binder binder = new Binder(this.sources, new PropertySourcesPlaceholdersResolver(environment), conversionService, null, null); + Binder binder = new Binder(this.sources, new PropertySourcesPlaceholdersResolver(environment), + conversionService, null, null); TestPropertySourceUtils.addInlinedPropertiesToEnvironment(environment, "bar=bc"); this.sources.add(new MockConfigurationPropertySource("foo", "a${bar},${bar}d")); Map map = binder.bind("foo", STRING_STRING_MAP).get();