RFR: 8337838: Remove unused methods from ChronoLocalDateImpl

Roger Riggs rriggs at openjdk.org
Wed Aug 7 13:38:32 UTC 2024


On Fri, 19 Jul 2024 09:52:50 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> A few methods in `java.time.chrono.ChronoLocalDateImpl` are unused and could be removed:
> 1. plusWeeks(long)
> 2. minusYears(long)
> 3. minusMonths(long)
> 4. minusWeeks(long)
> 5. minusDays(long)
> 
> Tested `test/jdk/java/time` on Linux x64 release

The implementations, in the subclasses too, were there to match the similar methods in LocalDate. 
At one point in the API development they were visible and had been included in the ChronoLocalDate interface. 
Simplification prevailed.  7-day weeks are ubiquitous in the supported calendars but since no-one has missed these methods they are unneeded.
I agree with Stephen in retaining plusWeeks and its use in the implementation of plus(long, unit).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20250#issuecomment-2273493709


More information about the core-libs-dev mailing list