Thursday, May 14, 2020

Re: [ANN] JRS gwt-time 1.4.8 release

On Thursday, May 14, 2020 at 7:30:11 AM UTC+2, foal wrote:

Yes, I have and not happy with it. Can I ask how to emulate some Java methods that required Locale as a parameter? The GWT version is not enough. My version can cause problems. At least I need to describe it correctly on the project page.

I don't mean introducing a new kind of Locale.
For example, you've added toLanguageTag as an instance method, and getAvailableLocales as a static method.
Then do:
public class LocaleExt {
public static String toLanguageTag(Locale locale) { }
public static Locale[] getAvailableLocales() { }

(and for performance, maybe cache the computed language tag in a java.util.Map or a JS WeakMap)
and everywhere in your code where you used to call locale.toLanguageTag() or Locale.getAvailableLocales() then replace them with LocaleExt.toLanguageTag(locale) or LocaleExt.getAvailableLocales() respectively.

Then the SimpleDateTimeFormatStyleProvider#getFormatter(FormatStyle,FormatStyle,Chronology,Locale) emulation can keep the exact same signature.

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

No comments:

Post a Comment