PMD: These nested if statements could be combined

This commit is contained in:
Benedikt Ritter 2016-09-20 18:01:10 +02:00
parent 31d02f6806
commit db6f7c1d74
No known key found for this signature in database
GPG Key ID: 9DAADC1C9FCC82D0
1 changed files with 3 additions and 5 deletions

View File

@ -242,11 +242,9 @@ public class FastDateParser implements DateParser, Serializable {
char c = pattern.charAt(currentIdx); char c = pattern.charAt(currentIdx);
if (!activeQuote && isFormatLetter(c)) { if (!activeQuote && isFormatLetter(c)) {
break; break;
} else if (c == '\'') { } else if (c == '\'' && (++currentIdx == pattern.length() || pattern.charAt(currentIdx) != '\'')) {
if (++currentIdx == pattern.length() || pattern.charAt(currentIdx) != '\'') { activeQuote = !activeQuote;
activeQuote = !activeQuote; continue;
continue;
}
} }
++currentIdx; ++currentIdx;
sb.append(c); sb.append(c);