File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
test/hotspot/jtreg/vmTestbase/nsk/jdb/kill/kill001 Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2002, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2002, 2024 , 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
@@ -141,6 +141,16 @@ public MyThread(String n, Throwable e) {
141141 expectedException = e ;
142142 }
143143
144+
145+ static public int [] trash ;
146+
147+ void methodForException () {
148+ trash = new int [10 ];
149+ for (int i = 0 ; ;i ++) {
150+ trash [i % trash .length ] = i ;
151+ }
152+ }
153+
144154 public void run () {
145155 // Concatenate strings in advance to avoid lambda calculations later
146156 String ThreadFinished = "Thread finished: " + this .name ;
@@ -156,8 +166,9 @@ public void run() {
156166 try {
157167 synchronized (kill001a .lock ) { }
158168 // We need some code that does an invoke here to make sure the async exception
159- // gets thrown before we leave the try block. Printing a log message works well.
160- kill001a .log .display ("exited synchronized" );
169+ // gets thrown before we leave the try block.
170+ // The methodForException should work until exception is thrown.
171+ methodForException ();
161172 } catch (Throwable t ) {
162173 if (t == expectedException ) {
163174 kill001a .log .display (CaughtExpected );
You can’t perform that action at this time.
0 commit comments