Javadoc of 'java.text.DateFormatSymbols#getInstanceRef' states that this method is supposed to return cached instance. Not clone, like its brother-method 'java.text.DateFormatSymbols#getInstance(java.util.Locale)'.
But it's the case anymore (after changes from JEP 127). Actual implementation of both methods is the same:
public static final DateFormatSymbols getInstance(Locale locale) {
DateFormatSymbols dfs = getProviderInstance(locale);
if (dfs != null) {
return dfs;
}
throw new RuntimeException("DateFormatSymbols instance creation failed.");
}
We should either remove redundant 'getInstanceRef' method and use 'getInstance' directly. Or fix implementation to return not-cloned instance.