Skip to content

Commit

Permalink
fix ConcurrentModificationException when calling SootClass.getMethods…
Browse files Browse the repository at this point in the history
…ByNameAndParamCount bug
  • Loading branch information
buriedpot committed Jan 20, 2024
1 parent 395b878 commit fb376b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/soot/SootClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -1304,7 +1304,7 @@ public boolean isOpenedByModule() {
*/
public Collection<SootMethod> getMethodsByNameAndParamCount(String name, int paramCount) {
List<SootMethod> 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<>();
Expand Down

0 comments on commit fb376b8

Please sign in to comment.