RFR: JDK-8215510: j.l.c.ClassDesc is accepting descriptors not allowed by the spec
John Rose
john.r.rose at oracle.com
Wed Jan 9 22:04:49 UTC 2019
Nice work. A couple of small points:
A qualified class name is one that has a package prefix.
So it is surprising that verifyUnqualifiedClassName allows
a package prefix. Maybe it needs a different name.
The testing looks adequate, but you might consider using
a little combinatorial code to generate bad and good class
names. Such code could be shared between the unit
tests that test x.y names and Lx/y; names.
Something like:
char goodsep = '.' or '/';
ArrayList<String> badnames, goodnames; …
goodnames.addAll(goodunqnames);
badnames.addAll(badunqnames);
for (int i = 0; i < 2; i++) {
for (String pkg : badpkgnames) {
…prepend pkg+goodsep to each badnames and goodnames and add to badnames...
}
for (char sep : "./;[".toCharArray()) {
for (String pkg : goodpkgnames) {
if (sep == goodsep)
…prepend pkg+sep to each goodnames and add to goodnames…
else
…prepend pkg+sep to each goodnames and add to badnames…
}
…prepend sep to each goodnames and add to badnames…
…appendpend sep to each goodnames and add to badnames…
}
return List.of(badnames, goodnames); // return for use in unit test
> On Jan 7, 2019, at 10:17 AM, Vicente Romero <vicente.romero at oracle.com> wrote:
>
> I have updated the webrev after additional feedback from the TCK tester please check last version at [1]
>
> Thanks,
> Vicente
>
> [1] http://cr.openjdk.java.net/~vromero/8215510/webrev.01
>
>
> On 1/3/19 12:21 PM, Vicente Romero wrote:
>> Please review the fix for bug [1] at [2]. Basically the constants API introduced as part of JEP-334 [3] were accepting descriptors and class names not allowed by the spec. This implementation fixes several issues found by TCK tests on JEP-334,
>>
>> Thanks,
>> Vicente
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8215510
>> [2] http://cr.openjdk.java.net/~vromero/8215510/webrev.00/
>> [3] https://bugs.openjdk.java.net/browse/JDK-8203252
>
More information about the core-libs-dev
mailing list