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 41338 - Watch experession is evaluated more than once
Summary: Watch experession is evaluated more than once
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@debugger
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2004-03-25 10:09 UTC by _ lcincura
Modified: 2006-03-24 10:04 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 _ lcincura 2004-03-25 10:09:42 UTC
Consider the code:
int i=0;
for (int j=0; j < 100; j++) {
    System.out.println(i);
}
Put breakpoint onto line with System.out... and 
debug the code. 0 is written in output, try 
continue action several times just to be sure.
Now create new watch with watch expression i++. 
Invoke continue -> 3 is written into output. 
Next continue -> 6 is written... 9, 11, 13, 15. 
Also the number of evaluations changes!

In NB3.6 it produced 0,0...,0,1,2,3... as output.
Comment 1 Maros Sandor 2004-05-10 15:18:02 UTC
This has been fixed already. There is a minor change in the new 
expression evaluator: ++,-- and assignment operators never change 
values of their operand variables during watch evaluation.
Comment 2 _ lcincura 2004-07-22 11:46:13 UTC
Verified on build 200407201800
Comment 3 _ lcincura 2004-10-26 18:15:57 UTC
It is there again, but in some other scenario.

Consider code
for (int i=0; i<10; i++) {
    hmap.put(""+i, i+".item");
}

Put breakpoint somwhere after the code and make debugger to hit it.
Now create watch with expression hmap.put("6", "test") => the watch
has value "test", which means it was evaluated more than once (first
evaluation would return "6.item" and it works in NB3.6)

Comment 4 Jan Jancura 2005-02-16 09:53:58 UTC
fixed in trunk
Comment 5 _ lcincura 2005-07-12 16:11:12 UTC
Verified in 4.2 build 200507061800