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 253295
Collapse All | Expand All

(-)a/debugger.jpda.projectsui/src/org/netbeans/modules/debugger/jpda/projectsui/ToolTipAnnotation.java (+5 lines)
Lines 74-79 Link Here
74
import org.netbeans.api.debugger.jpda.CallStackFrame;
74
import org.netbeans.api.debugger.jpda.CallStackFrame;
75
import org.netbeans.api.debugger.jpda.Field;
75
import org.netbeans.api.debugger.jpda.Field;
76
import org.netbeans.api.debugger.jpda.InvalidExpressionException;
76
import org.netbeans.api.debugger.jpda.InvalidExpressionException;
77
import org.netbeans.api.debugger.jpda.JPDAClassType;
77
import org.netbeans.api.debugger.jpda.JPDADebugger;
78
import org.netbeans.api.debugger.jpda.JPDADebugger;
78
import org.netbeans.api.debugger.jpda.JPDAThread;
79
import org.netbeans.api.debugger.jpda.JPDAThread;
79
import org.netbeans.api.debugger.jpda.ObjectVariable;
80
import org.netbeans.api.debugger.jpda.ObjectVariable;
Lines 625-630 Link Here
625
                    superTypeNames.add(fqn);
626
                    superTypeNames.add(fqn);
626
                    superTypeVar = superTypeVar.getSuper();
627
                    superTypeVar = superTypeVar.getSuper();
627
                }
628
                }
629
                List<JPDAClassType> allInterfaces = thisVar.getClassType().getAllInterfaces();
630
                for (JPDAClassType intrfc : allInterfaces) {
631
                    superTypeNames.add(intrfc.getName());
632
                }
628
            } else {
633
            } else {
629
                addClassNames(currentFrame.getClassName(), superTypeNames);
634
                addClassNames(currentFrame.getClassName(), superTypeNames);
630
            }
635
            }
(-)a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/JPDAClassTypeImpl.java (-7 / +80 lines)
Lines 116-129 Link Here
116
        return classType;
116
        return classType;
117
    }
117
    }
118
118
119
    @Override
119
    public String getName() {
120
    public String getName() {
120
        return classType.name();
121
        return classType.name();
121
    }
122
    }
122
123
124
    @Override
123
    public String getSourceName() throws AbsentInformationException {
125
    public String getSourceName() throws AbsentInformationException {
124
        return classType.sourceName();
126
        return classType.sourceName();
125
    }
127
    }
126
128
129
    @Override
