< prev index next >

src/java.base/share/classes/java/time/LocalTime.java

Print this page
@@ -111,22 +111,30 @@
   * The ISO-8601 calendar system is the modern civil calendar system used today
   * in most of the world. This API assumes that all calendar systems use the same
   * representation, this class, for time-of-day.
   * <p>
   * This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
-  * class; programmers should treat instances that are
-  * {@linkplain #equals(Object) equal} as interchangeable and should not
-  * use instances for synchronization, or unpredictable behavior may
-  * occur. For example, in a future release, synchronization may fail.
-  * The {@code equals} method should be used for comparisons.
+  * class; programmers should treat instances that are {@linkplain #equals(Object) equal}
+  * as interchangeable and should not use instances for synchronization, mutexes, or
+  * with {@linkplain java.lang.ref.Reference object references}.
+  *
+  * <div class="preview-block">
+  *      <div class="preview-comment">
+  *          When preview features are enabled, {@code LocalTime} is a {@linkplain Class#isValue value class}.
+  *          Use of value class instances for synchronization, mutexes, or with
+  *          {@linkplain java.lang.ref.Reference object references} result in
+  *          {@link IdentityException}.
+  *      </div>
+  * </div>
   *
   * @implSpec
   * This class is immutable and thread-safe.
   *
   * @since 1.8
   */
  @jdk.internal.ValueBased
+ @jdk.internal.MigratedValueClass
  public final class LocalTime
          implements Temporal, TemporalAdjuster, Comparable<LocalTime>, Serializable {
  
      /**
       * The minimum supported {@code LocalTime}, '00:00'.
< prev index next >