From 449969f7c38629707dddeddbe3b12edd79cce58f Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 13 May 2020 17:28:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/burying/point/AbstractPointCollector.java | 2 +- .../design/mainframe/template/info/JFormProcessInfo.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java index d9ab7cf9b..15291211c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java @@ -128,7 +128,7 @@ public abstract class AbstractPointCollector implem File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), getInfoFilePath())); try { if (!file.exists()) { - file.createNewFile(); + StableUtils.makesureFileExist(file); } } catch (Exception ex) { FineLoggerFactory.getLogger().error(ex.getMessage(), ex); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index 344bdab09..c9f7d761e 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -22,6 +22,7 @@ import com.fr.report.cell.DefaultTemplateCellElement; import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -62,12 +63,12 @@ public class JFormProcessInfo extends TemplateProcessInfo
{ // 获取模板控件数 public int getWidgetCount() { - final int[] widgetCount = {0}; + final AtomicInteger widgetCount = new AtomicInteger(); Form.traversalWidget(this.template.getContainer(), new WidgetGather() { @Override public void dealWith(Widget widget) { if (ComponentOperate.ComponentType.supportComponent(widget)) { - widgetCount[0]++; + widgetCount.incrementAndGet(); } } @@ -76,7 +77,7 @@ public class JFormProcessInfo extends TemplateProcessInfo { return true; } }, null); - return widgetCount[0]; + return widgetCount.get(); } @Override