--- a/debugger.jpda.projectsui/src/org/netbeans/modules/debugger/jpda/projectsui/ToolTipAnnotation.java +++ a/debugger.jpda.projectsui/src/org/netbeans/modules/debugger/jpda/projectsui/ToolTipAnnotation.java @@ -74,6 +74,7 @@ import org.netbeans.api.debugger.jpda.CallStackFrame; import org.netbeans.api.debugger.jpda.Field; import org.netbeans.api.debugger.jpda.InvalidExpressionException; +import org.netbeans.api.debugger.jpda.JPDAClassType; import org.netbeans.api.debugger.jpda.JPDADebugger; import org.netbeans.api.debugger.jpda.JPDAThread; import org.netbeans.api.debugger.jpda.ObjectVariable; @@ -625,6 +626,10 @@ superTypeNames.add(fqn); superTypeVar = superTypeVar.getSuper(); } + List allInterfaces = thisVar.getClassType().getAllInterfaces(); + for (JPDAClassType intrfc : allInterfaces) { + superTypeNames.add(intrfc.getName()); + } } else { addClassNames(currentFrame.getClassName(), superTypeNames); } --- a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/JPDAClassTypeImpl.java +++ a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/JPDAClassTypeImpl.java @@ -116,14 +116,17 @@ return classType; } + @Override public String getName() { return classType.name(); } + @Override public String getSourceName() throws AbsentInformationException { return classType.sourceName(); } + @Override public ClassVariable classObject() { ClassObjectReference co; try { @@ -140,6 +143,7 @@ return new ClassVariableImpl(debugger, co, ""); } + @Override public ObjectVariable getClassLoader() { ClassLoaderReference cl; try { @@ -154,6 +158,7 @@ return new AbstractObjectVariable(debugger, cl, "Loader "+getName()); } + @Override public Super getSuperClass() { if (classType instanceof ClassType) { try { @@ -173,16 +178,11 @@ } } + @Override public List getSubClasses() { if (classType instanceof ClassType) { List subclasses = ClassTypeWrapper.subclasses0((ClassType) classType); - if (subclasses.size() > 0) { - List subClasses = new ArrayList(subclasses.size()); - for (ClassType subclass : subclasses) { - subClasses.add(debugger.getClassType(subclass)); - } - return Collections.unmodifiableList(subClasses); - } + return getTypes(subclasses); } if (classType instanceof InterfaceType) { List subinterfaces = InterfaceTypeWrapper.subinterfaces0((InterfaceType) classType); @@ -203,6 +203,72 @@ return Collections.EMPTY_LIST; } + @Override + public List getAllInterfaces() { + if (classType instanceof ClassType) { + try { + List allInterfaces = ClassTypeWrapper.allInterfaces0((ClassType) classType); + return getTypes(allInterfaces); + } catch (ClassNotPreparedExceptionWrapper ex) { + // Nothing to return + } + } else if (classType instanceof InterfaceType) { + try { + List allInterfaces = new ArrayList<>(); + List processedInterfaces = new ArrayList<>(); + List directInterfaces = InterfaceTypeWrapper.superinterfaces0((InterfaceType) classType); + allInterfaces.addAll(directInterfaces); + while (processedInterfaces.size() < allInterfaces.size()) { + InterfaceType it = allInterfaces.get(processedInterfaces.size()); + directInterfaces = InterfaceTypeWrapper.superinterfaces0(it); + for (InterfaceType di : directInterfaces) { + if (!allInterfaces.contains(di)) { + allInterfaces.add(di); + } + } + processedInterfaces.add(it); + } + return getTypes(allInterfaces); + } catch (ClassNotPreparedExceptionWrapper ex) { + // Nothing to return + } + } + return Collections.EMPTY_LIST; + } + + @Override + public List getDirectInterfaces() { + if (classType instanceof ClassType) { + try { + List directInterfaces = ClassTypeWrapper.interfaces0((ClassType) classType); + return getTypes(directInterfaces); + } catch (ClassNotPreparedExceptionWrapper ex) { + // Nothing to return + } + } else if (classType instanceof InterfaceType) { + try { + List directInterfaces = InterfaceTypeWrapper.superinterfaces0((InterfaceType) classType); + return getTypes(directInterfaces); + } catch (ClassNotPreparedExceptionWrapper ex) { + // Nothing to return + } + } + return Collections.EMPTY_LIST; + } + + private List getTypes(List types) { + if (types.size() > 0) { + List interfaces = new ArrayList(types.size()); + for (ReferenceType intrfc : types) { + interfaces.add(debugger.getClassType(intrfc)); + } + return Collections.unmodifiableList(interfaces); + } else { + return Collections.EMPTY_LIST; + } + } + + @Override public boolean isInstanceOf(String className) { List classTypes; try { @@ -226,6 +292,7 @@ return false; } + @Override public List staticFields() { List allFieldsOrig; try { @@ -352,6 +419,7 @@ } } + @Override public long getInstanceCount() {//boolean refresh) { /*synchronized (this) { if (!refresh && cachedInstanceCount > -1L) { @@ -372,6 +440,7 @@ }*/ } + @Override public List getInstances(long maxInstances) { //assert !java.awt.EventQueue.isDispatchThread() : "Instances retrieving in AWT Event Queue!"; final List instances; @@ -385,17 +454,20 @@ return Collections.emptyList(); } return new AbstractList() { + @Override public ObjectVariable get(int i) { ObjectReference obj = instances.get(i); return new AbstractObjectVariable(debugger, obj, classType.name()+" instance "+i); } + @Override public int size() { return instances.size(); } }; } + @Override public boolean equals(Object o) { if (!(o instanceof JPDAClassTypeImpl)) { return false; @@ -403,6 +475,7 @@ return classType.equals(((JPDAClassTypeImpl) o).classType); } + @Override public int hashCode() { return classType.hashCode() + 1000; }