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);
if (!activeQuote && isFormatLetter(c)) {
break;
} else if (c == '\'') {
if (++currentIdx == pattern.length() || pattern.charAt(currentIdx) != '\'') {
activeQuote = !activeQuote;
continue;
}
} else if (c == '\'' && (++currentIdx == pattern.length() || pattern.charAt(currentIdx) != '\'')) {
activeQuote = !activeQuote;
continue;
}
++currentIdx;
sb.append(c);