On Wed, 11 Jun 2025 22:40:43 GMT, Justin Lu <[email protected]> wrote:
>> Please review this PR which finishes Applet removal for the test:
>> jdk/internal/loader/URLClassPath/ClassnameCharTest.java.
>>
>> `testclasses.jar` is updated such that the two classes no longer extend
>> Applet.
>>
>>
>> $ javap fo\ o.class
>> public class fo o {
>> }
>> $ javap æ$'\302\211'$'\302\213'å$'\302\206'$'\302\214'.class
>> public class 手册 {
>> }
>>
>>
>> The bug description of
>> [JDK-8358729](https://bugs.openjdk.org/browse/JDK-8358729) contains the
>> original `javap` output for those classes.
>>
>> Additionally, the security APIs that were marked for removal are also
>> removed from this test as well.
>
> Justin Lu has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Jai's review - dynamically create jar file
test/jdk/jdk/internal/loader/URLClassPath/ClassnameCharTest.java line 46:
> 44:
> 45: public class ClassnameCharTest {
> 46: private static final String JAR_PATH = Utils.TEST_CLASSES +
> Utils.FILE_SEPARATOR + "testclasses.jar";
I think it would be better to use `java.nio.file.Path` which is like:
private static final Path JAR_PATH = Path.of(".").resolve("testclasses.jar");
That way we don't have to reference the `Utils.TEST_CLASSES`. `Path.of(".")`
will end up being the scratch directory of the test so jtreg can then retain
this JAR file if the test fails for any reason.
test/jdk/jdk/internal/loader/URLClassPath/ClassnameCharTest.java line 47:
> 45: public class ClassnameCharTest {
> 46: private static final String JAR_PATH = Utils.TEST_CLASSES +
> Utils.FILE_SEPARATOR + "testclasses.jar";
> 47: static File classesJar = new File(JAR_PATH);
If we switch to using `Path` for `JAR_PATH`, like I suggest above, then we can
get rid of this field altogether and at the call site, we can just to
`JAR_PATH.toFile()` if we want to have a `File` instance corresponding to that
`Path`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25703#discussion_r2143030617
PR Review Comment: https://git.openjdk.org/jdk/pull/25703#discussion_r2143032390