Java 19 changes date formatting defaults

So, Java 19 changes the default date formatters to use a narrow non breaking space before AM and PM, a unicode change

So much fun, makes sense, probably will break some date formatting / handling code like our tests

https://luceeserver.atlassian.net/browse/LDEV-4658

I’ve added a PR to make our some of tests to pass for now, LsParseDateTime() probably needs to support both formats

We already have a quite a few Java 17 issues to be addressed, help wanted!!!

https://luceeserver.atlassian.net/browse/LDEV-3807

https://github.com/lucee/Lucee/actions/runs/5764164140

2 Likes

I have finally started migrating from 5.4 to 6.2 and sure enough that Java change broke one of my Cypress tests. The Electron browser is used by default and turns out its JavaScript engine is strict about which characters are accepted when converting from string to Date type. My fix is to not use a mask when passing datetime values from Lucee to js. I’m a little disappointed I wasn’t the first to discover and report this breaking change. :smile: But mostly I’m stoked that my test suite caught it before any of my users did and that you were on the ball about this two years ago. Great job, @Zackster! :smiley: Also great job to everyone who’s worked on this because I can already see how the migration won’t be nearly as time-consuming as I feared!

2 Likes

There’s a lot of Unicode changes / updates since java 11, glad you had test coverage! tests rock

The WW and FF masks have also changed with 6

We have made it as compatible as possible, but people might find some code needs updating

Anyone updating from 5.4 should also do all the tests with Java 21, not 11

1 Like