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 104269

Summary: [heapwalker] Fields view cannot work with not initialized fields
Product: debugger Reporter: ehucka <ehucka>
Component: CodeAssignee: Martin Entlicher <mentlicher>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description ehucka 2007-05-18 13:41:39 UTC
NetBeans IDE Dev (Build 200705161800)
1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
Linux version 2.6.16-1.2122_FC5 running on i386
en_US (nb); UTF-8

I put a breakpoint at the start of initComponents method of some Frame generated
by form. After debugger stopped there I invoked Show Instances from Classes view
for the Frame. Its fields like panels and buttons are null but fields view shows
some values (#1, #2 ...) for them. After I tried to browse the fields content
some of them throw exception, some of them show their static fields. Show
Instances of such field shows some different instance of the same type.

I think there should be 'null' in Value column for the fields and Show Instances
should be disabled for them.

The exception:
com.sun.jdi.ClassNotPreparedException
        at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:33)
        at com.sun.tools.jdi.ReferenceTypeImpl.fields(ReferenceTypeImpl.java:296)
        at
com.sun.tools.jdi.ReferenceTypeImpl.addAllFields(ReferenceTypeImpl.java:406)
        at com.sun.tools.jdi.ReferenceTypeImpl.allFields(ReferenceTypeImpl.java:420)
        at
org.netbeans.modules.debugger.jpda.models.JPDAClassTypeImpl.staticFields(JPDAClassTypeImpl.java:123)
        at
org.netbeans.modules.debugger.jpda.heapwalk.JavaClassImpl.getStaticFieldValues(JavaClassImpl.java:119)
        at
org.netbeans.modules.debugger.jpda.heapwalk.InstanceImpl.getStaticFieldValues(InstanceImpl.java:144)
        at
org.netbeans.modules.profiler.heapwalk.model.ObjectNode$1.computeChildren(ObjectNode.java:65)
        at
org.netbeans.modules.profiler.heapwalk.model.BrowserUtils$1$1.run(BrowserUtils.java:102)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
Comment 1 Martin Entlicher 2007-05-18 14:36:50 UTC
Reproduced.
This is strange, Local Variables shows null correctly, but not the heap walker.
Comment 2 Martin Entlicher 2007-05-24 15:42:16 UTC
The null values were not treated correctly. This is fixed now:

/cvs/debuggerjpda/profiler/heapwalk/src/org/netbeans/modules/debugger/jpda/heapwalk/InstanceImpl.java,v
 <--  InstanceImpl.java
new revision: 1.5; previous revision: 1.4

/cvs/debuggerjpda/profiler/heapwalk/src/org/netbeans/modules/debugger/jpda/heapwalk/JavaClassImpl.java,v
 <--  JavaClassImpl.java
new revision: 1.8; previous revision: 1.7
Comment 3 ehucka 2007-06-05 13:46:44 UTC
verified