From 814b4636f532418f308bd4a3cd35f89e2499f18d Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 10 Jun 2021 16:17:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-53772=20=E3=80=90=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E8=81=94=E5=8A=A8=E3=80=91=E7=BB=84=E4=BB=B6=E5=90=8D/?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=8D=E6=9B=BF=E6=8D=A2=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=8B=96=E5=85=A5=E5=A4=B1=E8=B4=A5=E6=97=B6=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=86=8D=E6=8B=96=E5=85=A5=E6=88=90=E5=8A=9F=20?= =?UTF-8?q?=E6=9C=89=E5=87=A0=E7=8E=87=E9=80=A0=E6=88=90=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mod/ContentReplacerCenter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java index 7440895a8..91f9bf3dc 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java @@ -30,6 +30,7 @@ import com.fr.event.Listener; import com.fr.log.FineLoggerFactory; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -51,7 +52,7 @@ public class ContentReplacerCenter { } private List contentChangeList = new ArrayList<>(); - private List items = new ArrayList<>(); + private Map itemsMap = new HashMap<>(); private ContentReplacerCenter() { @@ -61,21 +62,21 @@ public class ContentReplacerCenter { if (param.getChangeMap().isEmpty()) { return; } - items.add(param); + itemsMap.put(param.getChangeItem(), param); } }); EventDispatcher.listen(TableDataModifyEvent.INSTANCE, new Listener() { @Override public void on(Event event, ContentChangeItem param) { - items.add(param); + itemsMap.put(param.getChangeItem(), param); long start = System.currentTimeMillis(); ContentObjectManager.getInstance().searchObject(param.getObject()); FineLoggerFactory.getLogger().debug("search object spend {} ms", (System.currentTimeMillis() - start)); FineLoggerFactory.getLogger().debug("search result: {}", ContentObjectManager.getInstance().getObjectMap() == null ? null : ContentObjectManager.getInstance().getObjectMap().keySet()); - List itemsCopy = new ArrayList<>(items); - items.clear(); + List itemsCopy = new ArrayList<>(itemsMap.values()); + itemsMap.clear(); onRename(itemsCopy, contentChangeList); } });