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.

View | Details | Raw Unified | Return to bug 100047
Collapse All | Expand All

(-)apichanges.xml (+41 lines)
Lines 489-494 Link Here
489
        <class package="org.netbeans.spi.debugger.jpda" name="EditorContext" />
489
        <class package="org.netbeans.spi.debugger.jpda" name="EditorContext" />
490
        <issue number="99257"/>
490
        <issue number="99257"/>
491
    </change>
491
    </change>
492
    <change>
493
        <api name="JPDADebuggerAPI"/>
494
        <summary>Support for heap walking.</summary>
495
        <version major="2" minor="11"/>
496
        <date day="5" month="4" year="2007"/>
497
        <author login="mentlicher"/>
498
        <compatibility addition="yes" source="compatible" binary="compatible"/>
499
        <description>
500
            <p>
501
                In order to be able to provide heap walking functionality,
502
                we need methods for retrieval of class instances and
503
                back references.
504
            </p>
505
            <p>
506
                Added methods:<br/>
507
                <code>Field.getDeclaringClass()</code>,
508
                <code>JPDAClassType.getClassLoader()</code>,
509
                <code>JPDAClassType.getSuperClass()</code>,
510
                <code>JPDAClassType.getInstanceCount()</code>,
511
                <code>JPDAClassType.getInstances()</code>,
512
                <code>JPDADebugger.canGetInstanceInfo()</code>,
513
                <code>JPDADebugger.getAllClasses()</code>,
514
                <code>JPDADebugger.getClassesByName()</code>,
515
                <code>JPDADebugger.getInstanceCounts()</code>,
516
                <code>ObjectVariable.getReferringObjects()</code>,
517
                <code>ObjectVariable.getClassType()</code>,
518
                <code>ObjectVariable.getUniqueID()</code>.
519
            </p>
520
            <p>
521
                Added classes:<br/>
522
                <code>VariableType</code>,
523
                <code>JPDAArrayType</code>.
524
            </p>
525
        </description>
526
        <class package="org.netbeans.spi.debugger.jpda" name="JPDADebugger" />
527
        <class package="org.netbeans.spi.debugger.jpda" name="JPDAClassType" />
528
        <class package="org.netbeans.spi.debugger.jpda" name="ObjectVariable" />
529
        <class package="org.netbeans.spi.debugger.jpda" name="VariableType" />
530
        <class package="org.netbeans.spi.debugger.jpda" name="JPDAArrayType" />
531
        <issue number="100047"/>
532
    </change>
492
533
493
534
494
</changes>
535
</changes>
(-)manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.api.debugger.jpda/2
2
OpenIDE-Module: org.netbeans.api.debugger.jpda/2
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/debugger/jpda/Bundle.properties
4
OpenIDE-Module-Specification-Version: 2.10
4
OpenIDE-Module-Specification-Version: 2.11
5
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
5
OpenIDE-Module-Package-Dependencies: com.sun.jdi[VirtualMachineManager]
6
6
(-)src/org/netbeans/api/debugger/jpda/Field.java (-1 / +7 lines)
Lines 13-19 Link Here
13
 * "Portions Copyrighted [year] [name of copyright owner]"
13
 * "Portions Copyrighted [year] [name of copyright owner]"
14
 *
14
 *
15
 * The Original Software is NetBeans. The Initial Developer of the Original
15
 * The Original Software is NetBeans. The Initial Developer of the Original
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17
 * Microsystems, Inc. All Rights Reserved.
17
 * Microsystems, Inc. All Rights Reserved.
18
 */
18
 */
19
19
Lines 48-53 Link Here
48
     * @return name of enclosing class
48
     * @return name of enclosing class
49
     */
49
     */
50
    public abstract String getClassName ();
50
    public abstract String getClassName ();
51
    
52
    /**
53
     * Get the class type in which this field was declared.
54
     * @return the class type
55
     */
56
    public abstract JPDAClassType getDeclaringClass();
