Summary
Mark some ClassDesc methods, whose implementations are now specialized into subclasses in the sealed hierarchy, as abstract.
Problem
ClassDesc is getting specific implementations; some previous default implementations are better converted to non-concrete abstract methods and be overridden in implementations instead.
The implementation specification of displayName
is no longer applicable to non-default methods.
Solution
Make these methods in ClassDesc
abstract (non-default):
arrayType()
arrayType(int)
displayName()
For displayName()
, promote the implementation specification to the API specification. There are other inconsistencies in this API method, but we decide to address such issues in another RFE and its dedicated CSR instead of here.
Specification
- default ClassDesc arrayType() {
+ ClassDesc arrayType() {
- default ClassDesc arrayType(int rank) {
+ ClassDesc arrayType(int rank) {
- * Returns a human-readable name for the type described by this descriptor.
- *
- * @implSpec
- * <p>The default implementation returns the simple name
- * (e.g., {@code int}) for primitive types, the unqualified class name
- * for class or interface types, or the display name of the component type
- * suffixed with the appropriate number of {@code []} pairs for array types.
- *
- * @return the human-readable name
+ * {@return a human-readable name for this {@code ClassDesc}}
+ * For primitive types, this method returns the simple name (such as {@code int}).
+ * For class or interface types, this method returns the unqualified class name.
+ * For array types, this method returns the human-readable name of the component
+ * type suffixed with the appropriate number of {@code []} pairs.
*/
- default String displayName() {
+ String displayName() {
- csr of
-
JDK-8338544 Dedicated Array class descriptor implementation
- Resolved