File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2001, 2023 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2001, 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
@@ -355,7 +355,16 @@ public void exceptionThrown(ExceptionEvent event) {
355355 if (event .request () == request ) {
356356 try {
357357 System .out .print ("ExceptionEvent: " );
358- System .out .print ("" + event .exception ().referenceType ().name ());
358+ try {
359+ System .out .print ("" + event .exception ().referenceType ().name ());
360+ } catch (ObjectCollectedException e ) {
361+ if (event .request ().suspendPolicy () == EventRequest .SUSPEND_NONE ) {
362+ // Since the thread was not suspended, the exception object can be collected.
363+ System .out .print ("<exception object collected>" );
364+ } else {
365+ throw e ;
366+ }
367+ }
359368 Location loc = event .location ();
360369 System .out .print (" @ " + loc .method ().name ());
361370 System .out .print (":" + loc .lineNumber ());
You can’t perform that action at this time.
0 commit comments