Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3352

Calendar values are parsed with unknown timezones

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.12, 2.0.1, 2.0.2, 3.0.0 PDFBox
    • Fix Version/s: 1.8.13, 2.0.2, 3.0.0 PDFBox
    • Component/s: Parsing
    • Labels:

      Description

      Example of Calendar instance parsed from document:

      java.util.SimpleTimeZone[id=unknown,offset=7200000,dstSavings=3600000,useDaylight=false,startYear=0,startMode=0,startMonth=0,startDay=0,startDayOfWeek=0,startTime=0,startTimeMode=0,endMode=0,endMonth=0,endDay=0,endDayOfWeek=0,endTime=0,endTimeMode=0]
      

      Although calling e.g. timeZone.getDisplayName() shows correclty 'GMT+02:00', timeZone.toZoneId() fails with following stack trace:

      java.time.zone.ZoneRulesException: Unknown time-zone ID: unknown
      	at java.time.zone.ZoneRulesProvider.getProvider(ZoneRulesProvider.java:272)
      	at java.time.zone.ZoneRulesProvider.getRules(ZoneRulesProvider.java:227)
      	at java.time.ZoneRegion.ofId(ZoneRegion.java:120)
      	at java.time.ZoneId.of(ZoneId.java:411)
      	at java.time.ZoneId.of(ZoneId.java:359)
      	at java.time.ZoneId.of(ZoneId.java:315)
      	at java.util.TimeZone.toZoneId(TimeZone.java:556)
              ...
      

      This is fixed in PDFBOX-1633 but although the fixVersion is 1.8.3, I couldn't find the commit on 1.8 branch (only on 2.0)

        Attachments

        1. test.pdf
          8 kB
          Robert Šiška

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              RobSis Robert Šiška
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: