throw new DateTimeException("Invalid Era/YearOfEra: " + era + " " + yoe); if (jd.get(YEAR_OF_ERA) != 1 && yoe != 1) { throw new DateTimeException("Invalid Era/YearOfEra: " + era + " " + yoe);
int ad = ALIGNED_DAY_OF_WEEK_IN_MONTH.checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH)); JapaneseDate date = date(y, moy, 1).plus((aw - 1) * 7 + (ad - 1), DAYS); if (resolverStyle == ResolverStyle.STRICT && date.get(MONTH_OF_YEAR) != moy) { throw new DateTimeException("Strict mode rejected date parsed to a different month"); int dow = DAY_OF_WEEK.checkValidIntValue(fieldValues.remove(DAY_OF_WEEK)); JapaneseDate date = date(y, moy, 1).plus(aw - 1, WEEKS).with(nextOrSame(DayOfWeek.of(dow))); if (resolverStyle == ResolverStyle.STRICT && date.get(MONTH_OF_YEAR) != moy) { throw new DateTimeException("Strict mode rejected date parsed to a different month"); int ad = ALIGNED_DAY_OF_WEEK_IN_YEAR.checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_YEAR)); JapaneseDate date = date(y, 1, 1).plusDays((aw - 1) * 7 + (ad - 1)); if (resolverStyle == ResolverStyle.STRICT && date.get(YEAR) != y) { throw new DateTimeException("Strict mode rejected date parsed to a different year"); int dow = DAY_OF_WEEK.checkValidIntValue(fieldValues.remove(DAY_OF_WEEK)); JapaneseDate date = date(y, 1, 1).plus(aw - 1, WEEKS).with(nextOrSame(DayOfWeek.of(dow))); if (resolverStyle == ResolverStyle.STRICT && date.get(YEAR) != y) { throw new DateTimeException("Strict mode rejected date parsed to a different month");