RFR: 8354327: Rewrite runtime/LoadClass/LoadClassNegative.java

Anton Artemov duke at openjdk.org
Thu Apr 17 16:30:11 UTC 2025


On Wed, 16 Apr 2025 13:25:56 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:

>> Rewrote the test  runtime/LoadClass/LoadClassNegative so that it creates a dummy jar file on the fly and then removes it. Previously existing dummy.jar removed.
>
> test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java line 43:
> 
>> 41: 
>> 42:   public static void main(String args[]) throws Exception {
>> 43:     final String filename =  System.getProperty("test.src") + File.separator + "dummy.jar";
> 
> Please use the scratch directory for the temporary file creation. 
> https://openjdk.org/jtreg/faq.html#scratch-directory

I have addressed it in the latest commit.

> test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java line 44:
> 
>> 42:   public static void main(String args[]) throws Exception {
>> 43:     final String filename =  System.getProperty("test.src") + File.separator + "dummy.jar";
>> 44:     String bootCP = "-Xbootclasspath/a:" + filename;
> 
> I'd move it under line 48, closer to the place where it's used. I think the code will be easier to read this way, it took me a few read throughs to realise that this is related to line 51, and not to any of the lines before. 
> What do you think?

In the latest commit I have re-organized the code a bit, it is now clear and easy to read.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24688#discussion_r2047087071
PR Review Comment: https://git.openjdk.org/jdk/pull/24688#discussion_r2047098184


More information about the hotspot-runtime-dev mailing list