Integrated: 8334742: Change java.time month/day field types to 'byte'

Gautham Krishnan duke at openjdk.org
Wed May 28 15:40:57 UTC 2025


On Wed, 30 Apr 2025 20:30:59 GMT, Gautham Krishnan <duke at openjdk.org> wrote:

> In the following classes, month and day values are stored in fields of type 'int' or 'short'. The range of allowed values is small enough that the type can be 'byte' instead.
> 
> java.time.YearMonth
> java.time.MonthDay
> java.time.LocalDate
> java.time.chono.HijrahDate
> 
> Refactoring the type will give the JVM a little more layout flexibility, and will be especially useful when these classes become value classes.

This pull request has now been integrated.

Changeset: 4ced4e73
Author:    gauthamkrishnanibm <gautham.k at ibm.com>
Committer: Roger Riggs <rriggs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/4ced4e73fc0a517df826860839681004bb67e624
Stats:     17 lines in 4 files changed: 0 ins; 0 del; 17 mod

8334742: Change java.time month/day field types to 'byte'

Reviewed-by: rriggs

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

PR: https://git.openjdk.org/jdk/pull/24975


More information about the core-libs-dev mailing list