This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 137310

Summary: Catch all exceptions that can be thrown from JDI calls.
Product: debugger Reporter: Martin Entlicher <mentlicher>
Component: JavaAssignee: Martin Entlicher <mentlicher>
Status: VERIFIED FIXED    
Severity: blocker Keywords: PLAN
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:

Description Martin Entlicher 2008-06-16 14:02:43 UTC
There is a very poor documentation of which exceptions are actually thrown from which JDI method.

We need to put try/catch block around every JDI call and catch the errors. It looks like the errors are better
documented in the description of JDWP protocol -
http://java.sun.com/javase/6/docs/platform/jpda/jdwp/jdwp-protocol.html. This can provide hints on which exceptions are
thrown from corresponding JDI methods.
Comment 1 Martin Entlicher 2008-12-10 16:50:12 UTC
Scheduling for 7.0.
The intended implementation of this is to generate wrappers for JDI methods and checked wrapper exceptions.
Every method should clearly specify what exception can be thrown from it and the code needs to catch these exceptions.

JDI methods should not be called directly, but only through the wrappers. This will prevent from unexpected exceptions.
Also, the wrappers can automatically catch pathological exceptions, like InternalErrors, which do occur, sometimes.
Comment 2 Martin Entlicher 2008-12-15 07:44:22 UTC
InternalExceptions can be handled more gracefully - see e.g. issue #54624.
Comment 3 Martin Entlicher 2008-12-20 08:17:07 UTC
Wrappers for JDI methods are generated, they throw checked exceptions that must be caught in the code. All class to JDI
are rewritten to use the wrapper methods in debugger.jpda module:

http://hg.netbeans.org/main/rev/ce0f62c27784
http://hg.netbeans.org/main/rev/3390b1db7b95
http://hg.netbeans.org/main/rev/da5914cb240b
http://hg.netbeans.org/main/rev/6380978bfeff
Comment 4 Quality Engineering 2008-12-23 17:09:41 UTC
Integrated into 'main-golden', will be available in build *200812231401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ce0f62c27784
User: mentlicher@netbeans.org
Log: #137310 - Added class generating wrappers of all JDI methods. These wrappers should catch exceptions thrown from JDI calls.
Comment 5 Filip Zamboj 2009-02-16 13:26:45 UTC
this issue has been verified recently. Appears as fixed.