Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8029551

Add value-type notice to java.time classes

    XMLWordPrintable

Details

    • 8
    • b122
    • Verified

    Backports

      Description

        The JSR 310 EG is adopting the value-type language defined by the Lambda Expert Group.
        This language reinforces the definition of value-types and correct usage with respect to object identity.

        "This is a <a href="{@docRoot}/java/lang/doc-files/ValueBased.html">value-based</a>
         class; use of identity-sensitive operations (including reference equality
         ({@code ==}), identity hash code, or synchronization) on instances of
         {@code this class} may have unpredictable results and should be avoided."

        The classes with this behavior are:
         - LocalDate, LocalTime, LocalDateTime, ZonedDateTime
         - OffsetTime, OffsetDateTime
         - JapaneseDate, MinguoDate, HijrahDate, ThaiBuddhist
         - Instant, Duration, Period
         - MonthDay, YearMonth, Year
         - ZoneId, ZoneOffset

        Attachments

          Issue Links

            Activity

              People

                rriggs Roger Riggs
                rriggs Roger Riggs
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: