AbstractMessageSource properly interacts with non-AbstractMessageSource parent

Issue: SPR-16047
This commit is contained in:
Juergen Hoeller
2017-10-18 20:21:12 +02:00
parent 950edf888a
commit c3378fda33
2 changed files with 37 additions and 2 deletions

View File

@@ -263,7 +263,9 @@ public abstract class AbstractMessageSource extends MessageSourceSupport impleme
}
else {
// Check parent MessageSource, returning null if not found there.
return parent.getMessage(code, args, null, locale);
// Covers custom MessageSource impls and DelegatingMessageSource.
String msg = parent.getMessage(code, args, null, locale);
return ("".equals(msg) ? null : msg);
}
}
// Not found in parent either.