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

TzdbZoneRulesCompiler.java throws Null Pointer Exception While Compiling and building TZDB data file

    Details

    • Subcomponent:
    • Introduced In Build:
      b22
    • Resolved In Build:
      b106
    • CPU:
      generic
    • OS:
      generic

      Description

      While Compiling the tzdata2016a the below NPE is thrown:
      java.lang.NullPointerException
                      at build.tools.tzdb.ZoneRules.writeRule(ZoneRules.java:235)
                      at build.tools.tzdb.ZoneRules.writeExternal(ZoneRules.java:186)
                      at build.tools.tzdb.TzdbZoneRulesCompiler.outputFile(TzdbZoneRulesCompiler.java:266)
                      at build.tools.tzdb.TzdbZoneRulesCompiler.compile(TzdbZoneRulesCompiler.java:217)
                      at build.tools.tzdb.TzdbZoneRulesCompiler.main(TzdbZoneRulesCompiler.java:89)
       
      It fails for the below Transition Rules:
      TransitionRule[Gap +03:30 to +04:30, MARCH 21 at 00:00 WALL, standard offset +03:30]
      TransitionRule[Overlap +04:30 to +03:30, SEPTEMBER 21 at 00:00 WALL, standard offset +03:30]
      which corresponds to:
      Rule Iran 2036 max - Mar 21 0:00 1:00 D
      Rule Iran 2036 max - Sep 21 0:00 0 S

       
      Obviously, ZoneRules.java:235 lacks null check for the DayOfWeek field of ZoneOffsetTransitionRule.
       
      As per the ZoneOffsetTransitionRule constructor definition:
      "@param dayOfWeek the required day-of-week, null if the month-day should not be changed"
       
      All other parameters are "not null", so need for the null check while reading and writing those.
       
      Solution: Before getting day-of-week value(an integer value from 1 to 7) from DayOfWeek field of ZoneOffsetTransitionRule a null check is necessary in ZoneRules.java line no. 235

        Issue Links

          Activity

          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/769a0b1a26e9
          User: aefimov
          Date: 2016-02-09 11:53:04 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/769a0b1a26e9 User: aefimov Date: 2016-02-09 11:53:04 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/769a0b1a26e9
          User: lana
          Date: 2016-02-17 20:42:45 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/769a0b1a26e9 User: lana Date: 2016-02-17 20:42:45 +0000

            People

            • Assignee:
              rpatil Ramanand Patil
              Reporter:
              rpatil Ramanand Patil
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: