From 3fc91a5eaba80077725be9a465de0a39a8a26b1a Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 Sep 2017 15:11:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C=20?= =?UTF-8?q?build=20failed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/JForm.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index dfa3784233..79b4ccc960 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -18,6 +18,7 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteBodyLayout; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; @@ -58,8 +59,17 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; import com.fr.stable.bridge.StableFactory; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; From 5a27503c24012aa6c2f25daca99fa97e787d02ed Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 25 Sep 2017 15:12:12 +0800 Subject: [PATCH 2/2] 1 --- .../mainframe/errorinfo/ErrorInfoUploader.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java index 10ff2779b4..07aadbe915 100644 --- a/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java +++ b/designer/src/com/fr/design/mainframe/errorinfo/ErrorInfoUploader.java @@ -29,6 +29,8 @@ public class ErrorInfoUploader { private static ErrorInfoUploader collector; private static boolean licSupport = true; + // 在一台不能上网的电脑里发现了10w个errorinfo... + private static final int MAX_ERROR_SIZE = 2000; static { GeneralContext.addEnvChangedListener(new EnvChangedListener() { @@ -123,6 +125,11 @@ public class ErrorInfoUploader { } File[] files = folder.listFiles(); + if (files.length > MAX_ERROR_SIZE) { + StableUtils.deleteFile(folder); + return; + } + try { for (File file : files) { String filePath = file.getPath(); @@ -131,6 +138,11 @@ public class ErrorInfoUploader { if (suffix.endsWith(SUFFIX)) { Thread.sleep(1000L); String content = IOUtils.inputStream2String(new FileInputStream(file)); + if (content.length() > MAX_ERROR_SIZE) { + file.delete(); + continue; + } + String url = SiteCenter.getInstance().acquireUrlByKind("design.error"); if (sendErroInfo(url, content)) { file.delete();