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

Add value-type notice to java.time classes

    Details

    • Subcomponent:
    • Introduced In Version:
      8
    • Resolved In Build:
      b122
    • Verification:
      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

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: