Skip to content

Commit dd7ea34

Browse files
committed
8304696: Duplicate class names in dynamicArchive tests can lead to test failure
Backport-of: b2240bf870cd57983fda0bc3b0e205acfdd1fd2a
1 parent ddc909d commit dd7ea34

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LinkClassTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2023, 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
@@ -31,7 +31,7 @@
3131
* /test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes
3232
* @build LinkClassApp
3333
* @build jdk.test.whitebox.WhiteBox
34-
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar link_class_app.jar LinkClassApp Parent Child Parent2 Child2 MyShutdown
34+
* @run driver jdk.test.lib.helpers.ClassFileInstaller -jar link_class_app.jar LinkClassApp Parent Child Parent2 Child2 LinkClassApp$MyShutdown
3535
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
3636
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. LinkClassTest
3737
*/

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/LinkClassApp.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2023, 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
@@ -46,13 +46,13 @@ class Child2 extends Parent2 {
4646
int get() {return 4;}
4747
}
4848

49-
class MyShutdown extends Thread{
50-
public void run(){
51-
System.out.println("shut down hook invoked...");
49+
class LinkClassApp {
50+
static class MyShutdown extends Thread{
51+
public void run(){
52+
System.out.println("shut down hook invoked...");
53+
}
5254
}
53-
}
5455

55-
class LinkClassApp {
5656
public static void main(String args[]) {
5757
Runtime r=Runtime.getRuntime();
5858
r.addShutdownHook(new MyShutdown());

0 commit comments

Comments
 (0)