Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8264061

LocalDateTimeStringConverterTest fails in Canada

XMLWordPrintable

    • generic
    • generic

      The LocalDateTimeStringConverterTest fails on a system with a Canadian locale or any other locale that uses the suffix "p.m." to denote the 12 hours from noon until midnight.

      SYSTEM / OS / JAVA RUNTIME INFORMATION

      Ubuntu 20.04.2 LTS
        $ uname -srm
        Linux 5.4.0-67-generic x86_64

      macOS 11.2.3 (Big Sur)
        $ uname -srm
        Darwin 20.3.0 x86_64

      Microsoft Windows 10 Pro Version 10.0.19042
        $ uname -srm
        CYGWIN_NT-10.0 3.1.7(0.340/5/3) x86_64

      Oracle OpenJDK 15.0.2
        $ java --version
        openjdk 15.0.2 2021-01-19
        OpenJDK Runtime Environment (build 15.0.2+7-27)
        OpenJDK 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)

      Apache Ant 1.10.9
        $ ant -version
        Apache Ant(TM) version 1.10.9 compiled on September 27 2020

      STEPS TO REPRODUCE

      Simulate a Canadian locale by running the tests with:

        $ bash gradlew -Duser.country=CA test -x :web:test

      EXPECTED RESULTS

      The tests should be successful regardless of the locale:

        $ bash gradlew test -x :web:test
        ...
        BUILD SUCCESSFUL in 4m 16s
        192 actionable tasks: 192 executed

      ACTUAL RESULT

      The tests fail on a system with a Canadian locale:

        $ bash gradlew test -x :web:test
        ...
        > Task :base:test

        test.javafx.util.converter.LocalDateTimeStringConverterTest
          > toString_to_fromString_testRoundtrip[0] FAILED
          java.time.format.DateTimeParseException:
          Text '1985-01-12, 12:34 p.m.' could not be parsed,
          unparsed text found at index 19
        ...
        5311 tests completed, 1 failed, 28 skipped

        > Task :base:test FAILED

        FAILURE: Build failed with an exception.

      SOURCE CODE FOR AN EXECUTABLE TEST CASE

      None.

      WORKAROUND

      To work around the problem, run the tests with a default U.S. locale:

        $ bash gradlew -Duser.country=US test -x :web:test

            jgneff John Neffenger
            jgneff John Neffenger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: