@Override public void visitJavaClass(JavaClass obj) { try { obj.getSuperClass(); } catch (ClassNotFoundException e) { AnalysisContext.reportMissingClass(e); return; } String superclassName2 = getSuperclassName(); boolean weird = "java.lang.Object".equals(superclassName2) && obj.getInterfaceIndices().length == 0; boolean hasAnonymousName = ClassName.isLocalOrAnonymous(obj.getClassName()); boolean isAnonymousInnerClass = hasAnonymousName && !weird; if (isAnonymousInnerClass) { super.visitJavaClass(obj); } }
refs.add(t); fout.write(t); for (int i : c.getInterfaceIndices()) { v[i] = 1;
public static boolean instanceOf(JavaClass subtype, @DottedClassName String dottedSupertype) { if (subtype.getClassName().equals(dottedSupertype) || subtype.getSuperclassName().equals(dottedSupertype)) { return true; } if ("java.lang.Object".equals(subtype.getSuperclassName()) && subtype.getInterfaceIndices().length == 0) { return false; } Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); ClassDescriptor subDescriptor = DescriptorFactory.createClassDescriptor(subtype); ClassDescriptor superDescriptor = DescriptorFactory.createClassDescriptorFromDottedClassName(dottedSupertype); try { return subtypes2.isSubtype(subDescriptor, superDescriptor); } catch (ClassNotFoundException e) { AnalysisContext.reportMissingClass(e); return false; } }
@Override public void visitJavaClass(JavaClass obj) { try { obj.getSuperClass(); } catch (ClassNotFoundException e) { AnalysisContext.reportMissingClass(e); return; } String superclassName2 = getSuperclassName(); boolean weird = "java.lang.Object".equals(superclassName2) && obj.getInterfaceIndices().length == 0; boolean hasAnonymousName = ClassName.isAnonymous(obj.getClassName()); boolean isAnonymousInnerClass = hasAnonymousName && !weird; if (isAnonymousInnerClass) { super.visitJavaClass(obj); } }
public static boolean instanceOf(JavaClass subtype, @DottedClassName String dottedSupertype) { if (subtype.getClassName().equals(dottedSupertype) || subtype.getSuperclassName().equals(dottedSupertype)) { return true; } if ("java.lang.Object".equals(subtype.getSuperclassName()) && subtype.getInterfaceIndices().length == 0) { return false; } Subtypes2 subtypes2 = AnalysisContext.currentAnalysisContext().getSubtypes2(); ClassDescriptor subDescriptor = DescriptorFactory.createClassDescriptor(subtype); ClassDescriptor superDescriptor = DescriptorFactory.createClassDescriptorFromDottedClassName(dottedSupertype); try { return subtypes2.isSubtype(subDescriptor, superDescriptor); } catch (ClassNotFoundException e) { AnalysisContext.reportMissingClass(e); return false; } }
superClassConstantPoolIndex = cls.getSuperClass().getClassNameIndex(); for (int i : cls.getInterfaceIndices()) { final ClassModelInterface iface = new ClassModelInterface(i); interfaces.add(iface);