I get the following errors, running on a Linux machine running Debian, with openJDK and configured in French (i.e. the LANG environment variable is set to fr_FR.utf8):
[ERROR] Failures:
[ERROR] AbsoluteDateTest.testToString:1265->checkToString:1269
Expected: is "2009-01-01T00:00:�"
but: was "2009-01-01T00:00:NaN"
[ERROR] AbsoluteDateTest.testToStringRfc3339:1159->check:1163
Expected: is "2009-01-01T00:00:�Z"
but: was "2009-01-01T00:00:NaNZ"
Looking at lines 1263-1265 of AbsoluteDateTest.java, it seems the unicode replacement character is expected to be used instead of NaN. However in my environment, the proper NaN string is emitted, not the replacement character. I guess it has something to do with the LANG settings.
Some more investigation on this. It is not a LANG issue but a JDK version issue.
The error occurs when using openJDK 11 or openJDK 13, but not when running openJDK 8.
On my Debian Linux machine, I can check this using the following command line that overrides some environment variables just for one command:
I change the path to select one JDK over the other.
I think that the more recent JDK are correct (i.e. they display NaN as they should), and that some openJDK 8 implementations were wrong here, however, the test may have been set up using open JDK 8 as the reference.
Applying the attached patch solved the issue for me, for all three JDK version (8, 11 and 13). Could other developers check it? date-test.patch (2.3 KB)
The patch solved the problem for a
Java™ SE Runtime Environment (build 13.0.1+9)
And with an openJDK 8 (OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)), it still works fine