diff --git a/src/main/java/soot/SootClass.java b/src/main/java/soot/SootClass.java index 45687e89d3d..e8ca36cb87f 100644 --- a/src/main/java/soot/SootClass.java +++ b/src/main/java/soot/SootClass.java @@ -1304,14 +1304,12 @@ public boolean isOpenedByModule() { */ public Collection getMethodsByNameAndParamCount(String name, int paramCount) { List result = null; - synchronized(this) { - for (SootMethod m : getMethods()) { - if (m.getParameterCount() == paramCount && m.getName().equals(name)) { - if (result == null) { - result = new ArrayList<>(); - } - result.add(m); + for (SootMethod m : new ArrayList<>(getMethods())) { + if (m.getParameterCount() == paramCount && m.getName().equals(name)) { + if (result == null) { + result = new ArrayList<>(); } + result.add(m); } }