Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v4]

2024-11-02 Thread Mandy Chung
On Sat, 2 Nov 2024 00:32:49 GMT, Chen Liang wrote: >> In the patch for [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) >> #20665, the validation methods `validateBinaryClassName` and >> `validateInternalClassName` only checks if a separator char is the initial >> or final char, or i

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v3]

2024-11-01 Thread Chen Liang
On Sat, 2 Nov 2024 00:27:52 GMT, Mandy Chung wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reuse the check implementation > > src/java.base/share/classes/jdk/internal/constant/ConstantUtils.java line 191: > >> 189

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v3]

2024-11-01 Thread Mandy Chung
On Sat, 2 Nov 2024 00:16:41 GMT, Chen Liang wrote: >> In the patch for [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) >> #20665, the validation methods `validateBinaryClassName` and >> `validateInternalClassName` only checks if a separator char is the initial >> or final char, or i

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v4]

2024-11-01 Thread Chen Liang
> In the patch for [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) > #20665, the validation methods `validateBinaryClassName` and > `validateInternalClassName` only checks if a separator char is the initial or > final char, or if it immediately follows another chars. This omitted the

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v2]

2024-11-01 Thread Mandy Chung
On Fri, 1 Nov 2024 23:57:20 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/constant/ConstantUtils.java line >> 258: >> >>> 256: if (name.isEmpty()) >>> 257: return name; >>> 258: return validateBinaryClassName(name); >> >> Perhaps have a utility

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v3]

2024-11-01 Thread Chen Liang
> In the patch for [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) > #20665, the validation methods `validateBinaryClassName` and > `validateInternalClassName` only checks if a separator char is the initial or > final char, or if it immediately follows another chars. This omitted the

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v2]

2024-11-01 Thread Chen Liang
On Fri, 1 Nov 2024 21:32:23 GMT, Mandy Chung wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Comments to clarify, also align skipOverFieldSignature > > src/java.base/share/classes/jdk/internal/constant/ConstantUtils.

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v2]

2024-11-01 Thread Mandy Chung
On Fri, 1 Nov 2024 19:24:05 GMT, Chen Liang wrote: >> In the patch for [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) >> #20665, the validation methods `validateBinaryClassName` and >> `validateInternalClassName` only checks if a separator char is the initial >> or final char, or i

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names [v2]

2024-11-01 Thread Chen Liang
> In the patch for [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) > #20665, the validation methods `validateBinaryClassName` and > `validateInternalClassName` only checks if a separator char is the initial or > final char, or if it immediately follows another chars. This omitted the

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names

2024-11-01 Thread Chen Liang
On Fri, 1 Nov 2024 17:36:01 GMT, Mandy Chung wrote: > With your proposed change, all validations are done by > `validateBinaryClassName`? Yes. Now all validations are done by that and `validateInternalClassName`, which uses the `/` separator instead of the `.` separator char. Meanwhile, the

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names

2024-11-01 Thread Mandy Chung
On Fri, 1 Nov 2024 17:28:28 GMT, Chen Liang wrote: > Before 8338544, the binary/internal name validation was partial. It missed a > few validations performed by `skipOverFieldSignature`: no empty strings, > leading or trailing or consecutive separator chars. In 8338544, the empty > string vali

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names

2024-11-01 Thread Chen Liang
On Fri, 1 Nov 2024 13:58:01 GMT, Chen Liang wrote: > An oversight in the patch for > [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) #20665 caused > `ClassDesc` to incorrectly accept empty strings as binary names, so erroneous > calls `ClassDesc.of("")` and `ClassDesc.ofInternalName

Re: RFR: 8343437: ClassDesc.of incorrectly permitting empty names

2024-11-01 Thread Mandy Chung
On Fri, 1 Nov 2024 13:58:01 GMT, Chen Liang wrote: > An oversight in the patch for > [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) #20665 caused > `ClassDesc` to incorrectly accept empty strings as binary names. This patch > fixes that problem, and unifies the checks for package

RFR: 8343437: ClassDesc.of incorrectly permitting empty names

2024-11-01 Thread Chen Liang
An oversight in the patch for [JDK-8338544](https://bugs.openjdk.org/browse/JDK-8338544) #20665 caused `ClassDesc` to incorrectly accept empty strings as binary names. This patch fixes that problem, and unifies the checks for package and class nominal descriptors. - Commit messag