Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with Locale provider changes in JRE9 #17

Closed
jsotuyod opened this issue Nov 7, 2016 · 1 comment
Closed

Deal with Locale provider changes in JRE9 #17

jsotuyod opened this issue Nov 7, 2016 · 1 comment
Labels

Comments

@jsotuyod
Copy link
Member

jsotuyod commented Nov 7, 2016

As stated on Java's issue database:

DK 8 has JRE as default locale provider, whereas in JDK 9 onwards CLDR is the default locale provider. (http://openjdk.java.net/jeps/252 )
To enable behavior compatible with JDK 8, set the system property java.locale.providers to a value with JRE ahead of CLDR.

In JDK 9 ,if we run the test case as " java -Djava.locale.providers=JRE,CLDR JI9032375" it is successful.
Closing as not an issue.

This change means date parsing is failing on the latest Java 9 early access since DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.ENGLISH) will require the format "M/d/yy, h:mm a", instead of the traditional "M/d/yy h:mm a" of JRE8 (notice there is a comma).

This break is evidenced by #16

SpotBugs should work as is, without extra JVM arguments, for all users on all environments. So we need to work around this. Possibly creating a SimpleDateFormat with an explicit pattern and Locale rather than using the default should work.

@jsotuyod jsotuyod added the Java-9 label Nov 7, 2016
@jsotuyod jsotuyod modified the milestone: SpotBugs 3.1.0 Nov 7, 2016
jsotuyod added a commit that referenced this issue Nov 7, 2016
 - Since we have a hardwired Locale, and are already assuming the format,
    just use that format directly. This avoids issues with the LocaleProvider
    changes in JRE9.
mebigfatguy pushed a commit that referenced this issue Nov 8, 2016
- Since we have a hardwired Locale, and are already assuming the format,
    just use that format directly. This avoids issues with the LocaleProvider
    changes in JRE9.
@jsotuyod
Copy link
Member Author

jsotuyod commented Nov 8, 2016

Closed by #18

@jsotuyod jsotuyod closed this as completed Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant