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 168365 - debugger show wrong line during step
Summary: debugger show wrong line during step
Status: CLOSED WONTFIX
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: issues@debugger
URL:
Keywords:
: 174325 175933 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-09 18:06 UTC by emiddio
Modified: 2010-04-29 11:16 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 emiddio 2009-07-09 18:06:10 UTC
i have 2 code samples from a twitter rest client app that while stepping thru would not show correct line in debugger;
i was able to fix the stepping by modifying 2 lines in the code; the samples follow:

the just below code will step to the updates++ line when the "if" fails -- rather than the bottom "}";

if the 2 "//" lines just below the "if" are uncommented the indicated stepping is correct;
--------------------------------
for (StatusBean us : updatedStatusList) {
            if (!statusList.contains(us)) {
                //String s = String.format("%s (%d), at: %s:\n %s\n", us.user.name, us.id, us.createdAt, us.text);
                //System.out.print(s);
                System.out.print(String.format("\033[1;34m%s\033[0m (\033[1;31m%d\033[0m), at: \033[1;34m%s\033[0m:\n 
%s\n", us.user.name, us.id, us.createdAt, us.text));
                statusList.add(us);
/*indicates*/   updates++;              
            }
}
-----------------------


somehow the line :

System.out.print(String.format("\033[1;34m%s\033[0m (\033[1;31m%d\033[0m), at: \033[1;34m%s\033[0m:\n %s\n", 
us.user.name, us.id, us.createdAt, us.text));

--alone without the 2 lines above it which decompose the line into 2 statements messes up the debugger stepping;
the line is longer than what fits in the source window's width -- in case this somehow matters
Comment 1 Martin Entlicher 2009-07-09 21:02:44 UTC
This is a compiler issue, NetBeans can not do anything about it.
Debugger is stepping to lines which javac defines.

I'll submit this as a defect of JDK compiler if it is not there already...
Comment 2 ulfzibis 2009-09-01 13:53:14 UTC
We can try to increase the priority...

If you feel to, just vote, using: http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6765597
Comment 3 Martin Entlicher 2009-09-01 16:10:32 UTC
Just to mention it here as well, defect http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6765597 was submitted for this
problem.
Comment 4 Daniel Prusa 2009-10-12 08:53:27 UTC
*** Issue 174325 has been marked as a duplicate of this issue. ***
Comment 5 Daniel Prusa 2009-11-02 13:23:02 UTC
*** Issue 175933 has been marked as a duplicate of this issue. ***
Comment 6 Quality Engineering 2010-04-29 11:16:41 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.