51
57
52
    /**
58
    /**
53
     * Declared type of this field.
59
     * Declared type of this field.
(-)src/org/netbeans/api/debugger/jpda/JPDAClassType.java (-14 / +32 lines)
Lines 13-19 Link Here
13
 * "Portions Copyrighted [year] [name of copyright owner]"
13
 * "Portions Copyrighted [year] [name of copyright owner]"
14
 *
14
 *
15
 * The Original Software is NetBeans. The Initial Developer of the Original
15
 * The Original Software is NetBeans. The Initial Developer of the Original
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17
 * Microsystems, Inc. All Rights Reserved.
17
 * Microsystems, Inc. All Rights Reserved.
18
 */
18
 */
19
19
Lines 35-53 Link Here
35
 *
35
 *
36
 * @author Martin Entlicher
36
 * @author Martin Entlicher
37
 */
37
 */
38
public interface JPDAClassType {
38
public interface JPDAClassType extends VariableType {
39
    
40
    /*
41
    List<ObjectVariable> instances(long maxInstances);
42
    
43
    long instanceCount();
44
     */
45
    
46
    /**
47
     * Get the name of this type.
48
     * @return fully qualified name of this type.
49
     */
50
    String getName();
51
    
39
    
52
    /**
40
    /**
53
     * Get the source name of this type.
41
     * Get the source name of this type.
Lines 62-71 Link Here
62
    ClassVariable classObject();
50
    ClassVariable classObject();
63
    
51
    
64
    /**
52
    /**
53
     * Gets the classloader object which loaded the class corresponding to this type.
54
     * @return an object variable representing the classloader, or <code>null</code>
55
     *         if the class was loaded through the bootstrap class loader.
56
     */
57
    ObjectVariable getClassLoader();
58
    
59
    /**
60
     * Gets the superclass of this class.
61
     * @return the superclass of this class in the debuggee, or <code>null</code>
62
     *         if no such class exists.
63
     */
64
    Super getSuperClass();
65
    
66
    /**
65
     * Provide a list of static fields declared in this type.
67
     * Provide a list of static fields declared in this type.
66
     * @return the list of {@link org.netbeans.api.debugger.jpda.Field} objects
68
     * @return the list of {@link org.netbeans.api.debugger.jpda.Field} objects
67
     *         representing static fields.
69
     *         representing static fields.
68
     */
70
     */
69
    List<Field> staticFields();
71
    List<Field> staticFields();
72
    
73
    /**
74
     * Retrieves the number of instances this class.
75
     * Use {@link JPDADebugger#canGetInstanceInfo} to determine if this operation is supported.
76
     * @return the number of instances.
77
     */
78
    long getInstanceCount() throws UnsupportedOperationException;
79
    
80
    /**
81
     * Returns instances of this class type. Only instances that are reachable
82
     * for the purposes of garbage collection are returned.
83
     * Use {@link JPDADebugger#canGetInstanceInfo} to determine if this operation is supported.
84
     * @param maxInstances the maximum number of instances to return. Must be non-negative. If zero, all instances are returned.
85
     * @return a List of object variables.
86
     */
87
    List<ObjectVariable> getInstances(long maxInstances) throws UnsupportedOperationException;
70
    
88
    
71
}
89
}
(-)src/org/netbeans/api/debugger/jpda/JPDADebugger.java (-1 / +43 lines)
Lines 13-19 Link Here
13
 * "Portions Copyrighted [year] [name of copyright owner]"
13
 * "Portions Copyrighted [year] [name of copyright owner]"
14
 *
14
 *
15
 * The Original Software is NetBeans. The Initial Developer of the Original
15
 * The Original Software is NetBeans. The Initial Developer of the Original
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17
 * Microsystems, Inc. All Rights Reserved.
17
 * Microsystems, Inc. All Rights Reserved.
18
 */
18
 */
19
19
Lines 30-35 Link Here
30
import java.beans.PropertyChangeListener;
30
import java.beans.PropertyChangeListener;
31
import java.io.File;
31
import java.io.File;
32
import java.io.IOException;
32
import java.io.IOException;
33
import java.util.Collections;
33
import java.util.Iterator;
34
import java.util.Iterator;
34
import java.util.List;
35
import java.util.List;
35
import java.util.Map;
36
import java.util.Map;
Lines 431-434 Link Here
431
    public JPDAStep createJPDAStep(int size, int depth) {
432
    public JPDAStep createJPDAStep(int size, int depth) {
432
        throw new UnsupportedOperationException("This method must be overridden."); 
433
        throw new UnsupportedOperationException("This method must be overridden."); 
433
    } 
434
    } 
