Skip to content

Commit 6fac8b3

Browse files
committed
8354327: Rewrite runtime/LoadClass/LoadClassNegative.java
Backport-of: a2f9c248447d2840d191366cead1ba474ed9a15a
1 parent 8da01d7 commit 6fac8b3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

test/hotspot/jtreg/runtime/LoadClass/LoadClassNegative.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -40,8 +40,15 @@
4040
public class LoadClassNegative {
4141

4242
public static void main(String args[]) throws Exception {
43-
String bootCP = "-Xbootclasspath/a:" + System.getProperty("test.src")
44-
+ File.separator + "dummy.jar";
43+
44+
// Create an empty file in the scratch directory
45+
final String filename = "empty.jar";
46+
File emptyJar = new File(filename);
47+
emptyJar.createNewFile();
48+
49+
// Explicitly tell to use it for class loading
50+
String bootCP = "-Xbootclasspath/a:" + emptyJar.getAbsolutePath();
51+
4552
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
4653
bootCP,
4754
"TestForName");

test/hotspot/jtreg/runtime/LoadClass/dummy.jar

Whitespace-only changes.

0 commit comments

Comments
 (0)