diff --git a/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java index 854ee437e6..b281902eb2 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java @@ -237,7 +237,7 @@ public class ReloadableResourceBundleMessageSource extends AbstractResourceBased return mergedHolder; } Properties mergedProps = newProperties(); - mergedHolder = new PropertiesHolder(mergedProps, -1); + long latestTimestamp = -1; String[] basenames = StringUtils.toStringArray(getBasenameSet()); for (int i = basenames.length - 1; i >= 0; i--) { List filenames = calculateAllFilenames(basenames[i], locale); @@ -246,9 +246,13 @@ public class ReloadableResourceBundleMessageSource extends AbstractResourceBased PropertiesHolder propHolder = getProperties(filename); if (propHolder.getProperties() != null) { mergedProps.putAll(propHolder.getProperties()); + if (propHolder.getFileTimestamp() > latestTimestamp) { + latestTimestamp = propHolder.getFileTimestamp(); + } } } } + mergedHolder = new PropertiesHolder(mergedProps, latestTimestamp); PropertiesHolder existing = this.cachedMergedProperties.putIfAbsent(locale, mergedHolder); if (existing != null) { mergedHolder = existing;