435
    
436
    /**
437
     * Test whether the debuggee supports accessing of class instances, instance counts, and referring objects.
438
     * 
439
     * @see #getInstanceCounts
440
     * @see JPDAClassType#getInstanceCount
441
     * @see JPDAClassType#getInstances
442
     * @see ObjectVariable#getReferringObjects
443
     * 
444
     * @return <code>true</code> when the feature is supported, <code>false</code> otherwise.
445
     */
446
    public boolean canGetInstanceInfo() {
447
        return false;
448
    }
449
    
450
    /**
451
     * Get the list of all classes in the debuggee.
452
     * @return The list of all classes.
453
     */
454
    public List<JPDAClassType> getAllClasses() {
455
        return Collections.emptyList();
456
    }
457
    
458
    /**
459
     * Get the list of all classes mathing the given name in the debuggee.
460
     * @return The list of classes.
461
     */
462
    public List<JPDAClassType> getClassesByName(String name) {
463
        return Collections.emptyList();
464
    }
465
    
466
    /**
467
     * Retrieves the number of instances of each class in the list.
468
     * Use {@link #canGetInstanceInfo} to determine if this operation is supported.
469
     * @return an array of <code>long</code> containing one instance counts for
470
     *         each respective element in the <code>classTypes</code> list.
471
     */
472
    public long[] getInstanceCounts(List<JPDAClassType> classTypes) throws UnsupportedOperationException {
473
        throw new UnsupportedOperationException("Not supported.");
474
    }
475
434
}
476
}
(-)src/org/netbeans/api/debugger/jpda/ObjectVariable.java (-1 / +24 lines)
Lines 13-24 Link Here
13
 * "Portions Copyrighted [year] [name of copyright owner]"
13
 * "Portions Copyrighted [year] [name of copyright owner]"
14
 *
14
 *
15
 * The Original Software is NetBeans. The Initial Developer of the Original
15
 * The Original Software is NetBeans. The Initial Developer of the Original
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
16
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17
 * Microsystems, Inc. All Rights Reserved.
17
 * Microsystems, Inc. All Rights Reserved.
18
 */
18
 */
19
19
20
package org.netbeans.api.debugger.jpda;
20
package org.netbeans.api.debugger.jpda;
21
21
22
import java.util.List;
23
22
24
23
/**
25
/**
24
 * Represents instance of some object in debugged JVM. This interface can
26
 * Represents instance of some object in debugged JVM. This interface can
Lines 107-115 Link Here
107
    public abstract Field[] getInheritedFields (int from, int to);
109
    public abstract Field[] getInheritedFields (int from, int to);
108
    
110
    
109
    /**
111
    /**
112
     * Returns variables that directly reference this variable.
113
     * Use {@link JPDADebugger#canGetInstanceInfo} to determine if this operation is supported.
114
     * @param maxReferrers The maximum number of referring variables to return. Must be non-negative. If zero, all referring variables are returned.
115
     * @return A list of referring variables.
116
     */
117
    List<ObjectVariable> getReferringObjects(long maxReferrers) throws UnsupportedOperationException;
118
    
119
    /**
110
     * Returns representation of super class of this object.
120
     * Returns representation of super class of this object.
111
     *
121
     *
112
     * @return representation of super class of this object
122
     * @return representation of super class of this object
113
     */
123
     */
114
    public abstract Super getSuper ();
124
    public abstract Super getSuper ();
125
    
126
    /**
127
     * Get the run-time class type of this object variable.
128
     * @return The variable class type.
129
     */
130
    JPDAClassType getClassType();
131
    
132
    /**
133
     * Returns a unique identifier for this object variable.
134
     * It is guaranteed to be unique among all object variables from the same debuggee that have not yet been disposed.
135
     * @return a long unique ID
136
     */
137
    long getUniqueID();
115
}
138
}

Return to bug 100047