Skip to content

Commit

Permalink
traverse the methodList's copy
Browse files Browse the repository at this point in the history
  • Loading branch information
buriedpot authored Jan 20, 2024
1 parent 4056d91 commit 7c86a50
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/soot/SootClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -1304,14 +1304,12 @@ public boolean isOpenedByModule() {
*/
public Collection<SootMethod> getMethodsByNameAndParamCount(String name, int paramCount) {
List<SootMethod> 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);
}
}

Expand Down

0 comments on commit 7c86a50

Please sign in to comment.