Summary
Update the byteValue
and shortValue
methods of the abstract class java.lang.Number
to use @implSpec
tags.
Problem
The implementation of "default" methods in interfaces and abstract classes are best captured in @implSpec
tags. The byteValue
and shortValue
methods would benefit from those tags.
Solution
Change existing implementation requirements to @implSpec
tags.
Specification
--- a/src/java.base/share/classes/java/lang/Number.java
+++ b/src/java.base/share/classes/java/lang/Number.java
@@ -93,7 +93,8 @@ public abstract class Number implements java.io.Serializable {
/**
* Returns the value of the specified number as a {@code byte}.
*
- * <p>This implementation returns the result of {@link #intValue} cast
+ * @implSpec
+ * The default implementation returns the result of {@link #intValue} cast
* to a {@code byte}.
*
* @return the numeric value represented by this object after conversion
@@ -107,7 +108,8 @@ public abstract class Number implements java.io.Serializable {
/**
* Returns the value of the specified number as a {@code short}.
*
- * <p>This implementation returns the result of {@link #intValue} cast
+ * @implSpec
+ * The default implementation returns the result of {@link #intValue} cast
* to a {@code short}.
*
* @return the numeric value represented by this object after conversion
- csr of
-
JDK-8264609 Number.{byteValue, shortValue} spec should use @implSpec
-
- Resolved
-