changeset 21639:39da287ca867

8028092: Lint cleanup of java.time.format Summary: correct declarations and add @SuppressWarnings Reviewed-by: darcy, lancea
author rriggs
date Sat, 09 Nov 2013 14:30:03 -0500
parents d51c48db93d8
children 6bbdcc430310
files jdk/src/share/classes/java/time/format/DateTimeParseContext.java jdk/src/share/classes/java/time/format/Parsed.java
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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++;