aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2018-10-05 15:47:03 +0900
committerScott Marlow <smarlow@redhat.com>2019-04-18 09:17:12 -0400
commit0b2912e7606910fecbacd1784c23fa7832f392bb (patch)
tree1710536df73e816ad41fbf55237c47cecf11fc6a
parenta59658da9986ec2a9952a6539000c57ff1f02026 (diff)
downloadjavassist-0b2912e7606910fecbacd1784c23fa7832f392bb.tar.gz
javassist-0b2912e7606910fecbacd1784c23fa7832f392bb.zip
avoids ConcurrentModificationException in 3.23.1-GA reported in Issue #224.
-rw-r--r--src/main/javassist/CtClassType.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java
index 3791b5fb..ae196c4a 100644
--- a/src/main/javassist/CtClassType.java
+++ b/src/main/javassist/CtClassType.java
@@ -1526,7 +1526,7 @@ class CtClassType extends CtClass {
ClassFile cf = getClassFile2();
ConstPool cp = cf.getConstPool();
List<MethodInfo> methods = cf.getMethods();
- for (MethodInfo minfo:methods)
+ for (MethodInfo minfo: methods.toArray(new MethodInfo[methods.size()]))
converter.doit(this, minfo, cp);
}
@@ -1537,7 +1537,7 @@ class CtClassType extends CtClass {
checkModify();
ClassFile cf = getClassFile2();
List<MethodInfo> methods = cf.getMethods();
- for (MethodInfo minfo:methods)
+ for (MethodInfo minfo: methods.toArray(new MethodInfo[methods.size()]))
editor.doit(this, minfo);
}