From 4df2a14b13ac41d71f8034fa68e1b7e54e3f7a48 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Mon, 20 Feb 2012 14:21:51 +0100 Subject: [PATCH] Fix regression in @PropertySource placeholder resolution Changes in commit 41ade68b50b39485b3cf02b9c6fb8eb74962146b introduced a regression causing all but the first location in the @PropertySource#value array to be ignored during ${...} placeholder resolution. This change ensures that all locations are processed and replaced as expected. Issue: SPR-9133, SPR-9127 --- .../context/annotation/ConfigurationClassParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java index 223fdb65c83..0028ea71de3 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java @@ -185,7 +185,7 @@ class ConfigurationClassParser { throw new IllegalArgumentException("At least one @PropertySource(value) location is required"); } for (int i = 0; i < nLocations; i++) { - locations[0] = this.environment.resolveRequiredPlaceholders(locations[0]); + locations[i] = this.environment.resolveRequiredPlaceholders(locations[i]); } ClassLoader classLoader = this.resourceLoader.getClassLoader(); if (!StringUtils.hasText(name)) {