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 147897 - object reference is not correct in Instance View
Summary: object reference is not correct in Instance View
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-22 16:03 UTC by Masaki Katakai
Modified: 2008-09-26 03:42 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 Masaki Katakai 2008-09-22 16:03:15 UTC
Product Version: NetBeans IDE Dev (Build 200809211401)
Java: 1.6.0

This issue was blogged in http://d.hatena.ne.jp/nowokay/20080827 (But it's Japanese)

It seems that there is a bug in NetBeans debugger that it can not display
object reference properly on Instance View. Please try the following steps.
Actually I'm also seeing the same behavior. Please evaluate.

1. Start NB
2. Create a Java project and prepare the following main class

public class ReferenceSample {
    static class A{}
    static A a = new A();
    static class B{
        A af = a;
    }
    static class C extends B{}
    public static void main(String[] args){
        B b = new B();
        C c = new C();
        System.out.println("" + b + c);
    }
}

3. Set profile point on the following line and set taking heap dump.

        System.out.println("" + b + c);

   http://f.hatena.ne.jp/images/fotolife/n/nowokay/20080828/20080828004111.png

4. Run the project and browse the instance of class A.
   It shows there are 3 references.

   http://f.hatena.ne.jp/images/fotolife/n/nowokay/20080828/20080828004112.png

5. set a break point instead.

   http://f.hatena.ne.jp/images/fotolife/n/nowokay/20080828/20080828004113.png

6. open "Loaded Classes" window in debug window and double click on class A to open "Instance View"

   In References window, it shows only A and B, there is no C reference.

   http://f.hatena.ne.jp/images/fotolife/n/nowokay/20080828/20080828004114.png
Comment 1 Martin Entlicher 2008-09-22 16:26:47 UTC
Reproduced.

We display what we get from JDI API. IMHO this is a defect in JDI or debugger backend.
I'll submit a defect for JDK if it is so.
Comment 2 Martin Entlicher 2008-09-23 11:08:51 UTC
It's actually a bug in NetBeans, JDI returns correct results.
Comment 3 Masaki Katakai 2008-09-23 11:17:35 UTC
Thank you for evaluation, mentlicher! It's good news if we have a fix for 6.5.
Comment 4 Martin Entlicher 2008-09-23 14:48:09 UTC
It's fixed in changeset:   103417:6e661b665d46
http://hg.netbeans.org/main/rev/6e661b665d46
Comment 5 Quality Engineering 2008-09-24 05:59:06 UTC
Integrated into 'main-golden', will be available in build *200809240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6e661b665d46
User: mentlicher@netbeans.org
Log: #147897 - Show all referring objects. Go through instance fields, inherited fields and static fields.
Comment 6 Masaki Katakai 2008-09-26 03:42:57 UTC
verified on build 200809241401.

Great!