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

java.time.format.DateTimeParseException when parsing UTC+00:00 with zxxx format

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 17, 22
    • core-libs
    • None

      "java.time.format.DateTimeParseException" is thrown when parsing "2019-03-12T17:51:40.123UTC+00:00" datetime string with "yyyy-MM-dd'T'HH:mm:ss.SSSzxxx" format. The same is for 'zxxxxx':

      java.time.format.DateTimeParseException: Text '2019-03-12T17:51:40.123UTC+00:00' could not be parsed at index 32
              at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2108)
              at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:2010)
              at java.base/java.time.ZonedDateTime.parse(ZonedDateTime.java:600)
              at Reproducer.main(Reproducer.java:18)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
              at java.base/java.lang.reflect.Method.invoke(Method.java:580)
              at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:484)
              at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:208)
              at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:135)


      The reproducer is attached.

      The problem seems caused by JDK-8303440 - the exception is not thrown before this change. This seems affect all JDK versions which have JDK-8303440 integrated.

            naoto Naoto Sato
            rmarchenko Roman Marchenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: