Fix NullPointerException in FastDateParser$TimeZoneStrategy

This commit is contained in:
Nick Manley 2015-11-19 23:24:05 -06:00
parent 56907c9a96
commit 5556026ed1
2 changed files with 6 additions and 1 deletions

View File

@ -853,6 +853,9 @@ static class TimeZoneStrategy extends PatternStrategy {
final TimeZone tz = TimeZone.getTimeZone(tzId);
for(int i= 1; i<zoneNames.length; ++i) {
String zoneName = zoneNames[i];
if (zoneName == null) {
break;
}
if (tzNames.put(zoneName.toLowerCase(locale), tz) == null) {
simpleQuote(sb.append('|'), zoneName);
}

View File

@ -33,7 +33,9 @@ public void testTimeZoneStrategyPattern() {
for(final String[] zone : zones) {
for(int t = 1; t<zone.length; ++t) {
final String tzDisplay = zone[t];
if (tzDisplay == null) {
break;
}
try {
parser.parse(tzDisplay);
}