RFR: 8358729: jdk/internal/loader/URLClassPath/ClassnameCharTest.java depends on Applet [v5]
Johannes Döbler
duke at openjdk.org
Fri Jun 13 19:26:38 UTC 2025
On Fri, 13 Jun 2025 17:47:16 GMT, Justin Lu <jlu at openjdk.org> 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:
>
> Address review - Convert to JUnit, correct comment typo, remove 'Infra' methods
test/jdk/jdk/internal/loader/URLClassPath/ClassnameCharTest.java line 57:
> 55: static void setup() throws IOException {
> 56: var bytes = ClassFile.of().build(ClassDesc.of("fo o"), _ -> {});
> 57: try (JarOutputStream jos = new JarOutputStream(new FileOutputStream(JAR_PATH.toFile()))) {
Suggestion: The original test used testclasses.jar to provide two class files with invalid names packaged in a jar. Since you now dynamically construct the class files, there is no need to write them to disk as a jar. Why not have a Map<String,bytes[]), mapping a resource path to bytes, to store all used class files in memory.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25703#discussion_r2145924359
More information about the core-libs-dev
mailing list