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 171169 - [67cat] Wrong value in "Variables"
Summary: [67cat] Wrong value in "Variables"
Status: CLOSED WONTFIX
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-31 13:23 UTC by ulfzibis
Modified: 2010-04-29 11:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Before Step over (144.75 KB, image/png)
2009-08-31 13:25 UTC, ulfzibis
Details
After Step over (142.92 KB, image/png)
2009-08-31 13:25 UTC, ulfzibis
Details
Project (17.10 KB, application/x-compressed)
2009-08-31 13:33 UTC, ulfzibis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2009-08-31 13:23:38 UTC
[ JDK VERSION : 1.6.* ]

See attachments...
   Variable "result" should change to "next line not empty".


Additionally wrong sources were choosen on default, so I had to
choose JDK1.7.0/src.zip manually.
Comment 1 ulfzibis 2009-08-31 13:25:01 UTC
Created attachment 86848 [details]
Before Step over
Comment 2 ulfzibis 2009-08-31 13:25:54 UTC
Created attachment 86849 [details]
After Step over
Comment 3 Martin Entlicher 2009-08-31 13:32:42 UTC
Was NoSuchElementException thrown or not? We have to know this in order to evaluate this behavior.
Comment 4 ulfzibis 2009-08-31 13:33:42 UTC
Created attachment 86850 [details]
Project
Comment 5 Martin Entlicher 2009-08-31 13:35:18 UTC
I guess that NoSuchElementException was not thrown, because we do not see "nsee" listed in Variables in the first
screenshot. Therefore I guess that the behavior is O.K.
Comment 6 ulfzibis 2009-08-31 13:44:00 UTC
How can I know this, than by seeing, that debugger jumps into catch block?
Program behaves as it have been thrown, because scanner didn't skip anything, but who knows, because I have written this
test, because java.util.Scanner is buggy (see Sun Review ID: 1599796).

You can try it yourself using attached project.

Using NetBeans IDE 6.7.1, Java_only.
Comment 7 ulfzibis 2009-08-31 13:48:27 UTC
Regarding other issue, some NetBeans engineer told me, that only used variables become visible, but nsee is not used here.
Comment 8 Martin Entlicher 2009-08-31 13:59:01 UTC
I've tried the attached project.
NoSuchElementException is NOT thrown. Therefore there's no reason for "result" to change.
I agree that the stepping is confusing here, but this is not a problem of NetBeans. It's a compiler issue - see e.g.
http://bugs.sun.com/view_bug.do?bug_id=6765597.

"...some NetBeans engineer told me, that only used variables become visible, but nsee is not used here."

It's determined by compiler. It's true that unused variables are not usually visible until they are used, because
compiler does not generate them. But here the "nsee" variable is created in the catch block regardless of if it's used
or not.
If you step through lines 77, 78, you'll see the "nsee" variable in Variables window. But you will not see "nsee" when
stepping through lines 92, 93, because there's no exception thrown.
Comment 9 Martin Entlicher 2009-08-31 14:01:10 UTC
I completely agree with you, that the stepping is terrible, but there's nothing I can do with it. It needs to be fixed
in javac.
Comment 10 ulfzibis 2009-08-31 21:51:41 UTC
> I completely agree with you, that the stepping is terrible, but there's nothing I can do with it.
I guess, NetBeans can "see", that no exception was thrown and catched. So couldn't you let NetBeans step visually in the
right line?

> It needs to be fixed in javac.
Could you file a suitable bug against javac?
Comment 11 ulfzibis 2009-09-01 11:43:46 UTC
If this is not a bug, my last suggestions should be treated as RFE.
Comment 12 Martin Entlicher 2009-09-01 13:24:42 UTC
We had also issue #168365 for this problem. I'll add further comments to http://bugs.sun.com/view_bug.do?bug_id=6765597,
we can try to increase the priority...
I will not hack it in NetBeans. NetBeans debugger already have enough hacks and this would be quite complex. In general
you'd need to analyze every condition and try/catch block to know where the step belongs. This is really too much. It
must be much much much simpler to correct this in javac.

It's a defect, but will not be fixed in NetBeans.
Comment 13 ulfzibis 2009-09-01 13:49:22 UTC
> I'll add further comments to http://bugs.sun.com/view_bug.do?bug_id=6765597, we can try to increase the priority...

I have voted for this bug. You can do too, using: http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6765597
Comment 14 Martin Entlicher 2009-09-01 16:09:16 UTC
I've added a vote and I've also increased the priority and added some comments. This will take some time to process so
it's not yet visible on the bug page.
Comment 15 Quality Engineering 2010-04-29 11:16:42 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.