public List<String> getInterfacesNames(final ClassFile cls) { return Arrays.asList(cls.getInterfaces()); }
public List<String> getInterfacesNames(final ClassFile cls) { return Arrays.asList(cls.getInterfaces()); }
public CtClass[] getInterfaces() throws NotFoundException { String[] ifs = getClassFile2().getInterfaces(); int num = ifs.length; CtClass[] ifc = new CtClass[num]; for (int i = 0; i < num; ++i) ifc[i] = classPool.get(ifs[i]); return ifc; }
@Override public CtClass[] getInterfaces() throws NotFoundException { String[] ifs = getClassFile2().getInterfaces(); int num = ifs.length; CtClass[] ifc = new CtClass[num]; for (int i = 0; i < num; ++i) ifc[i] = classPool.get(ifs[i]); return ifc; }
public boolean subtypeOf(CtClass clazz) throws NotFoundException { int i; String cname = clazz.getName(); if (this == clazz || getName().equals(cname)) return true; ClassFile file = getClassFile2(); String supername = file.getSuperclass(); if (supername != null && supername.equals(cname)) return true; String[] ifs = file.getInterfaces(); int num = ifs.length; for (i = 0; i < num; ++i) if (ifs[i].equals(cname)) return true; if (supername != null && classPool.get(supername).subtypeOf(clazz)) return true; for (i = 0; i < num; ++i) if (classPool.get(ifs[i]).subtypeOf(clazz)) return true; return false; }
@Override public boolean subtypeOf(CtClass clazz) throws NotFoundException { int i; String cname = clazz.getName(); if (this == clazz || getName().equals(cname)) return true; ClassFile file = getClassFile2(); String supername = file.getSuperclass(); if (supername != null && supername.equals(cname)) return true; String[] ifs = file.getInterfaces(); int num = ifs.length; for (i = 0; i < num; ++i) if (ifs[i].equals(cname)) return true; if (supername != null && classPool.get(supername).subtypeOf(clazz)) return true; for (i = 0; i < num; ++i) if (classPool.get(ifs[i]).subtypeOf(clazz)) return true; return false; }
@Override public void scan(final Object cls) { final ClassFile classFile = (ClassFile)cls; String className = classFile.getName(); String superclass = classFile.getSuperclass(); boolean isAbstract = (classFile.getAccessFlags() & (AccessFlag.INTERFACE | AccessFlag.ABSTRACT)) != 0; ChildClassDescriptor scannedClass = new ChildClassDescriptor(className, isAbstract); if (!superclass.equals(Object.class.getName())) { children.put(superclass, scannedClass); } for (String anInterface : classFile.getInterfaces()) { children.put(anInterface, scannedClass); } }
String[] interfaces = classFile.getInterfaces(); for (int i = 0; i < interfaces.length; i++) interfaces[i] = javaName(interfaces[i]);
+ cf.getName() + " extends " + cf.getSuperclass()); String[] infs = cf.getInterfaces(); if (infs != null && infs.length > 0) { out.print(" implements ");
String[] interfaces = classFile.getInterfaces(); for (int i = 0; i < interfaces.length; i++) interfaces[i] = javaName(interfaces[i]);
+ cf.getName() + " extends " + cf.getSuperclass()); String[] infs = cf.getInterfaces(); if (infs != null && infs.length > 0) { out.print(" implements ");
public boolean isInstrumented() { String[] interfaceNames = classFile.getInterfaces(); for ( String interfaceName : interfaceNames ) { if ( FieldHandled.class.getName().equals( interfaceName ) ) { return true; } } return false; }
private boolean alreadyInstrumented(ClassFile classfile) { String[] intfs = classfile.getInterfaces(); for ( int i = 0; i < intfs.length; i++ ) { if ( FieldHandled.class.getName().equals( intfs[i] ) ) { return true; } } return false; } }
private boolean alreadyInstrumented(ClassFile classfile) { String[] intfs = classfile.getInterfaces(); for ( int i = 0; i < intfs.length; i++ ) { if ( FieldHandled.class.getName().equals( intfs[i] ) ) { return true; } } return false; } }
public boolean isInstrumented() { String[] interfaceNames = classFile.getInterfaces(); for ( String interfaceName : interfaceNames ) { if ( FieldHandled.class.getName().equals( interfaceName ) ) { return true; } } return false; }
public CtClass[] getInterfaces() throws NotFoundException { String[] ifs = getClassFile2().getInterfaces(); int num = ifs.length; CtClass[] ifc = new CtClass[num]; for (int i = 0; i < num; ++i) ifc[i] = classPool.get(ifs[i]); return ifc; }
private void addFieldHandledInterface(ClassFile classfile) { String[] interfaceNames = classfile.getInterfaces(); String[] newInterfaceNames = new String[interfaceNames.length + 1]; System.arraycopy(interfaceNames, 0, newInterfaceNames, 0, interfaceNames.length); newInterfaceNames[newInterfaceNames.length - 1] = FIELD_HANDLED_TYPE_NAME; classfile.setInterfaces(newInterfaceNames); }
public CtClass[] getInterfaces() throws NotFoundException { String[] ifs = getClassFile2().getInterfaces(); int num = ifs.length; CtClass[] ifc = new CtClass[num]; for (int i = 0; i < num; ++i) ifc[i] = classPool.get(ifs[i]); return ifc; }
public CtClass[] getInterfaces() throws NotFoundException { String[] ifs = getClassFile2().getInterfaces(); int num = ifs.length; CtClass[] ifc = new CtClass[num]; for (int i = 0; i < num; ++i) ifc[i] = classPool.get(ifs[i]); return ifc; }
private void debugClassFile(final ClassFile classFile) { if (!logger.isDebugEnabled()) { return; } logger.debug(" - class: {}",classFile.getName()); logger.debug(" -- Java version: {}.{}", classFile.getMajorVersion(), classFile.getMinorVersion()); logger.debug(" -- interface: {} abstract: {} final: {}", classFile.isInterface(), classFile.isAbstract(), classFile.isFinal()); logger.debug(" -- extends class: {}",classFile.getSuperclass()); logger.debug(" -- implements interfaces: {}", Arrays.deepToString(classFile.getInterfaces())); }