From a64ace980a9d3abe02fc42e2c02cdfcc37a60279 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 9 Jun 2021 11:25:16 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-53157=20=E5=80=BC=E4=B8=80=E6=A0=B7=20?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E5=9C=B0=E5=9D=80=E4=B8=8D=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=E7=9A=84=E5=AF=B9=E8=B1=A1=E5=90=8C=E6=A0=B7=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=A2=AB=E8=BF=94=E5=9B=9E=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mod/ContentObjectManager.java | 8 ++++---- .../java/com/fr/design/mod/ContentReplacerCenter.java | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java index 0111f7836f..6c8a123fd9 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java @@ -24,6 +24,7 @@ import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.FunctionGrouper; import com.fr.report.cell.cellattr.core.group.SelectCount; import com.fr.stable.Filter; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -48,7 +49,7 @@ public class ContentObjectManager { /** * 放置所有需要替换内容的对象 */ - private Map> objectMap; + private Map> objectMap; private final Set set = new HashSet<>(); @@ -98,14 +99,13 @@ public class ContentObjectManager { } @Nullable - public Map> getObjectMap() { + public Map> getObjectMap() { return objectMap; } public boolean needContentTip(Object ob, Set nameSet) { - long start = System.currentTimeMillis(); objectMap = ClassHelper.searchObject(ob, set, ModClassFilter.getInstance()); - for (Map.Entry> entry : objectMap.entrySet()) { + for (Map.Entry> entry : objectMap.entrySet()) { for (Object o : entry.getValue()) { for (String name : nameSet) { ContentReplacer contentReplacer = map.get(entry.getKey()); 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 cccc08c9af..7440895a8b 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 @@ -29,9 +29,9 @@ import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.log.FineLoggerFactory; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Set; /** * 默认联动内容替换器实现 @@ -106,14 +106,14 @@ public class ContentReplacerCenter { } private void onRename(List contentChangeItemList, List contentChangeList) { - Map> objectMap = ContentObjectManager.getInstance().getObjectMap(); + Map> objectMap = ContentObjectManager.getInstance().getObjectMap(); if (objectMap != null) { long start = System.currentTimeMillis(); for (ContentChange contentChange : contentChangeList) { - Set set = objectMap.get(contentChange.type()); + Collection objects = objectMap.get(contentChange.type()); // 所有需要处理的js等对象 - if (set != null) { - for (Object ob : set) { + if (objects != null) { + for (Object ob : objects) { fireChange(ob, contentChange, contentChangeItemList); } }