int changes = 0;
outer:
while (changes < 100) {
for (Map.Entry<TemporalField, Long> entry : fieldValues.entrySet()) {
TemporalField targetField = entry.getKey();
TemporalAccessor resolvedObject = targetField.resolve(fieldValues, this, resolverStyle);
if (resolvedObject != null) {
if (resolvedObject instanceof ChronoZonedDateTime) {
ChronoZonedDateTime<?> czdt = (ChronoZonedDateTime<?>) resolvedObject;
if (zone == null) {
zone = czdt.getZone();
} else if (zone.equals(czdt.getZone()) == false) {
throw new DateTimeException("ChronoZonedDateTime must use the effective parsed zone: " + zone);
}
resolvedObject = czdt.toLocalDateTime();
}
if (resolvedObject instanceof ChronoLocalDate) {
resolveMakeChanges(targetField, (ChronoLocalDate) resolvedObject);
changes++;
continue outer; // have to restart to avoid concurrent modification
}
if (resolvedObject instanceof LocalTime) {
resolveMakeChanges(targetField, (LocalTime) resolvedObject);
changes++;
continue outer; // have to restart to avoid concurrent modification
}
if (resolvedObject instanceof ChronoLocalDateTime<?>) {
ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
resolveMakeChanges(targetField, cldt.toLocalDate());
resolveMakeChanges(targetField, cldt.toLocalTime());
changes++;
continue outer; // have to restart to avoid concurrent modification
}
throw new DateTimeException("Unknown type: " + resolvedObject.getClass().getName());
} else if (fieldValues.containsKey(targetField) == false) {
changes++;
continue outer; // have to restart to avoid concurrent modification
}
}