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 224871 - Variables window shows stale info for "this" but refreshed info for locals.
Summary: Variables window shows stale info for "this" but refreshed info for locals.
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: RANDOM
: 224199 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-01-14 20:10 UTC by swpalmer
Modified: 2013-08-30 16:04 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (242.99 KB, text/plain)
2013-01-14 20:10 UTC, swpalmer
Details
My test project (18.60 KB, application/zip)
2013-01-15 16:26 UTC, Martin Entlicher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2013-01-14 20:10:52 UTC
Product Version = NetBeans IDE 7.3 RC1 (Build 201301102100)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0_10
Runtime = Java HotSpot(TM) Client VM 23.6-b04

Consider a class with these members:

class ValueWrapper {
private String displayName;
private String value;

String getDisplayNameOrValue() {
	String v = getDisplayName();
	if (v == null)
		v = getValue();
	return v;
}
// assume trivial getters/setters for DisplayName and Value
}

I set a breakpoint on the if (v == null) line, when I hit it and look at the variables window it shows me that v="ABCDEF", but it also shows me that this.displayName = "somethingElse" and this.value = "something other". In other words it is a combination that is impossible.
The call to getDisplayNameOrValue() is called in a loop as I process  a list of items of this class.  As I continue and hit the break point each time the local variable 'v' is updated for the new item, but "this" does not update .  It shows the value for the "this" reference the same, e.g.  "#12345", each time through the loop, yet the local variable is correctly updated to the values that come from the real object.
Comment 1 swpalmer 2013-01-14 20:10:57 UTC
Created attachment 130207 [details]
IDE log
Comment 2 Martin Entlicher 2013-01-15 16:26:09 UTC
Created attachment 130247 [details]
My test project

Unfortunately, I was not able to reproduce this.
I've tested this by the attached project.
I've submitted breakpoint to line 55, started the debugger, expanded "this" in Variables window and then I was pressing Continue and watching the values.
It was consistent all the time.
Comment 3 Martin Entlicher 2013-01-15 16:30:09 UTC
This is similar to issue #224199, so maybe it is some random problem?
Did you use standard Java project?
Comment 4 swpalmer 2013-01-15 21:06:10 UTC
I was debugging a Maven project.
Comment 5 Martin Entlicher 2013-01-16 16:11:22 UTC
I've tested the same in a Maven project.

Most probably this is a random bug, changing to P3.
Comment 6 Jiri Kovalsky 2013-01-16 16:48:08 UTC
I have also tested this in a Maven project and I didn't observe any anomaly.

Product Version: NetBeans IDE 7.3 RC1 (Build 201301152100)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b15
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/7.3rc1
Cache directory: /home/cesilko/.cache/netbeans/7.3rc1
Comment 7 Martin Entlicher 2013-01-24 10:16:18 UTC
*** Bug 224199 has been marked as a duplicate of this bug. ***
Comment 8 Martin Entlicher 2013-08-30 16:04:55 UTC
It should be fixed by http://hg.netbeans.org/main-silver/rev/5e1125ae174b