diff --git a/src/main/java/soot/SootClass.java b/src/main/java/soot/SootClass.java index 5b4e435e1c9..8db6719d329 100644 --- a/src/main/java/soot/SootClass.java +++ b/src/main/java/soot/SootClass.java @@ -1295,7 +1295,7 @@ public boolean isOpenedByModule() { /** * Returns all methods with exactly the number of parameters specified. - * + * * @param name * the name of the method * @param paramCount @@ -1304,7 +1304,7 @@ public boolean isOpenedByModule() { */ public Collection getMethodsByNameAndParamCount(String name, int paramCount) { List result = null; - for (SootMethod m : getMethods()) { + for (SootMethod m : new ArrayList<>(getMethods())) { if (m.getParameterCount() == paramCount && m.getName().equals(name)) { if (result == null) { result = new ArrayList<>();