mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8372555: Test com/sun/jdi/ExceptionEvents.java failed: ObjectCollectedException
Reviewed-by: amenkov, dholmes
This commit is contained in:
parent
ed5fc9ad2d
commit
ac81ce51fa
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -355,7 +355,16 @@ public class ExceptionEvents extends TestScaffold {
|
||||
if (event.request() == request) {
|
||||
try {
|
||||
System.out.print("ExceptionEvent: ");
|
||||
System.out.print("" + event.exception().referenceType().name());
|
||||
try {
|
||||
System.out.print("" + event.exception().referenceType().name());
|
||||
} catch (ObjectCollectedException e) {
|
||||
if (event.request().suspendPolicy() == EventRequest.SUSPEND_NONE) {
|
||||
// Since the thread was not suspended, the exception object can be collected.
|
||||
System.out.print("<exception object collected>");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
Location loc = event.location();
|
||||
System.out.print(" @ " + loc.method().name());
|
||||
System.out.print(":" + loc.lineNumber());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user