This change allows subclasses to call getMergedProperties(locale) when cacheSeconds > 0 and get refreshed contents. Useful for SPA webapps to deliver all translations to the browser.

Since all individual files can be refreshed concurrently, the thread that refreshes mergedHolder can get stale data for any file being refreshed so simply comparing maximal fileTimestamp is not enough to detect change - used hashCode for this purpose.

Comment From: pivotal-cla

@vershnik Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-cla

@vershnik Thank you for signing the Contributor License Agreement!

Comment From: snicoll

@vershnik this PR has a a commit from @andreibastun. The author should be the one submitting the PR as they're the one signing the CLA.

Comment From: andreibastun

@snicoll Sorry, I didn't notice that my second account was singed in the git when commiting. Now I accepthed CLA from both accounts.

Comment From: snicoll

Thanks for the PR but we're not keen to make ReloadableResourceBundleMessageSource more involved than it already is. We suggest that you implement the refresh in a custom sub-class of yours and if that turns out to be too convoluted, we can discuss how to add a hookpoint to make it easier.

Comment From: andreibastun

@snicoll Ok, that makes sense, thanks. I have created another PR 32118 that does not add functionality, but just extracs some methods from getMergedProperties to be more easily reused in subclasses.