for (IMethod mtd : Iterator2Iterable.make(cls.getDeclaredMethods().iterator())) {
@Override public Collection<? extends IMethod> getDeclaredMethods() { return realType.getDeclaredMethods(); }
@Override public Collection<? extends IMethod> getDeclaredMethods() { return realType.getDeclaredMethods(); }
@Override public int getNumberOfMethods() { return types.values().stream() .mapToInt(cls -> cls.getDeclaredMethods().size()) .sum(); }
@Override public int getNumberOfMethods() { return types.values().stream() .mapToInt(cls -> cls.getDeclaredMethods().size()) .sum(); }
@Override public int getNumberOfMethods() { int result = 0; for (IClass klass : Iterator2Iterable.make(iterateAllClasses())) { result += klass.getDeclaredMethods().size(); } return result; }
/** * Get all the constructors of a class */ private static Collection<IMethod> getConstructors(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (m.isInit()) { result.add(m); } } return result; }
/** * Get all the constructors of a class */ private static Collection<IMethod> getConstructors(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (m.isInit()) { result.add(m); } } return result; }
@Override public int getNumberOfMethods() { int result = 0; for (IClass klass : Iterator2Iterable.make(iterateAllClasses())) { result += klass.getDeclaredMethods().size(); } return result; }
/** * Get all non-constructor, non-class-initializer methods declared by a class */ private static Collection<IMethod> getDeclaredNormalMethods(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (!m.isInit() && !m.isClinit()) { result.add(m); } } return result; }
/** * Get all the public constructors of a class */ private static Collection<IMethod> getPublicConstructors(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (m.isInit() && m.isPublic()) { result.add(m); } } return result; }
/** * Get all the public constructors of a class */ private static Collection<IMethod> getPublicConstructors(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (m.isInit() && m.isPublic()) { result.add(m); } } return result; }
/** * Get all non-constructor, non-class-initializer methods declared by a class */ private static Collection<IMethod> getDeclaredNormalMethods(IClass cls) { Collection<IMethod> result = HashSetFactory.make(); for (IMethod m : cls.getDeclaredMethods()) { if (!m.isInit() && !m.isClinit()) { result.add(m); } } return result; }
public void visitProgram(FlowGraph flowgraph) { for(IClass klass : cha) { for(IMethod method : klass.getDeclaredMethods()) { if(method.getDescriptor().equals(AstMethodReference.fnDesc)) { visitFunction(flowgraph, method); } } } }
public void visitProgram(FlowGraph flowgraph) { for(IClass klass : cha) { for(IMethod method : klass.getDeclaredMethods()) { if(method.getDescriptor().equals(AstMethodReference.fnDesc)) { visitFunction(flowgraph, method); } } } }
public Entrypoint make(String scriptName) { IClass cls = cha.lookupClass(TypeReference.findOrCreate(scriptType.getClassLoader().getReference(), scriptName)); assert cls != null && cha.isSubclassOf(cls, scriptType) && !cls.isAbstract() : String.valueOf(cls) + " for " + scriptName; for (IMethod method : cls.getDeclaredMethods()) { if (keep()) { return new ScriptEntryPoint(method); } } assert false; return null; } }
public Entrypoint make(String scriptName) { IClass cls = cha.lookupClass(TypeReference.findOrCreate(scriptType.getClassLoader().getReference(), scriptName)); assert cls != null && cha.isSubclassOf(cls, scriptType) && !cls.isAbstract() : String.valueOf(cls) + " for " + scriptName; for (IMethod method : cls.getDeclaredMethods()) { if (keep()) { return new ScriptEntryPoint(method); } } assert false; return null; } }
private void resolveLocalCalls(FlowGraph flowgraph) { for(IClass klass : cha) { for(IMethod method : klass.getDeclaredMethods()) { if (filterFunction(method)) { IR ir = cache.getIR(method); ir.visitAllInstructions(new LocalCallSSAVisitor(method, ir.getSymbolTable(), cache.getDefUse(ir), flowgraph)); } } } }
private void resolveLocalCalls(FlowGraph flowgraph) { for(IClass klass : cha) { for(IMethod method : klass.getDeclaredMethods()) { if (filterFunction(method)) { IR ir = cache.getIR(method); ir.visitAllInstructions(new LocalCallSSAVisitor(method, ir.getSymbolTable(), cache.getDefUse(ir), flowgraph)); } } } }
private static Iterable<Entrypoint> makePublicEntrypoints(IClassHierarchy cha, String entryClass) { Collection<Entrypoint> result = new ArrayList<>(); IClass klass = cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, StringStuff.deployment2CanonicalTypeString(entryClass))); for (IMethod m : klass.getDeclaredMethods()) { if (m.isPublic()) { result.add(new DefaultEntrypoint(m, cha)); } } return result; } }