From d0791cb49038a87088a66149d79e912faa8b6e5d Mon Sep 17 00:00:00 2001 From: pengda Date: Wed, 28 Aug 2019 16:41:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-20322=20sonar=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D,=E6=97=A0jira=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java | 4 +++- .../java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java | 4 +++- .../java/com/fr/van/chart/column/VanChartColumnPlotPane.java | 4 +++- .../java/com/fr/van/chart/custom/VanChartCustomPlotPane.java | 4 +++- .../designer/style/axis/component/VanChartAxisButtonPane.java | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java index 4944869df..ecff46354 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java @@ -68,7 +68,9 @@ public class VanChartBarPlotPane extends AbstractVanChartTypePane { Plot cloned = null; try { - cloned = (Plot)newPlot.clone(); + if(newPlot != null) { + cloned = (Plot) newPlot.clone(); + } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error("Error In ColumnChart"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java index 9f6c47ae7..21ae109a4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java @@ -80,7 +80,9 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane { Plot cloned = null; try { - cloned = (Plot)newPlot.clone(); + if(newPlot != null) { + cloned = (Plot) newPlot.clone(); + } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error("Error In BubbleChart"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java index ffd13a1ab..2d8cccd64 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java @@ -69,7 +69,9 @@ public class VanChartColumnPlotPane extends AbstractVanChartTypePane { Plot cloned = null; try { - cloned = (Plot)newPlot.clone(); + if(newPlot != null) { + cloned = (Plot) newPlot.clone(); + } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error("Error In ColumnChart"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index 96d2a00d5..5e3bc935c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -261,7 +261,9 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { } Plot cloned = null; try { - cloned = (Plot) newPlot.clone(); + if(newPlot != null) { + cloned = (Plot) newPlot.clone(); + } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error("Error In ScatterChart"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java index 9460e6ac2..87e8fdae9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java @@ -93,7 +93,9 @@ public class VanChartAxisButtonPane extends BasicBeanPane { buttonPane.add(pane); } - pane.add(indexList_Y.get(i)); + if(pane != null) { + pane.add(indexList_Y.get(i)); + } } if(popupMenu != null){ From edd31480c6cb9b0803f53a0db038e1b85dad610e Mon Sep 17 00:00:00 2001 From: pengda Date: Wed, 28 Aug 2019 17:02:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?sonar=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D,?= =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java | 1 - .../java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java | 1 - .../java/com/fr/van/chart/column/VanChartColumnPlotPane.java | 1 - .../java/com/fr/van/chart/custom/VanChartCustomPlotPane.java | 4 ++-- .../designer/style/axis/component/VanChartAxisButtonPane.java | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java index ecff46354..a9aad22e2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bar/VanChartBarPlotPane.java @@ -65,7 +65,6 @@ public class VanChartBarPlotPane extends AbstractVanChartTypePane { newPlot = (VanChartColumnPlot)barChart[i].getPlot(); } } - Plot cloned = null; try { if(newPlot != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java index 21ae109a4..f60f2948a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java @@ -77,7 +77,6 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane { newPlot = (VanChartBubblePlot)bubbleChart[i].getPlot(); } } - Plot cloned = null; try { if(newPlot != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java index 2d8cccd64..be16a7662 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotPane.java @@ -66,7 +66,6 @@ public class VanChartColumnPlotPane extends AbstractVanChartTypePane { newPlot = (VanChartColumnPlot)columnChart[i].getPlot(); } } - Plot cloned = null; try { if(newPlot != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index 5e3bc935c..f93c29945 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -261,9 +261,9 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { } Plot cloned = null; try { - if(newPlot != null) { + if(newPlot != null) { cloned = (Plot) newPlot.clone(); - } + } } catch (CloneNotSupportedException e) { FineLoggerFactory.getLogger().error("Error In ScatterChart"); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java index 87e8fdae9..69e2357a9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java @@ -92,7 +92,6 @@ public class VanChartAxisButtonPane extends BasicBeanPane { pane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); buttonPane.add(pane); } - if(pane != null) { pane.add(indexList_Y.get(i)); }