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 67730 - Cannot step in debugger after NullPointerException
Summary: Cannot step in debugger after NullPointerException
Status: CLOSED WONTFIX
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 5.x
Hardware: All Windows ME/2000
: P1 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-28 14:22 UTC by tboerkel
Modified: 2010-04-29 09:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tboerkel 2005-10-28 14:22:44 UTC
After one NullPointerException occurs, NB cannot step anymore. F8 results in
continue instead of step. This happens in NB 4.1 and 5.0 with JDK 5.0_04 and 5.0_05.

Repro:

    String accs;
    String[] accArray;
    for(int n = 0; n < 20; n++) {
      try {
        accs = null;
        accArray = accs.split(",", -1);
      } catch(Throwable t) {
        t.printStackTrace();
      } finally {
      }
    }    

Put this in a main method, set breakpoint on line "accs = null;" and start in
debugger. First time it stops, you can do one step, then the NPE happens and
then you can't step anymore (you cannot step into the catch and you cannot step
from the breakpoint to the next line). F8 always continues the program.
Comment 1 Martin Entlicher 2005-10-31 09:16:58 UTC
Reproduced. We'll check the behavior of JDI to see where the problem really is...
Comment 2 Maros Sandor 2005-11-02 11:32:59 UTC
I think the root cause may be the same as in Issue #50315.
Comment 3 Roman Ondruska 2005-11-02 16:21:32 UTC
I am able to reproduce it with Java 1.4.2_07. This issue is caused by some bug
in JDI, which is already fixed in JDK 1.6 (not reproducible in the test-case
with java 1.6).
Comment 4 tboerkel 2005-11-02 16:46:54 UTC
Sorry, I have to reopen that issue, even if it is a JDK bug. You cannot leave NB
users without a workaround or something until JDK 6.0!
As far as I know, Eclipse does not suffer from the JDK bug. That does not mean,
that it is not possible that NB does, but it means, there should be some
solution other than waiting for JDK 6.0 for NB users.
Otherwise this just adds to the reasons to choose Eclipse over NB for some people.
Comment 5 Roman Ondruska 2005-11-02 17:01:24 UTC
The same problem in Eclipse 3.0 ...
Comment 6 tboerkel 2005-11-03 09:07:31 UTC
You're right. Same in Eclipse 3.1.0. No workaround possible in NB?
Comment 7 Roman Ondruska 2005-11-03 14:50:57 UTC
Probably caused by JDI issue #6181784. To be sure I filed a new JDK bug with the
repro above for duplicate--verification.

I am afraid there is no workaround on the client side. NB is JDI client and
fully depends on JDI step events. After NPE occurs in debuggee step requests are
ignored -> step request resumes VM

The issue is also reproducible in Eclipse and other debuggers. 

Comment 8 tboerkel 2005-11-04 06:36:10 UTC
Maybe you can convince the JDK folks to put the fix not only in JDK 6.0, but
also in JDK 5.0_06 or _07?
Comment 9 Roman Ondruska 2005-11-04 10:04:57 UTC
I will try ... ;-)
Comment 10 Quality Engineering 2010-04-29 09:26:53 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.