RFR: 8368050: Validation missing in ClassFile signature factories [v5]

Chen Liang liach at openjdk.org
Fri Sep 19 23:07:16 UTC 2025


On Fri, 19 Sep 2025 07:14:52 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   More fixes
>
> src/java.base/share/classes/java/lang/classfile/Signature.java line 230:
> 
>> 228:         public static ClassTypeSig of(ClassTypeSig outerType, String className, TypeArg... typeArgs) {
>> 229:             requireNonNull(className);
>> 230:             return new SignaturesImpl.ClassTypeSigImpl(Optional.ofNullable(outerType), className.replace(".", "/"), List.of(typeArgs));
> 
> We should declare that the method does not accept binary class names, If we remove the conversion.
> And that seems to be a significant compatibility change.

Yes, this spec links to "identifiers" which explicitly rejects dots. Added this risk in the CSR. I think we should be fine here.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27380#discussion_r2364766451


More information about the core-libs-dev mailing list