When events are requested with suspend policy of SUSPEND_NONE, it is possible that objects and classes referenced in the event will be garbage collected in the target VM before the event is built on the front end. When that happens today, the EventQueue.remove() method aborts with an ObjectCollectedException. This is not very helpful because there is no information given about the event in question even though some information is available. A better approach would be to construct the event as much as possible. Once the event object is returned from EventSet.remove(), it is reasonable to throw ObjectCollectedException for any query that depends on a now-collected object. All other information is now available (e.g. the event type).
- relates to
-
JDK-4252008 JDI: internal threads should be more robust on some exceptions
-
- Closed
-