This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new e2c0411d49 Fixed concurrent issue of ClassGeneratorTest (#15261)
e2c0411d49 is described below

commit e2c0411d493c09f8c46443dff6a7eb47d8800427
Author: zrlw <[email protected]>
AuthorDate: Mon Mar 24 17:15:37 2025 +0800

    Fixed concurrent issue of ClassGeneratorTest (#15261)
---
 .../java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java
 
b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java
index 02a1e9fd25..3ed8509365 100644
--- 
a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java
+++ 
b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java
@@ -20,9 +20,9 @@ import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
 import javassist.ClassPool;
 
@@ -238,7 +238,7 @@ class ClassGeneratorTest {
         int threadCount = 5;
         CountDownLatch LATCH = new CountDownLatch(threadCount);
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
-        List<Integer> hashCodeList = new ArrayList<>();
+        List<Integer> hashCodeList = new CopyOnWriteArrayList<>();
         for (int i = 0; i < threadCount; i++) {
             new Thread(new Runnable() {
                         @Override

Reply via email to