8028092: Lint cleanup of java.time.format
authorrriggs
Sat, 09 Nov 2013 14:30:03 -0500
changeset 21639 39da287ca867
parent 21638 d51c48db93d8
child 21640 6bbdcc430310
8028092: Lint cleanup of java.time.format Summary: correct declarations and add @SuppressWarnings Reviewed-by: darcy, lancea
jdk/src/share/classes/java/time/format/DateTimeParseContext.java
jdk/src/share/classes/java/time/format/Parsed.java
--- a/jdk/src/share/classes/java/time/format/DateTimeParseContext.java	Sat Nov 09 16:46:46 2013 +0000
+++ b/jdk/src/share/classes/java/time/format/DateTimeParseContext.java	Sat Nov 09 14:30:03 2013 -0500
@@ -369,7 +369,8 @@
         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) {
--- a/jdk/src/share/classes/java/time/format/Parsed.java	Sat Nov 09 16:46:46 2013 +0000
+++ b/jdk/src/share/classes/java/time/format/Parsed.java	Sat Nov 09 14:30:03 2013 -0500
@@ -266,14 +266,14 @@
                     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++;