Skip to content

Commit 7c86a50

Browse files
authored
traverse the methodList's copy
1 parent 4056d91 commit 7c86a50

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/soot/SootClass.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,14 +1304,12 @@ public boolean isOpenedByModule() {
13041304
*/
13051305
public Collection<SootMethod> getMethodsByNameAndParamCount(String name, int paramCount) {
13061306
List<SootMethod> result = null;
1307-
synchronized(this) {
1308-
for (SootMethod m : getMethods()) {
1309-
if (m.getParameterCount() == paramCount && m.getName().equals(name)) {
1310-
if (result == null) {
1311-
result = new ArrayList<>();
1312-
}
1313-
result.add(m);
1307+
for (SootMethod m : new ArrayList<>(getMethods())) {
1308+
if (m.getParameterCount() == paramCount && m.getName().equals(name)) {
1309+
if (result == null) {
1310+
result = new ArrayList<>();
13141311
}
1312+
result.add(m);
13151313
}
13161314
}
13171315

0 commit comments

Comments
 (0)