ReloadableResourceBundleMessageSource prevents accidental exposure of incomplete holder

Issue: SPR-12177
master
Juergen Hoeller 10 years ago
parent 0cf472b111
commit 40cd277b7e
  1. 4
      spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java

@ -451,11 +451,11 @@ public class ReloadableResourceBundleMessageSource extends AbstractMessageSource
*/
protected PropertiesHolder getProperties(String filename) {
PropertiesHolder propHolder = this.cachedProperties.get(filename);
long originalTimestamp = -1;
long originalTimestamp = -2;
if (propHolder != null) {
originalTimestamp = propHolder.getRefreshTimestamp();
if (originalTimestamp < 0 || originalTimestamp > System.currentTimeMillis() - this.cacheMillis) {
if (originalTimestamp == -1 || originalTimestamp > System.currentTimeMillis() - this.cacheMillis) {
// Up to date
return propHolder;
}

Loading…
Cancel
Save