Getting initialize class org.apache.nifi.util.text.RegexDateTimeMatcher error in jsontreereader
check for null values returned by getZoneStrings()
@@ -131,11 +131,12 @@ public class RegexDateTimeMatcher implements DateTimeMatcher {
final StringBuilder zoneNamePatternBuilder = new StringBuilder();
for (final String[] zoneNames : zoneStrings) {
for (final String zoneName : zoneNames) {
+ if (zoneName != null && !zoneName.isEmpty()) {
zoneNamePatternBuilder.append(Pattern.quote(zoneName)).append("|");
-
maxTimeZoneLength = Math.max(maxTimeZoneLength, zoneName.length());
}
}
+ }
zoneNamePatternBuilder.deleteCharAt(zoneNamePatternBuilder.length() - 1);
ZONE_NAME_PATTERN = zoneNamePatternBuilder.toString();
