From fb376b86e3556b2b6a848f8d73ce7983fdc36679 Mon Sep 17 00:00:00 2001 From: buriedpot <1091378351@qq.com> Date: Wed, 17 Jan 2024 18:16:39 +0800 Subject: [PATCH] fix ConcurrentModificationException when calling SootClass.getMethodsByNameAndParamCount bug --- src/main/java/soot/SootClass.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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<>();