From 1e874429a706b98ea011b07be9a9632c46a3f2ef Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Thu, 29 Aug 2019 10:48:50 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-20329=20sonar=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 1 + .../main/java/com/fr/design/mainframe/vcs/ui/VcsLabel.java | 7 +++---- .../main/java/com/fr/design/style/color/ColorPicker.java | 1 + .../java/com/fr/design/update/actions/FileDownloader.java | 1 + .../com/fr/design/update/ui/dialog/UpdateMainDialog.java | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 277ca93eb5..bb63a57264 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1091,6 +1091,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta thread.join(); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error("Map Thread Error"); + Thread.currentThread().interrupt(); } DesignerEnvManager.getEnvManager().setLastOpenFile( diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsLabel.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsLabel.java index a0180a1379..ca105d28bb 100755 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsLabel.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsLabel.java @@ -19,12 +19,11 @@ public class VcsLabel extends ActionLabel { } public void paintComponent(Graphics g) { - if (ui != null) { - Graphics scratchGraphics = (g == null) ? null : g.create(); + if (ui != null && g != null) { + Graphics scratchGraphics = g.create(); try { ui.update(scratchGraphics, this); - } - finally { + } finally { scratchGraphics.dispose(); } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java index 155ac4168b..c8e3f9b8ac 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java @@ -74,6 +74,7 @@ public class ColorPicker extends JDialog implements ActionListener Thread.sleep(100); // 等待弹窗关闭 } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); } colorPickerPanel.captureScreen(); } diff --git a/designer-base/src/main/java/com/fr/design/update/actions/FileDownloader.java b/designer-base/src/main/java/com/fr/design/update/actions/FileDownloader.java index 4da324f299..328da27a07 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/FileDownloader.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/FileDownloader.java @@ -65,6 +65,7 @@ public abstract class FileDownloader extends SwingWorker success = get(); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); } catch (ExecutionException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 525077d621..cdce0a6570 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -385,6 +385,7 @@ public class UpdateMainDialog extends UIDialog { showDownLoadInfo(); } catch (InterruptedException e) { stopLoading(); + Thread.currentThread().interrupt(); } catch (ExecutionException e) { stopLoading(); } finally {