Clarify AbstractResourceBasedMessageSource.setCacheMillis vs java.util.ResourceBundle #24563
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: documentation
A documentation task
Milestone
Affects: 4.x, 5.x
In Javadoc of
org.springframework.context.support.AbstractResourceBasedMessageSource#setCacheMillis
it says:
However -1 in
java.util.ResourceBundle
isTTL_DONT_CACHE
and its effect is not cache forever.It should be
TTL_NO_EXPIRATION_CONTROL = -2
to have the cache forever effect.Hence I think implementation of
org.springframework.context.support.ResourceBundleMessageSource#getResourceBundle
is inconsistent withjava.util.ResourceBundle
.it caches forever for any value less than 0. In order to be consistent with
java.util.ResourceBundle
it should be as followsand call
doGetBundle
forTTL_DONT_CACHE = -1
as well.@jhoeller what do you think about it?
The text was updated successfully, but these errors were encountered: