@Override public String toString() { StringBuilder s = new StringBuilder("synthetic "); if (isFactoryMethod()) { s.append(" factory "); } s.append(method.toString()); return s.toString(); }
@Override public String toString() { StringBuilder s = new StringBuilder("synthetic "); if (isFactoryMethod()) { s.append(" factory "); } s.append(method.toString()); return s.toString(); }
@Override public boolean understands(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } if (node.getMethod().isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) node.getMethod(); if (s.isFactoryMethod()) { return getTypesForContext(node.getContext()) != null; } } return false; }
private Collection<Statement> computeFactoryReturnStatements() { // todo: clean up logic with inheritance, delegation. HashSet<Statement> result = HashSetFactory.make(); for (CGNode n : builder.getCallGraph()) { if (n.getMethod() instanceof SyntheticMethod) { SyntheticMethod m = (SyntheticMethod) n.getMethod(); if (m.isFactoryMethod()) { result.add(new NormalReturnCallee(n)); } } } return result; }
private Collection<Statement> computeFactoryReturnStatements() { // todo: clean up logic with inheritance, delegation. HashSet<Statement> result = HashSetFactory.make(); for (CGNode n : builder.getCallGraph()) { if (n.getMethod() instanceof SyntheticMethod) { SyntheticMethod m = (SyntheticMethod) n.getMethod(); if (m.isFactoryMethod()) { result.add(new NormalReturnCallee(n)); } } } return result; }
@Override public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) { if (callee == null) { throw new IllegalArgumentException("callee is null"); } if (callee.isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) callee; if (s.isFactoryMethod()) { return new CallStringContext(new CallString(site, caller.getMethod())); } } return null; }
@Override public boolean understands(CGNode node) { if (node == null) { throw new IllegalArgumentException("node is null"); } if (node.getMethod().isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) node.getMethod(); if (s.isFactoryMethod()) { return getTypesForContext(node.getContext()) != null; } } return false; }
@Override public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) { if (callee == null) { throw new IllegalArgumentException("callee is null"); } if (callee.isWalaSynthetic()) { SyntheticMethod s = (SyntheticMethod) callee; if (s.isFactoryMethod()) { return new CallStringContext(new CallString(site, caller.getMethod())); } } return null; }