127
    public ClassVariable classObject() {
130
    public ClassVariable classObject() {
128
        ClassObjectReference co;
131
        ClassObjectReference co;
129
        try {
132
        try {
Lines 140-145 Link Here
140
        return new ClassVariableImpl(debugger, co, "");
143
        return new ClassVariableImpl(debugger, co, "");
141
    }
144
    }
142
    
145
    
146
    @Override
143
    public ObjectVariable getClassLoader() {
147
    public ObjectVariable getClassLoader() {
144
        ClassLoaderReference cl;
148
        ClassLoaderReference cl;
145
        try {
149
        try {
Lines 154-159 Link Here
154
        return new AbstractObjectVariable(debugger, cl, "Loader "+getName());
158
        return new AbstractObjectVariable(debugger, cl, "Loader "+getName());
155
    }
159
    }
156
    
160
    
161
    @Override
157
    public Super getSuperClass() {
162
    public Super getSuperClass() {
158
        if (classType instanceof ClassType) {
163
        if (classType instanceof ClassType) {
159
            try {
164
            try {
Lines 173-188 Link Here
173
        }
178
        }
174
    }
179
    }
175
    
180
    
181
    @Override
176
    public List<JPDAClassType> getSubClasses() {
182
    public List<JPDAClassType> getSubClasses() {
177
        if (classType instanceof ClassType) {
183
        if (classType instanceof ClassType) {
178
            List<ClassType> subclasses = ClassTypeWrapper.subclasses0((ClassType) classType);
184
            List<ClassType> subclasses = ClassTypeWrapper.subclasses0((ClassType) classType);
179
            if (subclasses.size() > 0) {
185
            return getTypes(subclasses);
180
                List<JPDAClassType> subClasses = new ArrayList(subclasses.size());
181
                for (ClassType subclass : subclasses) {
182
                    subClasses.add(debugger.getClassType(subclass));
183
                }
184
                return Collections.unmodifiableList(subClasses);
185
            }
186
        }
186
        }
187
        if (classType instanceof InterfaceType) {
187
        if (classType instanceof InterfaceType) {
188
            List<InterfaceType> subinterfaces = InterfaceTypeWrapper.subinterfaces0((InterfaceType) classType);
188
            List<InterfaceType> subinterfaces = InterfaceTypeWrapper.subinterfaces0((InterfaceType) classType);
Lines 203-208 Link Here
203
        return Collections.EMPTY_LIST;
203
        return Collections.EMPTY_LIST;
204
    }
204
    }
205
205
206
    @Override
207
    public List<JPDAClassType> getAllInterfaces() {
208
        if (classType instanceof ClassType) {
209
            try {
210
                List<InterfaceType> allInterfaces = ClassTypeWrapper.allInterfaces0((ClassType) classType);
211
                return getTypes(allInterfaces);
212
            } catch (ClassNotPreparedExceptionWrapper ex) {
213
                // Nothing to return
214
            }
215
        } else if (classType instanceof InterfaceType) {
216
            try {
217
                List<InterfaceType> allInterfaces = new ArrayList<>();
218
                List<InterfaceType> processedInterfaces = new ArrayList<>();
219
                List<InterfaceType> directInterfaces = InterfaceTypeWrapper.superinterfaces0((InterfaceType) classType);
220
                allInterfaces.addAll(directInterfaces);
221
                while (processedInterfaces.size() < allInterfaces.size()) {
222
                    InterfaceType it = allInterfaces.get(processedInterfaces.size());
223
                    directInterfaces = InterfaceTypeWrapper.superinterfaces0(it);
224
                    for (InterfaceType di : directInterfaces) {
225
                        if (!allInterfaces.contains(di)) {
226
                            allInterfaces.add(di);
227
                        }
228
                    }
229
                    processedInterfaces.add(it);
230
                }
231
                return getTypes(allInterfaces);
232
            } catch (ClassNotPreparedExceptionWrapper ex) {
233
                // Nothing to return
234
            }
235
        }
236
        return Collections.EMPTY_LIST;
237
    }
238
239
    @Override
240
    public List<JPDAClassType> getDirectInterfaces() {
241
        if (classType instanceof ClassType) {
242
            try {
243
                List<InterfaceType> directInterfaces = ClassTypeWrapper.interfaces0((ClassType) classType);
244
                return getTypes(directInterfaces);
245
            } catch (ClassNotPreparedExceptionWrapper ex) {
246
                // Nothing to return
247
            }
248
        } else if (classType instanceof InterfaceType) {
249
            try {
250
                List<InterfaceType> directInterfaces = InterfaceTypeWrapper.superinterfaces0((InterfaceType) classType);
251
                return getTypes(directInterfaces);
252
            } catch (ClassNotPreparedExceptionWrapper ex) {
253
                // Nothing to return
254
            }
255
        }
256
        return Collections.EMPTY_LIST;
257
    }
258
259
    private List<JPDAClassType> getTypes(List<? extends ReferenceType> types) {
260
        if (types.size() > 0) {
261
            List<JPDAClassType> interfaces = new ArrayList(types.size());
262
            for (ReferenceType intrfc : types) {
263
                interfaces.add(debugger.getClassType(intrfc));
264
            }
265
            return Collections.unmodifiableList(interfaces);
266
        } else {
267
            return Collections.EMPTY_LIST;
268
        }
269
    }
270
271
    @Override
206
    public boolean isInstanceOf(String className) {
272
    public boolean isInstanceOf(String className) {
207
        List<ReferenceType> classTypes;
273
        List<ReferenceType> classTypes;
208
        try {
274
        try {
Lines 226-231 Link Here
226
        return false;
292
        return false;
227
    }
293
    }
228
294
295
    @Override
229
    public List<Field> staticFields() {
296
    public List<Field> staticFields() {
230
        List<com.sun.jdi.Field> allFieldsOrig;
297
        List<com.sun.jdi.Field> allFieldsOrig;
231
        try {
298
        try {
Lines 352-357 Link Here
352
        }
419
        }
353
    }
420
    }
354
    
421
    
422
    @Override
355
    public long getInstanceCount() {//boolean refresh) {
423
    public long getInstanceCount() {//boolean refresh) {
356
            /*synchronized (this) {
424
            /*synchronized (this) {
357
                if (!refresh && cachedInstanceCount > -1L) {
425
                if (!refresh && cachedInstanceCount > -1L) {
Lines 372-377 Link Here
372
            }*/
440
            }*/
373
    }
441
    }
374
    
442
    
443
    @Override
375
    public List<ObjectVariable> getInstances(long maxInstances) {
444
    public List<ObjectVariable> getInstances(long maxInstances) {
376
            //assert !java.awt.EventQueue.isDispatchThread() : "Instances retrieving in AWT Event Queue!";
445
            //assert !java.awt.EventQueue.isDispatchThread() : "Instances retrieving in AWT Event Queue!";
377
            final List<ObjectReference> instances;
446
            final List<ObjectReference> instances;
Lines 385-401 Link Here
385
                return Collections.emptyList();
454
                return Collections.emptyList();
386
            }
455
            }
387
            return new AbstractList<ObjectVariable>() {
456
            return new AbstractList<ObjectVariable>() {
457
                @Override
388
                public ObjectVariable get(int i) {
458
                public ObjectVariable get(int i) {
389
                    ObjectReference obj = instances.get(i);
459
                    ObjectReference obj = instances.get(i);
390
                    return new AbstractObjectVariable(debugger, obj, classType.name()+" instance "+i);
460
                    return new AbstractObjectVariable(debugger, obj, classType.name()+" instance "+i);
391
                }
461
                }
392
462
463
                @Override
393
                public int size() {
464
                public int size() {
394
                    return instances.size();
465
                    return instances.size();
395
                }
466
                }
396
            };
467
            };
397
    }
468
    }
398
    
469
    
470
    @Override
399
    public boolean equals(Object o) {
471
    public boolean equals(Object o) {
400
        if (!(o instanceof JPDAClassTypeImpl)) {
472
        if (!(o instanceof JPDAClassTypeImpl)) {
401
            return false;
473
            return false;
Lines 403-408 Link Here
403
        return classType.equals(((JPDAClassTypeImpl) o).classType);
475
        return classType.equals(((JPDAClassTypeImpl) o).classType);
404
    }
476
    }
405
    
477
    
478
    @Override
406
    public int hashCode() {
479
    public int hashCode() {
407
        return classType.hashCode() + 1000;
480
        return classType.hashCode() + 1000;
408
    }
481
    }

Return to bug 253295