Define a JDK-internal annotation, jdk.internal.ValueBased, which indicates that a class or interface is value-based, per:
https://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html
Apply the annotation wherever existing documentation references ValueBased.html, including:
- The primitive wrapper classes in java.lang;
- The class java.lang.Runtime.Version;
- The "optional" classes in java.util: Optional, OptionalInt, OptionalLong, and OptionalDouble;
- Many classes in the java.time API: Instant, LocalDate, LocalTime, LocalDateTime, ZonedDateTime, ZoneId, OffsetTime, OffsetDateTime, ZoneOffset, Duration, Period, Year, YearMonth, and MonthDay, and, in java.time.chrono: MinguoDate, HijrahDate, JapaneseDate, and ThaiBuddhistDate;
- The interface java.lang.ProcessHandle and its implementation classes;
- The implementation classes of the collection factories in java.util: List.of, List.copyOf, Set.of, Set.copyOf, Map.of, Map.copyOf, Map.ofEntries, and Map.entry;
- [ Removed from JEP 390] - All subinterfaces and implementation classes—other than java.lang.String—of java.lang.constant.ConstantDesc, including ClassDesc, MethodTypeDesc, MethodHandleDesc, DirectMethodHandleDesc, DynamicCallSiteDesc, and DynamicConstantDesc, and the classes java.lang.Enum.EnumDesc and java.lang.invoke.VarHandle.VarHandleDesc;
- [ Removed from JEP 390] - The value-based classes in the jdk.incubator.foreign module
https://docs.oracle.com/javase/8/docs/api/java/lang/doc-files/ValueBased.html
Apply the annotation wherever existing documentation references ValueBased.html, including:
- The primitive wrapper classes in java.lang;
- The class java.lang.Runtime.Version;
- The "optional" classes in java.util: Optional, OptionalInt, OptionalLong, and OptionalDouble;
- Many classes in the java.time API: Instant, LocalDate, LocalTime, LocalDateTime, ZonedDateTime, ZoneId, OffsetTime, OffsetDateTime, ZoneOffset, Duration, Period, Year, YearMonth, and MonthDay, and, in java.time.chrono: MinguoDate, HijrahDate, JapaneseDate, and ThaiBuddhistDate;
- The interface java.lang.ProcessHandle and its implementation classes;
- The implementation classes of the collection factories in java.util: List.of, List.copyOf, Set.of, Set.copyOf, Map.of, Map.copyOf, Map.ofEntries, and Map.entry;
- [ Removed from JEP 390] - All subinterfaces and implementation classes—other than java.lang.String—of java.lang.constant.ConstantDesc, including ClassDesc, MethodTypeDesc, MethodHandleDesc, DirectMethodHandleDesc, DynamicCallSiteDesc, and DynamicConstantDesc, and the classes java.lang.Enum.EnumDesc and java.lang.invoke.VarHandle.VarHandleDesc;
- [ Removed from JEP 390] - The value-based classes in the jdk.incubator.foreign module
- blocks
-
JDK-8249100 JEP 390: Warnings for Value-Based Classes
- Closed
- duplicates
-
JDK-8203690 Identify and annotate value based classes with @ValueBased
- Closed
- relates to
-
JDK-8257845 Integrate JEP 390
- Resolved
-
JDK-8256663 [test] Deprecated use of new Double in jshell ImportTest
- Resolved
-
JDK-8252183 [JEP 390] Add 'lint' warning for @ValueBased classes
- Resolved
-
JDK-8257027 [JEP 390] Diagnose synchronization on @ValueBased classes
- Resolved
(1 relates to, 2 links to)