提交 0d6a96d7 编写于 作者: R rriggs

8028092: Lint cleanup of java.time.format

Summary: correct declarations and add @SuppressWarnings
Reviewed-by: darcy, lancea
上级 c8dc869e
......@@ -369,7 +369,8 @@ final class DateTimeParseContext {
Objects.requireNonNull(chrono, "chrono");
currentParsed().chrono = chrono;
if (chronoListeners != null && !chronoListeners.isEmpty()) {
Consumer[] tmp = new Consumer[1];
@SuppressWarnings({"rawtypes", "unchecked"})
Consumer<Chronology>[] tmp = new Consumer[1];
Consumer<Chronology>[] listeners = chronoListeners.toArray(tmp);
chronoListeners.clear();
for (Consumer<Chronology> l : listeners) {
......
......@@ -266,14 +266,14 @@ final class Parsed implements TemporalAccessor {
TemporalAccessor resolvedObject = targetField.resolve(fieldValues, this, resolverStyle);
if (resolvedObject != null) {
if (resolvedObject instanceof ChronoZonedDateTime) {
ChronoZonedDateTime czdt = (ChronoZonedDateTime) resolvedObject;
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;
ChronoLocalDateTime<?> cldt = (ChronoLocalDateTime) resolvedObject;
updateCheckConflict(cldt.toLocalTime(), Period.ZERO);
updateCheckConflict(cldt.toLocalDate());
changedCount++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册