Created
April 3, 2013 16:31
-
-
Save jodastephen/5302853 to your computer and use it in GitHub Desktop.
Patch for ChronoLocalDate no generics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/share/classes/java/time/LocalDate.java b/src/share/classes/java/time/LocalDate.java | |
--- a/src/share/classes/java/time/LocalDate.java | |
+++ b/src/share/classes/java/time/LocalDate.java | |
@@ -127,7 +127,7 @@ | |
* @since 1.8 | |
*/ | |
public final class LocalDate | |
- implements Temporal, TemporalAdjuster, ChronoLocalDate<LocalDate>, Serializable { | |
+ implements Temporal, TemporalAdjuster, ChronoLocalDate, Serializable { | |
/** | |
* The minimum supported {@code LocalDate}, '-999999999-01-01'. | |
@@ -1600,7 +1600,7 @@ | |
* @return the period between this date and the end date, not null | |
*/ | |
@Override | |
- public Period periodUntil(ChronoLocalDate<?> endDate) { | |
+ public Period periodUntil(ChronoLocalDate endDate) { | |
LocalDate end = LocalDate.from(endDate); | |
long totalMonths = end.getProlepticMonth() - this.getProlepticMonth(); // safe | |
int days = end.day - this.day; | |
@@ -1803,7 +1803,7 @@ | |
* @return the comparator value, negative if less, positive if greater | |
*/ | |
@Override // override for Javadoc and performance | |
- public int compareTo(ChronoLocalDate<?> other) { | |
+ public int compareTo(ChronoLocalDate other) { | |
if (other instanceof LocalDate) { | |
return compareTo0((LocalDate) other); | |
} | |
@@ -1843,7 +1843,7 @@ | |
* @return true if this date is after the specified date | |
*/ | |
@Override // override for Javadoc and performance | |
- public boolean isAfter(ChronoLocalDate<?> other) { | |
+ public boolean isAfter(ChronoLocalDate other) { | |
if (other instanceof LocalDate) { | |
return compareTo0((LocalDate) other) > 0; | |
} | |
@@ -1872,7 +1872,7 @@ | |
* @return true if this date is before the specified date | |
*/ | |
@Override // override for Javadoc and performance | |
- public boolean isBefore(ChronoLocalDate<?> other) { | |
+ public boolean isBefore(ChronoLocalDate other) { | |
if (other instanceof LocalDate) { | |
return compareTo0((LocalDate) other) < 0; | |
} | |
@@ -1901,7 +1901,7 @@ | |
* @return true if this date is equal to the specified date | |
*/ | |
@Override // override for Javadoc and performance | |
- public boolean isEqual(ChronoLocalDate<?> other) { | |
+ public boolean isEqual(ChronoLocalDate other) { | |
if (other instanceof LocalDate) { | |
return compareTo0((LocalDate) other) == 0; | |
} | |
diff --git a/src/share/classes/java/time/chrono/ChronoDateImpl.java b/src/share/classes/java/time/chrono/ChronoDateImpl.java | |
--- a/src/share/classes/java/time/chrono/ChronoDateImpl.java | |
+++ b/src/share/classes/java/time/chrono/ChronoDateImpl.java | |
@@ -67,6 +67,8 @@ | |
import java.time.temporal.ChronoUnit; | |
import java.time.temporal.Temporal; | |
import java.time.temporal.TemporalAdjuster; | |
+import java.time.temporal.TemporalAmount; | |
+import java.time.temporal.TemporalField; | |
import java.time.temporal.TemporalUnit; | |
import java.time.temporal.UnsupportedTemporalTypeException; | |
import java.time.temporal.ValueRange; | |
@@ -138,8 +140,8 @@ | |
* @param <D> the ChronoLocalDate of this date-time | |
* @since 1.8 | |
*/ | |
-abstract class ChronoDateImpl<D extends ChronoLocalDate<D>> | |
- implements ChronoLocalDate<D>, Temporal, TemporalAdjuster, Serializable { | |
+abstract class ChronoDateImpl<D extends ChronoDateImpl<D>> | |
+ implements ChronoLocalDate, Temporal, TemporalAdjuster, Serializable { | |
/** | |
* Serialization version. | |
@@ -154,6 +156,22 @@ | |
//----------------------------------------------------------------------- | |
@Override | |
+ public D with(TemporalAdjuster adjuster) { | |
+ return (D) ChronoLocalDate.super.with(adjuster); | |
+ } | |
+ | |
+ @Override | |
+ public D with(TemporalField field, long value) { | |
+ return (D) ChronoLocalDate.super.with(field, value); | |
+ } | |
+ | |
+ //----------------------------------------------------------------------- | |
+ @Override | |
+ public D plus(TemporalAmount amount) { | |
+ return (D) ChronoLocalDate.super.plus(amount); | |
+ } | |
+ | |
+ @Override | |
public D plus(long amountToAdd, TemporalUnit unit) { | |
if (unit instanceof ChronoUnit) { | |
ChronoUnit f = (ChronoUnit) unit; | |
@@ -169,7 +187,17 @@ | |
} | |
throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit.getName()); | |
} | |
- return ChronoLocalDate.super.plus(amountToAdd, unit); | |
+ return (D) ChronoLocalDate.super.plus(amountToAdd, unit); | |
+ } | |
+ | |
+ @Override | |
+ public D minus(TemporalAmount amount) { | |
+ return (D) ChronoLocalDate.super.minus(amount); | |
+ } | |
+ | |
+ @Override | |
+ public D minus(long amountToSubtract, TemporalUnit unit) { | |
+ return (D) ChronoLocalDate.super.minus(amountToSubtract, unit); | |
} | |
//----------------------------------------------------------------------- | |
@@ -327,7 +355,7 @@ | |
if (endDateTime instanceof ChronoLocalDate == false) { | |
throw new DateTimeException("Unable to calculate period between objects of two different types"); | |
} | |
- ChronoLocalDate<?> end = (ChronoLocalDate<?>) endDateTime; | |
+ ChronoLocalDate end = (ChronoLocalDate) endDateTime; | |
if (getChronology().equals(end.getChronology()) == false) { | |
throw new DateTimeException("Unable to calculate period between two different chronologies"); | |
} | |
@@ -347,11 +375,11 @@ | |
return unit.between(this, endDateTime); | |
} | |
- private long daysUntil(ChronoLocalDate<?> end) { | |
+ private long daysUntil(ChronoLocalDate end) { | |
return end.toEpochDay() - toEpochDay(); // no overflow | |
} | |
- private long monthsUntil(ChronoLocalDate<?> end) { | |
+ private long monthsUntil(ChronoLocalDate end) { | |
ValueRange range = getChronology().range(MONTH_OF_YEAR); | |
if (range.getMaximum() != 12) { | |
throw new IllegalStateException("ChronoDateImpl only supports Chronologies with 12 months per year"); | |
@@ -367,7 +395,7 @@ | |
return true; | |
} | |
if (obj instanceof ChronoLocalDate) { | |
- return compareTo((ChronoLocalDate<?>) obj) == 0; | |
+ return compareTo((ChronoLocalDate) obj) == 0; | |
} | |
return false; | |
} | |
diff --git a/src/share/classes/java/time/chrono/ChronoLocalDate.java b/src/share/classes/java/time/chrono/ChronoLocalDate.java | |
--- a/src/share/classes/java/time/chrono/ChronoLocalDate.java | |
+++ b/src/share/classes/java/time/chrono/ChronoLocalDate.java | |
@@ -242,11 +242,10 @@ | |
* Additional calendar systems may be added to the system. | |
* See {@link Chronology} for more details. | |
* | |
- * @param <D> the concrete type for the date | |
* @since 1.8 | |
*/ | |
-public interface ChronoLocalDate<D extends ChronoLocalDate<D>> | |
- extends Temporal, TemporalAdjuster, Comparable<ChronoLocalDate<?>> { | |
+public interface ChronoLocalDate | |
+ extends Temporal, TemporalAdjuster, Comparable<ChronoLocalDate> { | |
/** | |
* Gets a comparator that compares {@code ChronoLocalDate} in | |
@@ -262,7 +261,7 @@ | |
* @see #isBefore | |
* @see #isEqual | |
*/ | |
- public static Comparator<ChronoLocalDate<?>> timeLineOrder() { | |
+ public static Comparator<ChronoLocalDate> timeLineOrder() { | |
return Chronology.DATE_ORDER; | |
} | |
@@ -288,9 +287,9 @@ | |
* @throws DateTimeException if unable to convert to a {@code ChronoLocalDate} | |
* @see Chronology#date(TemporalAccessor) | |
*/ | |
- public static ChronoLocalDate<?> from(TemporalAccessor temporal) { | |
+ public static ChronoLocalDate from(TemporalAccessor temporal) { | |
if (temporal instanceof ChronoLocalDate) { | |
- return (ChronoLocalDate<?>) temporal; | |
+ return (ChronoLocalDate) temporal; | |
} | |
Chronology chrono = temporal.query(TemporalQuery.chronology()); | |
if (chrono == null) { | |
@@ -382,8 +381,8 @@ | |
* @throws ArithmeticException {@inheritDoc} | |
*/ | |
@Override | |
- public default D with(TemporalAdjuster adjuster) { | |
- return (D) getChronology().ensureChronoLocalDate(Temporal.super.with(adjuster)); | |
+ public default ChronoLocalDate with(TemporalAdjuster adjuster) { | |
+ return getChronology().ensureChronoLocalDate(Temporal.super.with(adjuster)); | |
} | |
/** | |
@@ -393,11 +392,11 @@ | |
* @throws ArithmeticException {@inheritDoc} | |
*/ | |
@Override | |
- public default D with(TemporalField field, long newValue) { | |
+ public default ChronoLocalDate with(TemporalField field, long newValue) { | |
if (field instanceof ChronoField) { | |
throw new UnsupportedTemporalTypeException("Unsupported field: " + field.getName()); | |
} | |
- return (D) getChronology().ensureChronoLocalDate(field.adjustInto(this, newValue)); | |
+ return getChronology().ensureChronoLocalDate(field.adjustInto(this, newValue)); | |
} | |
/** | |
@@ -406,8 +405,8 @@ | |
* @throws ArithmeticException {@inheritDoc} | |
*/ | |
@Override | |
- public default D plus(TemporalAmount amount) { | |
- return (D) getChronology().ensureChronoLocalDate(Temporal.super.plus(amount)); | |
+ public default ChronoLocalDate plus(TemporalAmount amount) { | |
+ return getChronology().ensureChronoLocalDate(Temporal.super.plus(amount)); | |
} | |
/** | |
@@ -416,11 +415,11 @@ | |
* @throws ArithmeticException {@inheritDoc} | |
*/ | |
@Override | |
- public default D plus(long amountToAdd, TemporalUnit unit) { | |
+ public default ChronoLocalDate plus(long amountToAdd, TemporalUnit unit) { | |
if (unit instanceof ChronoUnit) { | |
throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit.getName()); | |
} | |
- return (D) getChronology().ensureChronoLocalDate(unit.addTo(this, amountToAdd)); | |
+ return getChronology().ensureChronoLocalDate(unit.addTo(this, amountToAdd)); | |
} | |
/** | |
@@ -429,8 +428,8 @@ | |
* @throws ArithmeticException {@inheritDoc} | |
*/ | |
@Override | |
- public default D minus(TemporalAmount amount) { | |
- return (D) getChronology().ensureChronoLocalDate(Temporal.super.minus(amount)); | |
+ public default ChronoLocalDate minus(TemporalAmount amount) { | |
+ return getChronology().ensureChronoLocalDate(Temporal.super.minus(amount)); | |
} | |
/** | |
@@ -440,8 +439,8 @@ | |
* @throws ArithmeticException {@inheritDoc} | |
*/ | |
@Override | |
- public default D minus(long amountToSubtract, TemporalUnit unit) { | |
- return (D) getChronology().ensureChronoLocalDate(Temporal.super.minus(amountToSubtract, unit)); | |
+ public default ChronoLocalDate minus(long amountToSubtract, TemporalUnit unit) { | |
+ return getChronology().ensureChronoLocalDate(Temporal.super.minus(amountToSubtract, unit)); | |
} | |
//----------------------------------------------------------------------- | |
@@ -574,7 +573,7 @@ | |
* @throws DateTimeException if the period cannot be calculated | |
* @throws ArithmeticException if numeric overflow occurs | |
*/ | |
- public Period periodUntil(ChronoLocalDate<?> endDate); | |
+ public Period periodUntil(ChronoLocalDate endDate); | |
/** | |
* Formats this date using the specified formatter. | |
@@ -605,7 +604,7 @@ | |
* @param localTime the local time to use, not null | |
* @return the local date-time formed from this date and the specified time, not null | |
*/ | |
- public default ChronoLocalDateTime<D> atTime(LocalTime localTime) { | |
+ public default <D extends ChronoLocalDate> ChronoLocalDateTime<D> atTime(LocalTime localTime) { | |
return (ChronoLocalDateTime<D>)ChronoLocalDateTimeImpl.of(this, localTime); | |
} | |
@@ -655,7 +654,7 @@ | |
* @return the comparator value, negative if less, positive if greater | |
*/ | |
@Override | |
- public default int compareTo(ChronoLocalDate<?> other) { | |
+ public default int compareTo(ChronoLocalDate other) { | |
int cmp = Long.compare(toEpochDay(), other.toEpochDay()); | |
if (cmp == 0) { | |
cmp = getChronology().compareTo(other.getChronology()); | |
@@ -677,7 +676,7 @@ | |
* @param other the other date to compare to, not null | |
* @return true if this is after the specified date | |
*/ | |
- public default boolean isAfter(ChronoLocalDate<?> other) { | |
+ public default boolean isAfter(ChronoLocalDate other) { | |
return this.toEpochDay() > other.toEpochDay(); | |
} | |
@@ -695,7 +694,7 @@ | |
* @param other the other date to compare to, not null | |
* @return true if this is before the specified date | |
*/ | |
- public default boolean isBefore(ChronoLocalDate<?> other) { | |
+ public default boolean isBefore(ChronoLocalDate other) { | |
return this.toEpochDay() < other.toEpochDay(); | |
} | |
@@ -713,7 +712,7 @@ | |
* @param other the other date to compare to, not null | |
* @return true if the underlying date is equal to the specified date | |
*/ | |
- public default boolean isEqual(ChronoLocalDate<?> other) { | |
+ public default boolean isEqual(ChronoLocalDate other) { | |
return this.toEpochDay() == other.toEpochDay(); | |
} | |
diff --git a/src/share/classes/java/time/chrono/ChronoLocalDateTime.java b/src/share/classes/java/time/chrono/ChronoLocalDateTime.java | |
--- a/src/share/classes/java/time/chrono/ChronoLocalDateTime.java | |
+++ b/src/share/classes/java/time/chrono/ChronoLocalDateTime.java | |
@@ -114,7 +114,7 @@ | |
* @param <D> the concrete type for the date of this date-time | |
* @since 1.8 | |
*/ | |
-public interface ChronoLocalDateTime<D extends ChronoLocalDate<D>> | |
+public interface ChronoLocalDateTime<D extends ChronoLocalDate> | |
extends Temporal, TemporalAdjuster, Comparable<ChronoLocalDateTime<?>> { | |
/** | |
diff --git a/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java b/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java | |
--- a/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java | |
+++ b/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java | |
@@ -98,8 +98,8 @@ | |
* @param <D> the concrete type for the date of this date-time | |
* @since 1.8 | |
*/ | |
-final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate<D>> | |
- implements ChronoLocalDateTime<D>, Temporal, TemporalAdjuster, Serializable { | |
+final class ChronoLocalDateTimeImpl<D extends ChronoLocalDate> | |
+ implements ChronoLocalDateTime<D>, Temporal, TemporalAdjuster, Serializable { | |
/** | |
* Serialization version. | |
@@ -172,7 +172,7 @@ | |
* @return the local date-time, not null | |
*/ | |
@SuppressWarnings("rawtypes") | |
- static ChronoLocalDateTimeImpl<?> of(ChronoLocalDate<?> date, LocalTime time) { | |
+ static ChronoLocalDateTimeImpl<?> of(ChronoLocalDate date, LocalTime time) { | |
return new ChronoLocalDateTimeImpl(date, time); | |
} | |
@@ -260,7 +260,7 @@ | |
public ChronoLocalDateTimeImpl<D> with(TemporalAdjuster adjuster) { | |
if (adjuster instanceof ChronoLocalDate) { | |
// The Chronology is checked in with(date,time) | |
- return with((ChronoLocalDate<D>) adjuster, time); | |
+ return with((ChronoLocalDate) adjuster, time); | |
} else if (adjuster instanceof LocalTime) { | |
return with(date, (LocalTime) adjuster); | |
} else if (adjuster instanceof ChronoLocalDateTimeImpl) { | |
@@ -322,7 +322,7 @@ | |
} | |
//----------------------------------------------------------------------- | |
- private ChronoLocalDateTimeImpl<D> plusWithOverflow(ChronoLocalDate<?> newDate, long hours, long minutes, long seconds, long nanos) { | |
+ private ChronoLocalDateTimeImpl<D> plusWithOverflow(ChronoLocalDate newDate, long hours, long minutes, long seconds, long nanos) { | |
// 9223372036854775808 long, 2147483648 int | |
if ((hours | minutes | seconds | nanos) == 0) { | |
return with(newDate, time); | |
@@ -375,7 +375,7 @@ | |
} | |
return Math.addExact(amount, time.periodUntil(end.toLocalTime(), unit)); | |
} | |
- D endDate = end.toLocalDate(); | |
+ ChronoLocalDate endDate = end.toLocalDate(); | |
if (end.toLocalTime().isBefore(time)) { | |
endDate = endDate.minus(1, ChronoUnit.DAYS); | |
} | |
@@ -404,7 +404,7 @@ | |
} | |
static ChronoLocalDateTime<?> readExternal(ObjectInput in) throws IOException, ClassNotFoundException { | |
- ChronoLocalDate<?> date = (ChronoLocalDate<?>) in.readObject(); | |
+ ChronoLocalDate date = (ChronoLocalDate) in.readObject(); | |
LocalTime time = (LocalTime) in.readObject(); | |
return date.atTime(time); | |
} | |
diff --git a/src/share/classes/java/time/chrono/ChronoZonedDateTime.java b/src/share/classes/java/time/chrono/ChronoZonedDateTime.java | |
--- a/src/share/classes/java/time/chrono/ChronoZonedDateTime.java | |
+++ b/src/share/classes/java/time/chrono/ChronoZonedDateTime.java | |
@@ -115,7 +115,7 @@ | |
* @param <D> the concrete type for the date of this date-time | |
* @since 1.8 | |
*/ | |
-public interface ChronoZonedDateTime<D extends ChronoLocalDate<D>> | |
+public interface ChronoZonedDateTime<D extends ChronoLocalDate> | |
extends Temporal, Comparable<ChronoZonedDateTime<?>> { | |
/** | |
diff --git a/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java b/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java | |
--- a/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java | |
+++ b/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java | |
@@ -101,7 +101,7 @@ | |
* @param <D> the concrete type for the date of this date-time | |
* @since 1.8 | |
*/ | |
-final class ChronoZonedDateTimeImpl<D extends ChronoLocalDate<D>> | |
+final class ChronoZonedDateTimeImpl<D extends ChronoLocalDate> | |
implements ChronoZonedDateTime<D>, Serializable { | |
/** | |
@@ -131,7 +131,7 @@ | |
* @param preferredOffset the zone offset, null if no preference | |
* @return the zoned date-time, not null | |
*/ | |
- static <R extends ChronoLocalDate<R>> ChronoZonedDateTime<R> ofBest( | |
+ static <R extends ChronoLocalDate> ChronoZonedDateTime<R> ofBest( | |
ChronoLocalDateTimeImpl<R> localDateTime, ZoneId zone, ZoneOffset preferredOffset) { | |
Objects.requireNonNull(localDateTime, "localDateTime"); | |
Objects.requireNonNull(zone, "zone"); | |
@@ -168,12 +168,12 @@ | |
* @return the zoned date-time, not null | |
*/ | |
@SuppressWarnings("rawtypes") | |
- static ChronoZonedDateTimeImpl<?> ofInstant(Chronology chrono, Instant instant, ZoneId zone) { | |
+ static <D extends ChronoLocalDate> ChronoZonedDateTimeImpl<D> ofInstant(Chronology chrono, Instant instant, ZoneId zone) { | |
ZoneRules rules = zone.getRules(); | |
ZoneOffset offset = rules.getOffset(instant); | |
Objects.requireNonNull(offset, "offset"); // protect against bad ZoneRules | |
LocalDateTime ldt = LocalDateTime.ofEpochSecond(instant.getEpochSecond(), instant.getNano(), offset); | |
- ChronoLocalDateTimeImpl<?> cldt = (ChronoLocalDateTimeImpl<?>) chrono.localDateTime(ldt); | |
+ ChronoLocalDateTimeImpl<D> cldt = (ChronoLocalDateTimeImpl<D>) chrono.localDateTime(ldt); | |
return new ChronoZonedDateTimeImpl(cldt, offset, zone); | |
} | |
diff --git a/src/share/classes/java/time/chrono/Chronology.java b/src/share/classes/java/time/chrono/Chronology.java | |
--- a/src/share/classes/java/time/chrono/Chronology.java | |
+++ b/src/share/classes/java/time/chrono/Chronology.java | |
@@ -187,8 +187,8 @@ | |
/** | |
* ChronoLocalDate order constant. | |
*/ | |
- static final Comparator<ChronoLocalDate<?>> DATE_ORDER = | |
- (Comparator<ChronoLocalDate<?>> & Serializable) (date1, date2) -> { | |
+ static final Comparator<ChronoLocalDate> DATE_ORDER = | |
+ (Comparator<ChronoLocalDate> & Serializable) (date1, date2) -> { | |
return Long.compare(date1.toEpochDay(), date2.toEpochDay()); | |
}; | |
/** | |
@@ -495,9 +495,9 @@ | |
* @throws ClassCastException if the date-time cannot be cast to ChronoLocalDate | |
* or the chronology is not equal this Chronology | |
*/ | |
- ChronoLocalDate<?> ensureChronoLocalDate(Temporal temporal) { | |
+ ChronoLocalDate ensureChronoLocalDate(Temporal temporal) { | |
@SuppressWarnings("unchecked") | |
- ChronoLocalDate<?> other = (ChronoLocalDate<?>) temporal; | |
+ ChronoLocalDate other = (ChronoLocalDate) temporal; | |
if (this.equals(other.getChronology()) == false) { | |
throw new ClassCastException("Chronology mismatch, expected: " + getId() + ", actual: " + other.getChronology().getId()); | |
} | |
@@ -580,7 +580,7 @@ | |
* @throws DateTimeException if unable to create the date | |
* @throws ClassCastException if the {@code era} is not of the correct type for the chronology | |
*/ | |
- public ChronoLocalDate<?> date(Era era, int yearOfEra, int month, int dayOfMonth) { | |
+ public ChronoLocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) { | |
return date(prolepticYear(era, yearOfEra), month, dayOfMonth); | |
} | |
@@ -594,7 +594,7 @@ | |
* @return the local date in this chronology, not null | |
* @throws DateTimeException if unable to create the date | |
*/ | |
- public abstract ChronoLocalDate<?> date(int prolepticYear, int month, int dayOfMonth); | |
+ public abstract ChronoLocalDate date(int prolepticYear, int month, int dayOfMonth); | |
/** | |
* Obtains a local date in this chronology from the era, year-of-era and | |
@@ -607,7 +607,7 @@ | |
* @throws DateTimeException if unable to create the date | |
* @throws ClassCastException if the {@code era} is not of the correct type for the chronology | |
*/ | |
- public ChronoLocalDate<?> dateYearDay(Era era, int yearOfEra, int dayOfYear) { | |
+ public ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) { | |
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear); | |
} | |
@@ -620,7 +620,7 @@ | |
* @return the local date in this chronology, not null | |
* @throws DateTimeException if unable to create the date | |
*/ | |
- public abstract ChronoLocalDate<?> dateYearDay(int prolepticYear, int dayOfYear); | |
+ public abstract ChronoLocalDate dateYearDay(int prolepticYear, int dayOfYear); | |
/** | |
* Obtains a local date in this chronology from the epoch-day. | |
@@ -632,7 +632,7 @@ | |
* @return the local date in this chronology, not null | |
* @throws DateTimeException if unable to create the date | |
*/ | |
- public abstract ChronoLocalDate<?> dateEpochDay(long epochDay); | |
+ public abstract ChronoLocalDate dateEpochDay(long epochDay); | |
//----------------------------------------------------------------------- | |
/** | |
@@ -649,7 +649,7 @@ | |
* @return the current local date using the system clock and default time-zone, not null | |
* @throws DateTimeException if unable to create the date | |
*/ | |
- public ChronoLocalDate<?> dateNow() { | |
+ public ChronoLocalDate dateNow() { | |
return dateNow(Clock.systemDefaultZone()); | |
} | |
@@ -666,7 +666,7 @@ | |
* @return the current local date using the system clock, not null | |
* @throws DateTimeException if unable to create the date | |
*/ | |
- public ChronoLocalDate<?> dateNow(ZoneId zone) { | |
+ public ChronoLocalDate dateNow(ZoneId zone) { | |
return dateNow(Clock.system(zone)); | |
} | |
@@ -681,7 +681,7 @@ | |
* @return the current local date, not null | |
* @throws DateTimeException if unable to create the date | |
*/ | |
- public ChronoLocalDate<?> dateNow(Clock clock) { | |
+ public ChronoLocalDate dateNow(Clock clock) { | |
Objects.requireNonNull(clock, "clock"); | |
return date(LocalDate.now(clock)); | |
} | |
@@ -705,7 +705,7 @@ | |
* @throws DateTimeException if unable to create the date | |
* @see ChronoLocalDate#from(TemporalAccessor) | |
*/ | |
- public abstract ChronoLocalDate<?> date(TemporalAccessor temporal); | |
+ public abstract ChronoLocalDate date(TemporalAccessor temporal); | |
/** | |
* Obtains a local date-time in this chronology from another temporal object. | |
@@ -728,7 +728,7 @@ | |
* @throws DateTimeException if unable to create the date-time | |
* @see ChronoLocalDateTime#from(TemporalAccessor) | |
*/ | |
- public ChronoLocalDateTime<?> localDateTime(TemporalAccessor temporal) { | |
+ public ChronoLocalDateTime<? extends ChronoLocalDate> localDateTime(TemporalAccessor temporal) { | |
try { | |
return date(temporal).atTime(LocalTime.from(temporal)); | |
} catch (DateTimeException ex) { | |
@@ -760,7 +760,7 @@ | |
* @throws DateTimeException if unable to create the date-time | |
* @see ChronoZonedDateTime#from(TemporalAccessor) | |
*/ | |
- public ChronoZonedDateTime<?> zonedDateTime(TemporalAccessor temporal) { | |
+ public ChronoZonedDateTime<? extends ChronoLocalDate> zonedDateTime(TemporalAccessor temporal) { | |
try { | |
ZoneId zone = ZoneId.from(temporal); | |
try { | |
@@ -787,7 +787,7 @@ | |
* @return the zoned date-time, not null | |
* @throws DateTimeException if the result exceeds the supported range | |
*/ | |
- public ChronoZonedDateTime<?> zonedDateTime(Instant instant, ZoneId zone) { | |
+ public ChronoZonedDateTime<? extends ChronoLocalDate> zonedDateTime(Instant instant, ZoneId zone) { | |
return ChronoZonedDateTimeImpl.ofInstant(this, instant, zone); | |
} | |
@@ -946,7 +946,7 @@ | |
* @throws DateTimeException if the date cannot be resolved, typically | |
* because of a conflict in the input data | |
*/ | |
- public ChronoLocalDate<?> resolveDate(Map<TemporalField, Long> fieldValues) { | |
+ public ChronoLocalDate resolveDate(Map<TemporalField, Long> fieldValues) { | |
// check epoch-day before inventing era | |
if (fieldValues.containsKey(EPOCH_DAY)) { | |
return dateEpochDay(fieldValues.remove(EPOCH_DAY)); | |
@@ -957,7 +957,7 @@ | |
if (pMonth != null) { | |
// first day-of-month is likely to be safest for setting proleptic-month | |
// cannot add to year zero, as not all chronologies have a year zero | |
- ChronoLocalDate<?> chronoDate = dateNow() | |
+ ChronoLocalDate chronoDate = dateNow() | |
.with(DAY_OF_MONTH, 1).with(PROLEPTIC_MONTH, pMonth); | |
addFieldValue(fieldValues, MONTH_OF_YEAR, chronoDate.get(MONTH_OF_YEAR)); | |
addFieldValue(fieldValues, YEAR, chronoDate.get(YEAR)); | |
@@ -973,7 +973,7 @@ | |
addFieldValue(fieldValues, YEAR, prolepticYear(eraObj, yoe)); | |
} else if (fieldValues.containsKey(YEAR)) { | |
int year = range(YEAR).checkValidIntValue(fieldValues.get(YEAR), YEAR); | |
- ChronoLocalDate<?> chronoDate = dateYearDay(year, 1); | |
+ ChronoLocalDate chronoDate = dateYearDay(year, 1); | |
addFieldValue(fieldValues, YEAR, prolepticYear(chronoDate.getEra(), yoe)); | |
} else { | |
List<Era> eras = eras(); | |
@@ -1001,7 +1001,7 @@ | |
int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); | |
int aw = range(ALIGNED_WEEK_OF_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), ALIGNED_WEEK_OF_MONTH); | |
int ad = range(ALIGNED_DAY_OF_WEEK_IN_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), ALIGNED_DAY_OF_WEEK_IN_MONTH); | |
- ChronoLocalDate<?> chronoDate = date(y, moy, 1); | |
+ ChronoLocalDate chronoDate = date(y, moy, 1); | |
return chronoDate.plus((aw - 1) * 7 + (ad - 1), ChronoUnit.DAYS); | |
} | |
if (fieldValues.containsKey(DAY_OF_WEEK)) { | |
@@ -1009,7 +1009,7 @@ | |
int moy = range(MONTH_OF_YEAR).checkValidIntValue(fieldValues.remove(MONTH_OF_YEAR), MONTH_OF_YEAR); | |
int aw = range(ALIGNED_WEEK_OF_MONTH).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_MONTH), ALIGNED_WEEK_OF_MONTH); | |
int dow = range(DAY_OF_WEEK).checkValidIntValue(fieldValues.remove(DAY_OF_WEEK), DAY_OF_WEEK); | |
- ChronoLocalDate<?> chronoDate = date(y, moy, 1); | |
+ ChronoLocalDate chronoDate = date(y, moy, 1); | |
return chronoDate.plus((aw - 1) * 7, ChronoUnit.DAYS).with(nextOrSame(DayOfWeek.of(dow))); | |
} | |
} | |
@@ -1024,14 +1024,14 @@ | |
int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); | |
int aw = range(ALIGNED_WEEK_OF_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), ALIGNED_WEEK_OF_YEAR); | |
int ad = range(ALIGNED_DAY_OF_WEEK_IN_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_YEAR), ALIGNED_DAY_OF_WEEK_IN_YEAR); | |
- ChronoLocalDate<?> chronoDate = dateYearDay(y, 1); | |
+ ChronoLocalDate chronoDate = dateYearDay(y, 1); | |
return chronoDate.plus((aw - 1) * 7 + (ad - 1), ChronoUnit.DAYS); | |
} | |
if (fieldValues.containsKey(DAY_OF_WEEK)) { | |
int y = range(YEAR).checkValidIntValue(fieldValues.remove(YEAR), YEAR); | |
int aw = range(ALIGNED_WEEK_OF_YEAR).checkValidIntValue(fieldValues.remove(ALIGNED_WEEK_OF_YEAR), ALIGNED_WEEK_OF_YEAR); | |
int dow = range(DAY_OF_WEEK).checkValidIntValue(fieldValues.remove(DAY_OF_WEEK), DAY_OF_WEEK); | |
- ChronoLocalDate<?> chronoDate = dateYearDay(y, 1); | |
+ ChronoLocalDate chronoDate = dateYearDay(y, 1); | |
return chronoDate.plus((aw - 1) * 7, ChronoUnit.DAYS).with(nextOrSame(DayOfWeek.of(dow))); | |
} | |
} | |
diff --git a/src/share/classes/java/time/chrono/HijrahDate.java b/src/share/classes/java/time/chrono/HijrahDate.java | |
--- a/src/share/classes/java/time/chrono/HijrahDate.java | |
+++ b/src/share/classes/java/time/chrono/HijrahDate.java | |
@@ -109,7 +109,7 @@ | |
*/ | |
public final class HijrahDate | |
extends ChronoDateImpl<HijrahDate> | |
- implements ChronoLocalDate<HijrahDate>, Serializable { | |
+ implements ChronoLocalDate, Serializable { | |
/** | |
* Serialization version. | |
@@ -405,7 +405,7 @@ | |
} | |
throw new UnsupportedTemporalTypeException("Unsupported field: " + field.getName()); | |
} | |
- return ChronoLocalDate.super.with(field, newValue); | |
+ return super.with(field, newValue); | |
} | |
private HijrahDate resolvePreviousValid(int prolepticYear, int month, int day) { | |
@@ -580,7 +580,7 @@ | |
} | |
@Override | |
- public Period periodUntil(ChronoLocalDate<?> endDate) { | |
+ public Period periodUntil(ChronoLocalDate endDate) { | |
// TODO: untested | |
HijrahDate end = getChronology().date(endDate); | |
long totalMonths = (end.prolepticYear - this.prolepticYear) * 12 + (end.monthOfYear - this.monthOfYear); // safe | |
@@ -622,7 +622,7 @@ | |
return this; | |
} | |
- static ChronoLocalDate<HijrahDate> readExternal(ObjectInput in) throws IOException, ClassNotFoundException { | |
+ static ChronoLocalDate readExternal(ObjectInput in) throws IOException, ClassNotFoundException { | |
HijrahChronology chrono = (HijrahChronology) in.readObject(); | |
int year = in.readInt(); | |
int month = in.readByte(); | |
diff --git a/src/share/classes/java/time/chrono/JapaneseDate.java b/src/share/classes/java/time/chrono/JapaneseDate.java | |
--- a/src/share/classes/java/time/chrono/JapaneseDate.java | |
+++ b/src/share/classes/java/time/chrono/JapaneseDate.java | |
@@ -108,7 +108,7 @@ | |
*/ | |
public final class JapaneseDate | |
extends ChronoDateImpl<JapaneseDate> | |
- implements ChronoLocalDate<JapaneseDate>, Serializable { | |
+ implements ChronoLocalDate, Serializable { | |
/** | |
* Serialization version. | |
@@ -448,7 +448,7 @@ | |
// TODO: review other fields, such as WEEK_OF_YEAR | |
return with(isoDate.with(field, newValue)); | |
} | |
- return ChronoLocalDate.super.with(field, newValue); | |
+ return super.with(field, newValue); | |
} | |
/** | |
@@ -578,7 +578,7 @@ | |
} | |
@Override | |
- public Period periodUntil(ChronoLocalDate<?> endDate) { | |
+ public Period periodUntil(ChronoLocalDate endDate) { | |
return isoDate.periodUntil(endDate); | |
} | |
diff --git a/src/share/classes/java/time/chrono/MinguoDate.java b/src/share/classes/java/time/chrono/MinguoDate.java | |
--- a/src/share/classes/java/time/chrono/MinguoDate.java | |
+++ b/src/share/classes/java/time/chrono/MinguoDate.java | |
@@ -96,7 +96,7 @@ | |
*/ | |
public final class MinguoDate | |
extends ChronoDateImpl<MinguoDate> | |
- implements ChronoLocalDate<MinguoDate>, Serializable { | |
+ implements ChronoLocalDate, Serializable { | |
/** | |
* Serialization version. | |
@@ -325,7 +325,7 @@ | |
} | |
return with(isoDate.with(field, newValue)); | |
} | |
- return ChronoLocalDate.super.with(field, newValue); | |
+ return super.with(field, newValue); | |
} | |
/** | |
@@ -419,7 +419,7 @@ | |
} | |
@Override | |
- public Period periodUntil(ChronoLocalDate<?> endDate) { | |
+ public Period periodUntil(ChronoLocalDate endDate) { | |
return isoDate.periodUntil(endDate); | |
} | |
@@ -458,7 +458,7 @@ | |
out.writeByte(get(DAY_OF_MONTH)); | |
} | |
- static ChronoLocalDate<?> readExternal(DataInput in) throws IOException { | |
+ static ChronoLocalDate readExternal(DataInput in) throws IOException { | |
int year = in.readInt(); | |
int month = in.readByte(); | |
int dayOfMonth = in.readByte(); | |
diff --git a/src/share/classes/java/time/chrono/ThaiBuddhistDate.java b/src/share/classes/java/time/chrono/ThaiBuddhistDate.java | |
--- a/src/share/classes/java/time/chrono/ThaiBuddhistDate.java | |
+++ b/src/share/classes/java/time/chrono/ThaiBuddhistDate.java | |
@@ -96,7 +96,7 @@ | |
*/ | |
public final class ThaiBuddhistDate | |
extends ChronoDateImpl<ThaiBuddhistDate> | |
- implements ChronoLocalDate<ThaiBuddhistDate>, Serializable { | |
+ implements ChronoLocalDate, Serializable { | |
/** | |
* Serialization version. | |
@@ -325,7 +325,7 @@ | |
} | |
return with(isoDate.with(field, newValue)); | |
} | |
- return ChronoLocalDate.super.with(field, newValue); | |
+ return super.with(field, newValue); | |
} | |
/** | |
@@ -419,7 +419,7 @@ | |
} | |
@Override | |
- public Period periodUntil(ChronoLocalDate<?> endDate) { | |
+ public Period periodUntil(ChronoLocalDate endDate) { | |
return isoDate.periodUntil(endDate); | |
} | |
diff --git a/src/share/classes/java/time/format/DateTimePrintContext.java b/src/share/classes/java/time/format/DateTimePrintContext.java | |
--- a/src/share/classes/java/time/format/DateTimePrintContext.java | |
+++ b/src/share/classes/java/time/format/DateTimePrintContext.java | |
@@ -157,7 +157,7 @@ | |
} | |
} | |
final ZoneId effectiveZone = (overrideZone != null ? overrideZone : temporalZone); | |
- final ChronoLocalDate<?> effectiveDate; | |
+ final ChronoLocalDate effectiveDate; | |
if (overrideChrono != null) { | |
if (temporal.isSupported(EPOCH_DAY)) { | |
effectiveDate = effectiveChrono.date(temporal); | |
diff --git a/src/share/classes/java/time/format/Parsed.java b/src/share/classes/java/time/format/Parsed.java | |
--- a/src/share/classes/java/time/format/Parsed.java | |
+++ b/src/share/classes/java/time/format/Parsed.java | |
@@ -134,7 +134,7 @@ | |
/** | |
* The resolved date. | |
*/ | |
- private ChronoLocalDate<?> date; | |
+ private ChronoLocalDate date; | |
/** | |
* The resolved time. | |
*/ | |
@@ -288,7 +288,7 @@ | |
updateCheckConflict(chrono.resolveDate(fieldValues)); | |
} | |
- private void updateCheckConflict(ChronoLocalDate<?> cld) { | |
+ private void updateCheckConflict(ChronoLocalDate cld) { | |
if (date != null) { | |
if (cld != null && date.equals(cld) == false) { | |
throw new DateTimeException("Conflict found: Fields resolved to two different dates: " + date + " " + cld); | |
diff --git a/src/share/classes/java/time/temporal/WeekFields.java b/src/share/classes/java/time/temporal/WeekFields.java | |
--- a/src/share/classes/java/time/temporal/WeekFields.java | |
+++ b/src/share/classes/java/time/temporal/WeekFields.java | |
@@ -617,9 +617,9 @@ | |
* @param dow the day of the week | |
* @return a ChronoLocalDate for the requested year, week of year, and day of week | |
*/ | |
- private ChronoLocalDate<?> ofWeekBasedYear(Chronology chrono, | |
+ private ChronoLocalDate ofWeekBasedYear(Chronology chrono, | |
int yowby, int wowby, int dow) { | |
- ChronoLocalDate<?> date = chrono.date(yowby, 1, 1); | |
+ ChronoLocalDate date = chrono.date(yowby, 1, 1); | |
int ldow = localizedDayOfWeek(date); | |
int offset = startOfWeekOffset(1, ldow); | |
@@ -852,7 +852,7 @@ | |
// week-of-week-based-year and year-of-week-based-year | |
int yowby = temporal.get(weekDef.weekBasedYear); | |
int wowby = temporal.get(weekDef.weekOfWeekBasedYear); | |
- ChronoLocalDate<?> date = ofWeekBasedYear(Chronology.from(temporal), yowby, wowby, dow); | |
+ ChronoLocalDate date = ofWeekBasedYear(Chronology.from(temporal), yowby, wowby, dow); | |
Map<TemporalField, Long> result = new HashMap<>(4, 1.0f); | |
result.put(EPOCH_DAY, date.toEpochDay()); | |
diff --git a/test/java/time/tck/java/time/chrono/CopticDate.java b/test/java/time/tck/java/time/chrono/CopticDate.java | |
--- a/test/java/time/tck/java/time/chrono/CopticDate.java | |
+++ b/test/java/time/tck/java/time/chrono/CopticDate.java | |
@@ -87,7 +87,7 @@ | |
* This class is immutable and thread-safe. | |
*/ | |
public final class CopticDate | |
- implements ChronoLocalDate<CopticDate>, Serializable { | |
+ implements ChronoLocalDate, Serializable { | |
/** | |
* Serialization version. | |
@@ -301,7 +301,7 @@ | |
if (endDateTime instanceof ChronoLocalDate == false) { | |
throw new DateTimeException("Unable to calculate period between objects of two different types"); | |
} | |
- ChronoLocalDate<?> end = (ChronoLocalDate<?>) endDateTime; | |
+ ChronoLocalDate end = (ChronoLocalDate) endDateTime; | |
if (getChronology().equals(end.getChronology()) == false) { | |
throw new DateTimeException("Unable to calculate period between two different chronologies"); | |
} | |
@@ -312,7 +312,7 @@ | |
} | |
@Override | |
- public Period periodUntil(ChronoLocalDate<?> endDate) { | |
+ public Period periodUntil(ChronoLocalDate endDate) { | |
// TODO: untested | |
CopticDate end = (CopticDate) getChronology().date(endDate); | |
long totalMonths = (end.prolepticYear - this.prolepticYear) * 13 + (end.month - this.month); // safe | |
diff --git a/test/java/time/tck/java/time/chrono/TCKChronoLocalDate.java b/test/java/time/tck/java/time/chrono/TCKChronoLocalDate.java | |
--- a/test/java/time/tck/java/time/chrono/TCKChronoLocalDate.java | |
+++ b/test/java/time/tck/java/time/chrono/TCKChronoLocalDate.java | |
@@ -113,10 +113,10 @@ | |
@Test(dataProvider="calendars") | |
public void test_badWithAdjusterChrono(Chronology chrono) { | |
LocalDate refDate = LocalDate.of(2013, 1, 1); | |
- ChronoLocalDate<?> date = chrono.date(refDate); | |
+ ChronoLocalDate date = chrono.date(refDate); | |
for (Chronology[] clist : data_of_calendars()) { | |
Chronology chrono2 = clist[0]; | |
- ChronoLocalDate<?> date2 = chrono2.date(refDate); | |
+ ChronoLocalDate date2 = chrono2.date(refDate); | |
TemporalAdjuster adjuster = new FixedAdjuster(date2); | |
if (chrono != chrono2) { | |
try { | |
@@ -127,7 +127,7 @@ | |
} | |
} else { | |
// Same chronology, | |
- ChronoLocalDate<?> result = date.with(adjuster); | |
+ ChronoLocalDate result = date.with(adjuster); | |
assertEquals(result, date2, "WithAdjuster failed to replace date"); | |
} | |
} | |
@@ -136,10 +136,10 @@ | |
@Test(dataProvider="calendars") | |
public void test_badPlusAdjusterChrono(Chronology chrono) { | |
LocalDate refDate = LocalDate.of(2013, 1, 1); | |
- ChronoLocalDate<?> date = chrono.date(refDate); | |
+ ChronoLocalDate date = chrono.date(refDate); | |
for (Chronology[] clist : data_of_calendars()) { | |
Chronology chrono2 = clist[0]; | |
- ChronoLocalDate<?> date2 = chrono2.date(refDate); | |
+ ChronoLocalDate date2 = chrono2.date(refDate); | |
TemporalAmount adjuster = new FixedAdjuster(date2); | |
if (chrono != chrono2) { | |
try { | |
@@ -150,7 +150,7 @@ | |
} | |
} else { | |
// Same chronology, | |
- ChronoLocalDate<?> result = date.plus(adjuster); | |
+ ChronoLocalDate result = date.plus(adjuster); | |
assertEquals(result, date2, "WithAdjuster failed to replace date"); | |
} | |
} | |
@@ -159,10 +159,10 @@ | |
@Test(dataProvider="calendars") | |
public void test_badMinusAdjusterChrono(Chronology chrono) { | |
LocalDate refDate = LocalDate.of(2013, 1, 1); | |
- ChronoLocalDate<?> date = chrono.date(refDate); | |
+ ChronoLocalDate date = chrono.date(refDate); | |
for (Chronology[] clist : data_of_calendars()) { | |
Chronology chrono2 = clist[0]; | |
- ChronoLocalDate<?> date2 = chrono2.date(refDate); | |
+ ChronoLocalDate date2 = chrono2.date(refDate); | |
TemporalAmount adjuster = new FixedAdjuster(date2); | |
if (chrono != chrono2) { | |
try { | |
@@ -173,7 +173,7 @@ | |
} | |
} else { | |
// Same chronology, | |
- ChronoLocalDate<?> result = date.minus(adjuster); | |
+ ChronoLocalDate result = date.minus(adjuster); | |
assertEquals(result, date2, "WithAdjuster failed to replace date"); | |
} | |
} | |
@@ -182,10 +182,10 @@ | |
@Test(dataProvider="calendars") | |
public void test_badPlusTemporalUnitChrono(Chronology chrono) { | |
LocalDate refDate = LocalDate.of(2013, 1, 1); | |
- ChronoLocalDate<?> date = chrono.date(refDate); | |
+ ChronoLocalDate date = chrono.date(refDate); | |
for (Chronology[] clist : data_of_calendars()) { | |
Chronology chrono2 = clist[0]; | |
- ChronoLocalDate<?> date2 = chrono2.date(refDate); | |
+ ChronoLocalDate date2 = chrono2.date(refDate); | |
TemporalUnit adjuster = new FixedTemporalUnit(date2); | |
if (chrono != chrono2) { | |
try { | |
@@ -197,7 +197,7 @@ | |
} | |
} else { | |
// Same chronology, | |
- ChronoLocalDate<?> result = date.plus(1, adjuster); | |
+ ChronoLocalDate result = date.plus(1, adjuster); | |
assertEquals(result, date2, "WithAdjuster failed to replace date"); | |
} | |
} | |
@@ -206,10 +206,10 @@ | |
@Test(dataProvider="calendars") | |
public void test_badMinusTemporalUnitChrono(Chronology chrono) { | |
LocalDate refDate = LocalDate.of(2013, 1, 1); | |
- ChronoLocalDate<?> date = chrono.date(refDate); | |
+ ChronoLocalDate date = chrono.date(refDate); | |
for (Chronology[] clist : data_of_calendars()) { | |
Chronology chrono2 = clist[0]; | |
- ChronoLocalDate<?> date2 = chrono2.date(refDate); | |
+ ChronoLocalDate date2 = chrono2.date(refDate); | |
TemporalUnit adjuster = new FixedTemporalUnit(date2); | |
if (chrono != chrono2) { | |
try { | |
@@ -221,7 +221,7 @@ | |
} | |
} else { | |
// Same chronology, | |
- ChronoLocalDate<?> result = date.minus(1, adjuster); | |
+ ChronoLocalDate result = date.minus(1, adjuster); | |
assertEquals(result, date2, "WithAdjuster failed to replace date"); | |
} | |
} | |
@@ -230,10 +230,10 @@ | |
@Test(dataProvider="calendars") | |
public void test_badTemporalFieldChrono(Chronology chrono) { | |
LocalDate refDate = LocalDate.of(2013, 1, 1); | |
- ChronoLocalDate<?> date = chrono.date(refDate); | |
+ ChronoLocalDate date = chrono.date(refDate); | |
for (Chronology[] clist : data_of_calendars()) { | |
Chronology chrono2 = clist[0]; | |
- ChronoLocalDate<?> date2 = chrono2.date(refDate); | |
+ ChronoLocalDate date2 = chrono2.date(refDate); | |
TemporalField adjuster = new FixedTemporalField(date2); | |
if (chrono != chrono2) { | |
try { | |
@@ -245,7 +245,7 @@ | |
} | |
} else { | |
// Same chronology, | |
- ChronoLocalDate<?> result = date.with(adjuster, 1); | |
+ ChronoLocalDate result = date.with(adjuster, 1); | |
assertEquals(result, date2, "TemporalField doSet failed to replace date"); | |
} | |
} | |
@@ -258,7 +258,7 @@ | |
public void test_date_comparisons(Chronology chrono) { | |
List<ChronoLocalDate> dates = new ArrayList<>(); | |
- ChronoLocalDate<?> date = chrono.date(LocalDate.of(2013, 1, 1)); | |
+ ChronoLocalDate date = chrono.date(LocalDate.of(2013, 1, 1)); | |
// Insert dates in order, no duplicates | |
dates.add(date.minus(1, ChronoUnit.YEARS)); | |
@@ -273,17 +273,17 @@ | |
// Check these dates against the corresponding dates for every calendar | |
for (Chronology[] clist : data_of_calendars()) { | |
- List<ChronoLocalDate<?>> otherDates = new ArrayList<>(); | |
+ List<ChronoLocalDate> otherDates = new ArrayList<>(); | |
Chronology chrono2 = clist[0]; | |
- for (ChronoLocalDate<?> d : dates) { | |
+ for (ChronoLocalDate d : dates) { | |
otherDates.add(chrono2.date(d)); | |
} | |
// Now compare the sequence of original dates with the sequence of converted dates | |
for (int i = 0; i < dates.size(); i++) { | |
- ChronoLocalDate<?> a = dates.get(i); | |
+ ChronoLocalDate a = dates.get(i); | |
for (int j = 0; j < otherDates.size(); j++) { | |
- ChronoLocalDate<?> b = otherDates.get(j); | |
+ ChronoLocalDate b = otherDates.get(j); | |
int cmp = ChronoLocalDate.timeLineOrder().compare(a, b); | |
if (i < j) { | |
assertTrue(cmp < 0, a + " compare " + b); | |
@@ -312,7 +312,7 @@ | |
@Test( dataProvider="calendars") | |
public void test_ChronoSerialization(Chronology chrono) throws Exception { | |
LocalDate ref = LocalDate.of(2013, 1, 5); | |
- ChronoLocalDate<?> orginal = chrono.date(ref); | |
+ ChronoLocalDate orginal = chrono.date(ref); | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
ObjectOutputStream out = new ObjectOutputStream(baos); | |
out.writeObject(orginal); | |
@@ -320,7 +320,7 @@ | |
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); | |
ObjectInputStream in = new ObjectInputStream(bais); | |
@SuppressWarnings("unchecked") | |
- ChronoLocalDate<?> ser = (ChronoLocalDate<?>) in.readObject(); | |
+ ChronoLocalDate ser = (ChronoLocalDate) in.readObject(); | |
assertEquals(ser, orginal, "deserialized date is wrong"); | |
} | |
@@ -328,12 +328,12 @@ | |
@Test(dataProvider="calendars") | |
public void test_from_TemporalAccessor(Chronology chrono) { | |
LocalDate refDate = LocalDate.of(2013, 1, 1); | |
- ChronoLocalDate<?> date = chrono.date(refDate); | |
- ChronoLocalDate<?> test1 = ChronoLocalDate.from(date); | |
+ ChronoLocalDate date = chrono.date(refDate); | |
+ ChronoLocalDate test1 = ChronoLocalDate.from(date); | |
assertEquals(test1, date); | |
- ChronoLocalDate<?> test2 = ChronoLocalDate.from(date.atTime(LocalTime.of(12, 30))); | |
+ ChronoLocalDate test2 = ChronoLocalDate.from(date.atTime(LocalTime.of(12, 30))); | |
assertEquals(test2, date); | |
- ChronoLocalDate<?> test3 = ChronoLocalDate.from(date.atTime(LocalTime.of(12, 30)).atZone(ZoneOffset.UTC)); | |
+ ChronoLocalDate test3 = ChronoLocalDate.from(date.atTime(LocalTime.of(12, 30)).atZone(ZoneOffset.UTC)); | |
assertEquals(test3, date); | |
} | |
diff --git a/test/java/time/tck/java/time/chrono/TCKChronology.java b/test/java/time/tck/java/time/chrono/TCKChronology.java | |
--- a/test/java/time/tck/java/time/chrono/TCKChronology.java | |
+++ b/test/java/time/tck/java/time/chrono/TCKChronology.java | |
@@ -139,9 +139,9 @@ | |
@Test(dataProvider = "calendarNameAndType") | |
public void test_epoch(String name, String alias) { | |
Chronology chrono = Chronology.of(name); // a chronology. In practice this is rarely hardcoded | |
- ChronoLocalDate<?> date1 = chrono.dateNow(); | |
+ ChronoLocalDate date1 = chrono.dateNow(); | |
long epoch1 = date1.getLong(ChronoField.EPOCH_DAY); | |
- ChronoLocalDate<?> date2 = date1.with(ChronoField.EPOCH_DAY, epoch1); | |
+ ChronoLocalDate date2 = date1.with(ChronoField.EPOCH_DAY, epoch1); | |
assertEquals(date1, date2, "Date from epoch day is not same date: " + date1 + " != " + date2); | |
long epoch2 = date1.getLong(ChronoField.EPOCH_DAY); | |
assertEquals(epoch1, epoch2, "Epoch day not the same: " + epoch1 + " != " + epoch2); | |
@@ -150,9 +150,9 @@ | |
@Test(dataProvider = "calendarNameAndType") | |
public void test_dateEpochDay(String name, String alias) { | |
Chronology chrono = Chronology.of(name); | |
- ChronoLocalDate<?> date = chrono.dateNow(); | |
+ ChronoLocalDate date = chrono.dateNow(); | |
long epochDay = date.getLong(ChronoField.EPOCH_DAY); | |
- ChronoLocalDate<?> test = chrono.dateEpochDay(epochDay); | |
+ ChronoLocalDate test = chrono.dateEpochDay(epochDay); | |
assertEquals(test, date); | |
} | |
diff --git a/test/java/time/tck/java/time/chrono/TCKHijrahChronology.java b/test/java/time/tck/java/time/chrono/TCKHijrahChronology.java | |
--- a/test/java/time/tck/java/time/chrono/TCKHijrahChronology.java | |
+++ b/test/java/time/tck/java/time/chrono/TCKHijrahChronology.java | |
@@ -128,17 +128,17 @@ | |
} | |
@Test(dataProvider="samples") | |
- public void test_toLocalDate(ChronoLocalDate<?> hijrahDate, LocalDate iso) { | |
+ public void test_toLocalDate(ChronoLocalDate hijrahDate, LocalDate iso) { | |
assertEquals(LocalDate.from(hijrahDate), iso); | |
} | |
@Test(dataProvider="samples") | |
- public void test_fromCalendrical(ChronoLocalDate<?> hijrahDate, LocalDate iso) { | |
+ public void test_fromCalendrical(ChronoLocalDate hijrahDate, LocalDate iso) { | |
assertEquals(HijrahChronology.INSTANCE.date(iso), hijrahDate); | |
} | |
@Test(dataProvider="samples") | |
- public void test_dayOfWeekEqualIsoDayOfWeek(ChronoLocalDate<?> hijrahDate, LocalDate iso) { | |
+ public void test_dayOfWeekEqualIsoDayOfWeek(ChronoLocalDate hijrahDate, LocalDate iso) { | |
assertEquals(hijrahDate.get(DAY_OF_WEEK), iso.get(DAY_OF_WEEK), "Hijrah day of week should be same as ISO day of week"); | |
} | |
@@ -212,15 +212,15 @@ | |
//----------------------------------------------------------------------- | |
@Test | |
public void test_adjust1() { | |
- ChronoLocalDate<?> base = HijrahChronology.INSTANCE.date(1434, 5, 15); | |
- ChronoLocalDate<?> test = base.with(TemporalAdjuster.lastDayOfMonth()); | |
+ ChronoLocalDate base = HijrahChronology.INSTANCE.date(1434, 5, 15); | |
+ ChronoLocalDate test = base.with(TemporalAdjuster.lastDayOfMonth()); | |
assertEquals(test, HijrahChronology.INSTANCE.date(1434, 5, 29)); | |
} | |
@Test | |
public void test_adjust2() { | |
- ChronoLocalDate<?> base = HijrahChronology.INSTANCE.date(1434, 6, 2); | |
- ChronoLocalDate<?> test = base.with(TemporalAdjuster.lastDayOfMonth()); | |
+ ChronoLocalDate base = HijrahChronology.INSTANCE.date(1434, 6, 2); | |
+ ChronoLocalDate test = base.with(TemporalAdjuster.lastDayOfMonth()); | |
assertEquals(test, HijrahChronology.INSTANCE.date(1434, 6, 30)); | |
} | |
@@ -229,14 +229,14 @@ | |
//----------------------------------------------------------------------- | |
@Test | |
public void test_adjust_toLocalDate() { | |
- ChronoLocalDate<?> hijrahDate = HijrahChronology.INSTANCE.date(1435, 1, 4); | |
- ChronoLocalDate<?> test = hijrahDate.with(LocalDate.of(2012, 7, 6)); | |
+ ChronoLocalDate hijrahDate = HijrahChronology.INSTANCE.date(1435, 1, 4); | |
+ ChronoLocalDate test = hijrahDate.with(LocalDate.of(2012, 7, 6)); | |
assertEquals(test, HijrahChronology.INSTANCE.date(1433, 8, 16)); | |
} | |
@Test(expectedExceptions=DateTimeException.class) | |
public void test_adjust_toMonth() { | |
- ChronoLocalDate<?> hijrahDate = HijrahChronology.INSTANCE.date(1435, 1, 4); | |
+ ChronoLocalDate hijrahDate = HijrahChronology.INSTANCE.date(1435, 1, 4); | |
hijrahDate.with(Month.APRIL); | |
} | |
@@ -245,14 +245,14 @@ | |
//----------------------------------------------------------------------- | |
@Test | |
public void test_LocalDate_adjustToHijrahDate() { | |
- ChronoLocalDate<?> hijrahDate = HijrahChronology.INSTANCE.date(1434, 5, 15); | |
+ ChronoLocalDate hijrahDate = HijrahChronology.INSTANCE.date(1434, 5, 15); | |
LocalDate test = LocalDate.MIN.with(hijrahDate); | |
assertEquals(test, LocalDate.of(2013, 3, 27)); | |
} | |
@Test | |
public void test_LocalDateTime_adjustToHijrahDate() { | |
- ChronoLocalDate<?> hijrahDate = HijrahChronology.INSTANCE.date(1435, 5, 15); | |
+ ChronoLocalDate hijrahDate = HijrahChronology.INSTANCE.date(1435, 5, 15); | |
LocalDateTime test = LocalDateTime.MIN.with(hijrahDate); | |
assertEquals(test, LocalDateTime.of(2014, 3, 16, 0, 0)); | |
} | |
@@ -300,7 +300,7 @@ | |
} | |
@Test(dataProvider="toString") | |
- public void test_toString(ChronoLocalDate<?> hijrahDate, String expected) { | |
+ public void test_toString(ChronoLocalDate hijrahDate, String expected) { | |
assertEquals(hijrahDate.toString(), expected); | |
} | |
diff --git a/test/java/time/test/java/time/chrono/TestChronoLocalDate.java b/test/java/time/test/java/time/chrono/TestChronoLocalDate.java | |
--- a/test/java/time/test/java/time/chrono/TestChronoLocalDate.java | |
+++ b/test/java/time/test/java/time/chrono/TestChronoLocalDate.java | |
@@ -61,6 +61,7 @@ | |
import java.time.LocalDate; | |
import java.time.chrono.ChronoLocalDate; | |
+import java.time.chrono.ChronoLocalDateTime; | |
import java.time.chrono.Chronology; | |
import java.time.chrono.ThaiBuddhistChronology; | |
import java.time.chrono.ThaiBuddhistDate; | |
@@ -80,8 +81,8 @@ | |
//----------------------------------------------------------------------- | |
public void test_date_comparator_checkGenerics_ISO() { | |
- List<ChronoLocalDate<LocalDate>> dates = new ArrayList<>(); | |
- ChronoLocalDate<LocalDate> date = LocalDate.of(2013, 1, 1); | |
+ List<ChronoLocalDate> dates = new ArrayList<>(); | |
+ ChronoLocalDate date = LocalDate.of(2013, 1, 1); | |
// Insert dates in order, no duplicates | |
dates.add(date.minus(10, ChronoUnit.YEARS)); | |
@@ -96,55 +97,7 @@ | |
dates.add(date.plus(1, ChronoUnit.YEARS)); | |
dates.add(date.plus(10, ChronoUnit.YEARS)); | |
- List<ChronoLocalDate<LocalDate>> copy = new ArrayList<>(dates); | |
- Collections.shuffle(copy); | |
- Collections.sort(copy, ChronoLocalDate.timeLineOrder()); | |
- assertEquals(copy, dates); | |
- assertTrue(ChronoLocalDate.timeLineOrder().compare(copy.get(0), copy.get(1)) < 0); | |
- } | |
- | |
- public void test_date_comparator_checkGenerics_unknown() { | |
- List<ChronoLocalDate<?>> dates = new ArrayList<>(); | |
- ChronoLocalDate<?> date = LocalDate.of(2013, 1, 1); | |
- | |
- // Insert dates in order, no duplicates | |
- dates.add(date.minus(10, ChronoUnit.YEARS)); | |
- dates.add(date.minus(1, ChronoUnit.YEARS)); | |
- dates.add(date.minus(1, ChronoUnit.MONTHS)); | |
- dates.add(date.minus(1, ChronoUnit.WEEKS)); | |
- dates.add(date.minus(1, ChronoUnit.DAYS)); | |
- dates.add(date); | |
- dates.add(date.plus(1, ChronoUnit.DAYS)); | |
- dates.add(date.plus(1, ChronoUnit.WEEKS)); | |
- dates.add(date.plus(1, ChronoUnit.MONTHS)); | |
- dates.add(date.plus(1, ChronoUnit.YEARS)); | |
- dates.add(date.plus(10, ChronoUnit.YEARS)); | |
- | |
- List<ChronoLocalDate<?>> copy = new ArrayList<>(dates); | |
- Collections.shuffle(copy); | |
- Collections.sort(copy, ChronoLocalDate.timeLineOrder()); | |
- assertEquals(copy, dates); | |
- assertTrue(ChronoLocalDate.timeLineOrder().compare(copy.get(0), copy.get(1)) < 0); | |
- } | |
- | |
- public <D extends ChronoLocalDate<D>> void test_date_comparator_checkGenerics_unknownExtends() { | |
- List<ChronoLocalDate<D>> dates = new ArrayList<>(); | |
- ChronoLocalDate<D> date = (ChronoLocalDate) LocalDate.of(2013, 1, 1); // TODO generics raw type | |
- | |
- // Insert dates in order, no duplicates | |
- dates.add(date.minus(10, ChronoUnit.YEARS)); | |
- dates.add(date.minus(1, ChronoUnit.YEARS)); | |
- dates.add(date.minus(1, ChronoUnit.MONTHS)); | |
- dates.add(date.minus(1, ChronoUnit.WEEKS)); | |
- dates.add(date.minus(1, ChronoUnit.DAYS)); | |
- dates.add(date); | |
- dates.add(date.plus(1, ChronoUnit.DAYS)); | |
- dates.add(date.plus(1, ChronoUnit.WEEKS)); | |
- dates.add(date.plus(1, ChronoUnit.MONTHS)); | |
- dates.add(date.plus(1, ChronoUnit.YEARS)); | |
- dates.add(date.plus(10, ChronoUnit.YEARS)); | |
- | |
- List<ChronoLocalDate<D>> copy = new ArrayList<>(dates); | |
+ List<ChronoLocalDate> copy = new ArrayList<>(dates); | |
Collections.shuffle(copy); | |
Collections.sort(copy, ChronoLocalDate.timeLineOrder()); | |
assertEquals(copy, dates); | |
@@ -178,13 +131,13 @@ | |
//----------------------------------------------------------------------- | |
public void test_date_checkGenerics_genericsMethod() { | |
Chronology chrono = ThaiBuddhistChronology.INSTANCE; | |
- ChronoLocalDate<?> date = chrono.dateNow(); | |
- // date = processOK(date); // does not compile | |
+ ChronoLocalDate date = chrono.dateNow(); | |
+ date = processOK(date); // does not compile | |
date = processClassOK(ThaiBuddhistDate.class); | |
date = dateSupplier(); | |
- // date = processWeird(date); // does not compile (correct) | |
- // date = processClassWeird(ThaiBuddhistDate.class); // does not compile (correct) | |
+ date = processWeird(date); // does not compile (correct) | |
+ date = processClassWeird(ThaiBuddhistDate.class); // does not compile (correct) | |
} | |
public void test_date_checkGenerics_genericsMethod_concreteType() { | |
@@ -199,7 +152,7 @@ | |
// date = processClassWeird(ThaiBuddhistDate.class); // does not compile (correct) | |
} | |
- public <D extends ChronoLocalDate<D>> void test_date_checkGenerics_genericsMethod_withType() { | |
+ public <D extends ChronoLocalDate> void test_date_checkGenerics_genericsMethod_withType() { | |
Chronology chrono = ThaiBuddhistChronology.INSTANCE; | |
D date = (D) chrono.dateNow(); | |
date = processOK(date); | |
@@ -210,24 +163,39 @@ | |
// date = processClassWeird(ThaiBuddhistDate.class); // does not compile (correct) | |
} | |
- private <D extends ChronoLocalDate<D>> D dateSupplier() { | |
+ private <D extends ChronoLocalDate> D dateSupplier() { | |
return (D) (ChronoLocalDate) ThaiBuddhistChronology.INSTANCE.dateNow(); // TODO raw types | |
} | |
// decent generics signatures that need to work | |
- private <D extends ChronoLocalDate<D>> D processOK(D date) { | |
+ private <D extends ChronoLocalDate> D processOK(D date) { | |
return date; | |
} | |
- private <D extends ChronoLocalDate<D>> D processClassOK(Class<D> cls) { | |
+ private <D extends ChronoLocalDate> D processClassOK(Class<D> cls) { | |
return null; | |
} | |
// weird generics signatures that shouldn't really work | |
- private <D extends ChronoLocalDate<D>> ChronoLocalDate<D> processWeird(ChronoLocalDate<D> date) { | |
+ private <D extends ChronoLocalDate> ChronoLocalDate processWeird(ChronoLocalDate date) { | |
return date; | |
} | |
- private <D extends ChronoLocalDate<D>> ChronoLocalDate<D> processClassWeird(Class<D> cls) { | |
+ private <D extends ChronoLocalDate> ChronoLocalDate processClassWeird(Class<D> cls) { | |
return null; | |
} | |
+ public void test_date_checkGenerics_chronoLocalDateTime1() { | |
+ Chronology chrono = ThaiBuddhistChronology.INSTANCE; | |
+ ChronoLocalDateTime<?> ldt = chrono.localDateTime(null); | |
+ ldt = processCLDT(ldt); | |
+ } | |
+ | |
+ public void test_date_checkGenerics_chronoLocalDateTime2() { | |
+ Chronology chrono = ThaiBuddhistChronology.INSTANCE; | |
+ ChronoLocalDateTime<? extends ChronoLocalDate> ldt = chrono.localDateTime(null); | |
+ ldt = processCLDT(ldt); | |
+ } | |
+ | |
+ private <D extends ChronoLocalDate> ChronoLocalDateTime<D> processCLDT(ChronoLocalDateTime<D> dt) { | |
+ return dt; | |
+ } | |
} | |
diff --git a/test/java/time/test/java/time/chrono/TestExampleCode.java b/test/java/time/test/java/time/chrono/TestExampleCode.java | |
--- a/test/java/time/test/java/time/chrono/TestExampleCode.java | |
+++ b/test/java/time/test/java/time/chrono/TestExampleCode.java | |
@@ -82,7 +82,7 @@ | |
@Test | |
public void test_chronoPackageExample() { | |
// Print the Thai Buddhist date | |
- ChronoLocalDate<?> now1 = Chronology.of("ThaiBuddhist").dateNow(); | |
+ ChronoLocalDate now1 = Chronology.of("ThaiBuddhist").dateNow(); | |
int day = now1.get(ChronoField.DAY_OF_MONTH); | |
int dow = now1.get(ChronoField.DAY_OF_WEEK); | |
int month = now1.get(ChronoField.MONTH_OF_YEAR); | |
@@ -93,15 +93,15 @@ | |
// Enumerate the list of available calendars and print today for each | |
Set<Chronology> chronos = Chronology.getAvailableChronologies(); | |
for (Chronology chrono : chronos) { | |
- ChronoLocalDate<?> date = chrono.dateNow(); | |
+ ChronoLocalDate date = chrono.dateNow(); | |
System.out.printf(" %20s: %s%n", chrono.getId(), date.toString()); | |
} | |
// Print today's date and the last day of the year for the Thai Buddhist Calendar. | |
- ChronoLocalDate<?> first = now1 | |
+ ChronoLocalDate first = now1 | |
.with(ChronoField.DAY_OF_MONTH, 1) | |
.with(ChronoField.MONTH_OF_YEAR, 1); | |
- ChronoLocalDate<?> last = first | |
+ ChronoLocalDate last = first | |
.plus(1, ChronoUnit.YEARS) | |
.minus(1, ChronoUnit.DAYS); | |
System.out.printf(" %s: 1st of year: %s; end of year: %s%n", last.getChronology().getId(), | |
@@ -138,7 +138,7 @@ | |
// Enumerate the list of available calendars and print today for each | |
Set<Chronology> chronos = Chronology.getAvailableChronologies(); | |
for (Chronology chrono : chronos) { | |
- ChronoLocalDate<?> date = chrono.dateNow(); | |
+ ChronoLocalDate date = chrono.dateNow(); | |
System.out.printf(" %20s: %s%n", chrono.getId(), date.toString()); | |
} | |
@@ -176,8 +176,8 @@ | |
* @param date a specific date extending ChronoLocalDate | |
* @return a new date in the same chronology. | |
*/ | |
- private <D extends ChronoLocalDate<D>> D next(D date) { | |
- return date.plus(1, ChronoUnit.DAYS); | |
+ private <D extends ChronoLocalDate> D next(D date) { | |
+ return (D) date.plus(1, ChronoUnit.DAYS); | |
} | |
/** | |
@@ -187,7 +187,7 @@ | |
* @param date a specific date extending ChronoLocalDate | |
* @return a [@code ChronoLocalDateTime<D>} using the change chronology. | |
*/ | |
- private <D extends ChronoLocalDate<D>> ChronoLocalDateTime<D> tomorrowNoon(D date) { | |
+ private <D extends ChronoLocalDate> ChronoLocalDateTime<D> tomorrowNoon(D date) { | |
return date.plus(1, ChronoUnit.DAYS).atTime(LocalTime.of(12, 0)); | |
} | |
} | |
diff --git a/test/java/time/test/java/time/format/TestNonIsoFormatter.java b/test/java/time/test/java/time/format/TestNonIsoFormatter.java | |
--- a/test/java/time/test/java/time/format/TestNonIsoFormatter.java | |
+++ b/test/java/time/test/java/time/format/TestNonIsoFormatter.java | |
@@ -125,7 +125,7 @@ | |
@Test(dataProvider="format_data") | |
public void test_formatLocalizedDate(Chronology chrono, Locale formatLocale, Locale numberingLocale, | |
- ChronoLocalDate<?> date, String expected) { | |
+ ChronoLocalDate date, String expected) { | |
DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) | |
.withChronology(chrono).withLocale(formatLocale) | |
.withSymbols(DateTimeFormatSymbols.of(numberingLocale)); | |
@@ -135,12 +135,12 @@ | |
@Test(dataProvider="format_data") | |
public void test_parseLocalizedText(Chronology chrono, Locale formatLocale, Locale numberingLocale, | |
- ChronoLocalDate<?> expected, String text) { | |
+ ChronoLocalDate expected, String text) { | |
DateTimeFormatter dtf = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL) | |
.withChronology(chrono).withLocale(formatLocale) | |
.withSymbols(DateTimeFormatSymbols.of(numberingLocale)); | |
TemporalAccessor temporal = dtf.parse(text); | |
- ChronoLocalDate<?> date = chrono.date(temporal); | |
+ ChronoLocalDate date = chrono.date(temporal); | |
assertEquals(date, expected); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment