Java Code Examples for java.time.temporal.TemporalField#resolve()

The following examples show how to use java.time.temporal.TemporalField#resolve() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Parsed.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 2
Source File: Parsed.java    From j2objc with Apache License 2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 3
Source File: Parsed.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 4
Source File: Parsed.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 5
Source File: Parsed.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 6
Source File: Parsed.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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.equals(czdt.getZone()) == false) {
                            throw new DateTimeException("ChronoZonedDateTime must use the effective parsed zone: " + zone);
                        }
                        resolvedObject = czdt.toLocalDateTime();
                    }
                    if (resolvedObject instanceof ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolveFields() can only return ChronoZonedDateTime," +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 7
Source File: Parsed.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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.equals(czdt.getZone()) == false) {
                            throw new DateTimeException("ChronoZonedDateTime must use the effective parsed zone: " + zone);
                        }
                        resolvedObject = czdt.toLocalDateTime();
                    }
                    if (resolvedObject instanceof ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolveFields() can only return ChronoZonedDateTime," +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 8
Source File: Parsed.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 9
Source File: Parsed.java    From Java8CN with Apache License 2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 10
Source File: Parsed.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 11
Source File: Parsed.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 12
Source File: Parsed.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 13
Source File: Parsed.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 14
Source File: Parsed.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 15
Source File: Parsed.java    From desugar_jdk_libs with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 16
Source File: Parsed.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 17
Source File: Parsed.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 18
Source File: Parsed.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}
 
Example 19
Source File: Parsed.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void resolveFields() {
    // resolve ChronoField
    resolveInstantFields();
    resolveDateFields();
    resolveTimeFields();

    // if any other fields, handle them
    // any lenient date resolution should return epoch-day
    if (fieldValues.size() > 0) {
        int changedCount = 0;
        outer:
        while (changedCount < 50) {
            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 ChronoLocalDateTime) {
                        ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime<?>) resolvedObject;
                        updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
                        updateCheckConflict(cldt.toLocalDate());
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof ChronoLocalDate) {
                        updateCheckConflict((ChronoLocalDate) resolvedObject);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    if (resolvedObject instanceof LocalTime) {
                        updateCheckConflict((LocalTime) resolvedObject, Period.ZERO);
                        changedCount++;
                        continue outer;  // have to restart to avoid concurrent modification
                    }
                    throw new DateTimeException("Method resolve() can only return ChronoZonedDateTime, " +
                            "ChronoLocalDateTime, ChronoLocalDate or LocalTime");
                } else if (fieldValues.containsKey(targetField) == false) {
                    changedCount++;
                    continue outer;  // have to restart to avoid concurrent modification
                }
            }
            break;
        }
        if (changedCount == 50) {  // catch infinite loops
            throw new DateTimeException("One of the parsed fields has an incorrectly implemented resolve method");
        }
        // if something changed then have to redo ChronoField resolve
        if (changedCount > 0) {
            resolveInstantFields();
            resolveDateFields();
            resolveTimeFields();
        }
    }
}