Relates :
|
|
Relates :
|
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