call Locale.getAvailableLocales() error
Issue #580
resolved
Version: jdk: oracle jdk1.8 okapi: 0.30 and 0.31
Exception in thread "main" java.lang.IllegalArgumentException: The locale identifier cannot be null or empty.
at net.sf.okapi.common.LocaleId.normalize(LocaleId.java:425)
at net.sf.okapi.common.LocaleId.<init>(LocaleId.java:327)
at net.sf.okapi.common.LocaleId.getAvailableLocales(LocaleId.java:746)
Comments (3)
-
-
Java 8 returns the "empty locale" as available locale. That is the
Locale.ROOT
Java 7 also "knows" about the
ROOT
locale [https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#ROOT]But it did not include it in the list of available locale.
This it not a problem anymore after the ICU refactoring.
Added a test unit, just in case (6e8c7f6)
-
- changed status to resolved
- Log in to comment
Maybe something specific to Java 8: A simple call to
LocaleId.getAvailableLocales()
seems to work on Java 7. @nmihai_2000 : maybe something related to the new normalization.