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

Adjacent value parsing not supported for Localized Patterns

    Details

    • Subcomponent:
    • Resolved In Build:
      b151
    • CPU:
      generic
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      DateTimeFormatter.ofPattern("YYYYww").parse("201550") fails with "java.time.format.DateTimeParseException: Text '201550' could not be parsed at index 0" and I think it shouldn't.
      The same text and pattern work with SimpleDateFormat, so does DateTimeFormatter.ofPattern("YYww").parse("1550").
      It fails in java.time.format.DateTimeFormatterBuilder.NumberPrinterParser.parse(DateTimeParseContext, CharSequence, int), line 2695
      http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/6ea3aea950d1/src/share/classes/java/time/format/DateTimeFormatterBuilder.java#l2695
      However, parsing "2015 50" with "YYYY ww" works fine.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      DateTimeFormatter.ofPattern("YYYYww").parse("201550")

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      {WeekBasedYear[WeekFields[MONDAY,4]]=2015, WeekOfWeekBasedYear[WeekFields[MONDAY,4]]=50},ISO
      ACTUAL -
      IllegalArgumentException: Text '201550' could not be parsed at index 0

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Activity

        webbuggrp Webbug Group created issue -
        psonal Pallavi Sonal made changes -
        Field Original Value New Value
        Affects Version/s 8 [ 15409 ]
        Affects Version/s 9 [ 16400 ]
        Affects Version/s 8u72 [ 18315 ]
        psonal Pallavi Sonal made changes -
        Labels webbug dcs-pso webbug
        psonal Pallavi Sonal made changes -
        CPU x86_64 [ 19000 ] generic [ 17008 ]
        psonal Pallavi Sonal made changes -
        OS linux [ 17023 ] generic [ 17010 ]
        psonal Pallavi Sonal made changes -
        Subcomponent java.util [ 505 ] java.time [ 787 ]
        psonal Pallavi Sonal made changes -
        Attachment TestParsingWeekYear.java [ 55934 ]
        psonal Pallavi Sonal made changes -
        Project Java Incidents [ 10301 ] JDK [ 10100 ]
        Key JI-9027535 JDK-8145633
        Workflow JBS Incident Workflow [ 4865451 ] JBS Workflow [ 4865451 ]
        Component/s core-libs [ 10300 ]
        Component/s core-libs [ 10701 ]
        Affects Version/s 8 [ 11815 ]
        Affects Version/s 9 [ 14949 ]
        Affects Version/s 8 [ 15409 ]
        Affects Version/s 9 [ 16400 ]
        psonal Pallavi Sonal made changes -
        Subcomponent java.time [ 787 ] java.time [ 697 ]
        rpatil Ramanand Patil made changes -
        Assignee Ramanand Patil [ rpatil ]
        dfuchs Daniel Fuchs made changes -
        Status New [ 10000 ] Open [ 1 ]
        rpatil Ramanand Patil made changes -
        Assignee Ramanand Patil [ rpatil ]
        psonal Pallavi Sonal made changes -
        Labels dcs-pso webbug dcs-pso reproducer-yes webbug
        ntv Nadeesh Tv made changes -
        Assignee Nadeesh Tv [ ntv ]
        ntv Nadeesh Tv made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        jeff Jeff Dinkins made changes -
        Issue Type Bug [ 1 ] Enhancement [ 7 ]
        ntv Nadeesh Tv made changes -
        Labels dcs-pso reproducer-yes webbug dcs-pso jdk9-fc-request reproducer-yes webbug
        briangoetz Brian Goetz made changes -
        Labels dcs-pso jdk9-fc-request reproducer-yes webbug dcs-pso jdk9-fc-request jdk9-fc-yes reproducer-yes webbug
        ntv Nadeesh Tv made changes -
        Due Date 2016-08-26
        ntv Nadeesh Tv made changes -
        Due Date 2016-08-26 2016-11-10
        ntv Nadeesh Tv made changes -
        Summary DateTimeFormatter has issues with four-digit week-year  Adjacent value parsing not supported for Localized Patterns
        hgupdate HG Updates made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolved In Build team [ 17324 ]
        Fix Version/s 9 [ 14949 ]
        Resolution Fixed [ 1 ]
        hgupdate HG Updates made changes -
        Resolved In Build team [ 17324 ] master [ 18256 ]
        hgupdate HG Updates made changes -
        Resolved In Build master [ 18256 ] b151 [ 19702 ]
        ntv Nadeesh Tv made changes -
        Link This issue relates to JCK-7307759 [ JCK-7307759 ]

          People

          • Assignee:
            ntv Nadeesh Tv
            Reporter:
            webbuggrp Webbug Group
          • Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved: