> -----Original Message----- > From: sebb [mailto:seb...@gmail.com] > Sent: Sunday, May 17, 2020 9:05 AM > To: CommonsDev <dev@commons.apache.org> > Subject: [VALIDATOR] Java 9 change to use CLDR formats cause API break - what > to do? > > Java 9 now uses Locale strings from the Unicode consortium by default. > > This has cause several of the Validator unit tests to fail. For example: > > validator.validate("31/Dez/05 21-05", "dd/MMM/yy HH-mm", Locale.GERMAN); > > no longer parses OK, because the short version of December is now > "Dez." (with trailing fullstop) > > I have temporarily suppressed the errors by defining the following for Java9+ > > java.locale.providers=COMPAT,CLDR > > However this is not ideal. > > Whilst the tests could be updated to use the new formats, e.g. by > generating the test data at run time, it is not clear that this is the > correct approach, as it would hide changes in behaviour.
No, the test should be duplicated and then modified. Legacy tests should have a conditional skip if Java >= 9 New tests should have a conditional skip, only if needed, if Java < 9 > > Ideally the code would continue to accept old style dates, but it's > not at all clear how to do this. This is what I mean by "only if needed". Clearly the "intention" of Java 9 is to change the defaults, but if a "legacy" configuration / compatibility mode is enabled then ... --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org