From f462925487d4fbb7a3914b90fb3f9edac3c9976c Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 16 Mar 2021 10:42:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-48965=20=E5=87=BA=E7=8E=B0concurrent?= =?UTF-8?q?Modification=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/core/ActionFactory.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 574195470b..6c7d6408a9 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -14,11 +14,12 @@ import java.awt.event.KeyEvent; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CopyOnWriteArraySet; /** * 插入单元格元素和插入悬浮元素的一些集合方法 @@ -27,8 +28,8 @@ import java.util.concurrent.ConcurrentMap; * @version 2017年11月17日14点39分 */ public class ActionFactory { - private static LinkedHashSet> actionClasses = new LinkedHashSet<>(); - private static LinkedHashSet> floatActionClasses = new LinkedHashSet<>(); + private static Set> actionClasses = new CopyOnWriteArraySet<>(); + private static Set> floatActionClasses = new CopyOnWriteArraySet<>(); private static Class chartCollectionClass = null; /** * 无需每次实例化的悬浮元素编辑器 From 6daaa9f4f9b0bd2ea5f0a4d67b62660895bb5c6c Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 16 Mar 2021 10:56:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-48965=20=E4=BD=BF=E7=94=A8=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=B7=BB=E5=8A=A0=20=E5=87=8F=E5=B0=91=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E5=A4=8D=E5=88=B6=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/actions/core/ActionFactory.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java index 6c7d6408a9..f19c962f83 100644 --- a/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java +++ b/designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java @@ -13,6 +13,7 @@ import javax.swing.KeyStroke; import java.awt.event.KeyEvent; import java.lang.reflect.Constructor; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; @@ -257,14 +258,14 @@ public class ActionFactory { */ public static void registerCellInsertActionClass(Class[] cls) { if (cls != null) { - Collections.addAll(actionClasses, cls); + actionClasses.addAll(Arrays.asList(cls)); } } public static void referCellInsertActionClass(Class[] cls) { if (cls != null) { actionClasses.clear(); - Collections.addAll(actionClasses, cls); + actionClasses.addAll(Arrays.asList(cls)); } } @@ -322,14 +323,14 @@ public class ActionFactory { */ public static void registerFloatInsertActionClass(Class[] cls) { if (cls != null) { - Collections.addAll(floatActionClasses, cls); + floatActionClasses.addAll(Arrays.asList(cls)); } } public static void referFloatInsertActionClass(Class[] cls) { if (cls != null) { floatActionClasses.clear(); - Collections.addAll(floatActionClasses, cls); + floatActionClasses.addAll(Arrays.asList(cls)); } }