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 231036

Summary: [OQL] instance field named "map" cannot be displayed
Product: profiler Reporter: Tomas Hurka <thurka>
Component: BaseAssignee: Tomas Hurka <thurka>
Status: RESOLVED FIXED    
Severity: normal Keywords: VISUALVM
Priority: P3    
Version: 7.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Tomas Hurka 2013-06-10 13:51:18 UTC
I have an object with an attribute named map. This attribute appears correctly when I open the object that has it in the Instances view, but when I go to "OQL Console" it gives me a "{}" string.

The class I have is:

public class TestBean {

    private Map map = new HashMap();
    
    public void add(String key, Object value) {
        map.put(key,value);
    }
}

and when I try to see the map attribute using OQL:

var obj = heap.findObject('0x15669a08');
obj.map;


The value displayed is:

{

}

After I changed the attribute name to "map2" it worked:

var obj = heap.findObject('0x15669a08');
obj.map2;

the result was:

java.util.HashMap#251


The same happens if I try:

select x.map from my.pkg.TestBean x
Comment 1 Tomas Hurka 2013-06-11 08:55:07 UTC
Fixed in profiler-main

changeset:   255535:16dc4cfc77fc
user:        Tomas Hurka <thurka@netbeans.org>
date:        Tue Jun 11 10:52:49 2013 +0200
summary:     bugfix #231036, prefix field name with '_$' to avaid name clash with internal Array representation
Comment 2 Quality Engineering 2013-06-12 02:01:07 UTC
Integrated into 'main-golden', will be available in build *201306112301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/16dc4cfc77fc
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #231036, prefix field name with '_$' to avaid name clash with internal Array representation