This commit is contained in:
ggregory 2016-02-24 22:11:36 -08:00
parent 5e5ba1b812
commit bcc7c0c858

View File

@ -200,17 +200,17 @@ private class StrategyParser {
private int currentIdx;
StrategyParser(String pattern, Calendar definingCalendar) {
this.pattern = pattern;
this.definingCalendar = definingCalendar;
this.pattern = pattern;
this.definingCalendar = definingCalendar;
}
StrategyAndWidth getNextStrategy() {
if(currentIdx >= pattern.length()) {
if (currentIdx >= pattern.length()) {
return null;
}
char c = pattern.charAt(currentIdx);
if( isFormatLetter(c)) {
if (isFormatLetter(c)) {
return letterPattern(c);
}
return literal();
@ -218,8 +218,8 @@ StrategyAndWidth getNextStrategy() {
private StrategyAndWidth letterPattern(char c) {
int begin = currentIdx;
while( ++currentIdx<pattern.length() ) {
if(pattern.charAt(currentIdx) != c) {
while (++currentIdx < pattern.length()) {
if (pattern.charAt(currentIdx) != c) {
break;
}
}