On Mon, 6 May 2024 15:18:17 GMT, Claes Redestad <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/constant/ClassDesc.java line 222:
>>
>>> 220: }
>>> 221: if (desc.length() == 1 && desc.charAt(0) == 'V') {
>>> 222: throw new IllegalArgumentException(String.format("not a
>>> valid reference type descriptor: %sV", "[".repeat(rank)));
>>
>> Suggestion:
>>
>> throw new IllegalArgumentException(String.format("not a valid
>> reference type descriptor: %sV", "[".repeat(netRank)));
>>
>> Or should we override this in `PrimitiveClassDescImpl`, which can bypass the
>> rank sum computation?
>
> `currentDepth` must be 0 in this case, so `rank` or `netRank` doesn't matter.
> Overriding in `PrimitiveClassDescImpl` sounds reasonable, but then perhaps
> default method should be removed, too, since it would look strange to have
> the default method be specialized for instance/array types. Sounds like a CSR
> might be needed(?), so let's do that in a follow up.
I don’t think a **CSR** is needed for changing the `default`ness of JDK‑sealed
interface methods, as source and binary compatibility for external users is
unaffected.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19105#discussion_r1592783700