Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: more porting issues to Java 11 Date: Wed, 10 Apr 2019 18:08:19 -0000 (UTC) Organization: A noiseless patient Spider Lines: 54 Message-ID: References: Reply-To: avl@logic.at Injection-Date: Wed, 10 Apr 2019 18:08:19 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="998162ad1f6365efd88c3e7ee70290e1"; logging-data="15507"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19vDQUL9aPZSgX5+iyfyUqw" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:xt1VIZGaGYm4d/+1gl5nI+kcadY= Xref: csiph.com comp.lang.java.programmer:38896 Next update: (tl;dr? SimpleDateFormat also changed behaviour) Synchronous with my own sorry attempts, there was also some action on glassfish side. Some user posted a PR that made the glassfish ORB compileable with maven and jdk 11. (It's not yet merged, and it depends on some other package that isn't yet released to maven repo, thus needs some extra hoop-diving to let "mvn" find it, but there is some progress). For now I only succeeded in getting un-encrypted Corba working - to use encryption I would now need a client-side keystore (didn't need that back with an older version of JacORB). Not ok for production, of course, but enough to allow me to check other corners of the application: Next obstacle was SimpleDateFormat: jdk-8 had no problem at all with parsing a (German style) "10.04.2019 19:44:45" string with a DateFormat defined like this: (SSCCE and results further down) final int dfMed = DateFormat.MEDIUM; final Locale l_de=new Locale("de","DE"); DateFormat df = DateFormat.getDateTimeInstance(dfMed,dfMed,l_de); For jdk11, the string would now need a comma "," between date and time parts. the blank isn't acceptable any more. --- snip SSCCE: Foo.java --- import java.text.DateFormat; import java.util.Date; import java.text.ParseException; import java.util.Locale; class Foo { public static void main(String... args) { final int dfMed = DateFormat.MEDIUM; final Locale l_de=new Locale("de","DE"); DateFormat dfM = DateFormat.getDateTimeInstance(dfMed,dfMed,l_de); dfM.setLenient(true); String text = "10.04.2019 19:44:45"; try { Date result = dfM.parse(text); System.out.println( result ); } catch (ParseException dfe) { System.out.println( dfe ); } } } --- end snip --- jdk-8: Wed Apr 10 19:44:45 CEST 2019 jdk-11: java.text.ParseException: Unparseable date: "10.04.2019 19:12:04" (That it expected a comma, I learned from a debugging session)