@Override @SuppressWarnings("unchecked") public void merge(SourceSinkDefinition other) { if (other instanceof MethodSourceSinkDefinition) { MethodSourceSinkDefinition otherMethod = (MethodSourceSinkDefinition) other; // Merge the base object definitions if (otherMethod.baseObjects != null && !otherMethod.baseObjects.isEmpty()) { if (this.baseObjects == null) this.baseObjects = new HashSet<>(); for (AccessPathTuple apt : otherMethod.baseObjects) this.baseObjects.add(apt); } // Merge the parameter definitions if (otherMethod.parameters != null && otherMethod.parameters.length > 0) { if (this.parameters == null) this.parameters = new Set[this.method.getParameters().size()]; for (int i = 0; i < otherMethod.parameters.length; i++) { this.parameters[i].addAll(otherMethod.parameters[i]); } } // Merge the return value definitions if (otherMethod.returnValues != null && !otherMethod.returnValues.isEmpty()) { if (this.returnValues == null) this.returnValues = new HashSet<>(); for (AccessPathTuple apt : otherMethod.returnValues) this.returnValues.add(apt); } } }
this.parameters = new Set[this.method.getParameters().size()]; for (int i = 0; i < other.parameters.length; i++) { this.parameters[i].addAll(other.parameters[i]);
/*** * Static method to create AndroidMethod from Soot method signature * * @param signature * The Soot method signature * @return The new AndroidMethod object */ public static AndroidMethod createFromSignature(String signature) { if (!signature.startsWith("<")) signature = "<" + signature; if (!signature.endsWith(">")) signature = signature + ">"; SootMethodAndClass smac = SootMethodRepresentationParser.v().parseSootMethodString(signature); return new AndroidMethod(smac.getMethodName(), smac.getParameters(), smac.getReturnType(), smac.getClassName()); }