From 0b870a726d5a6d18f06194f06b8d8909bb10ddb1 Mon Sep 17 00:00:00 2001 From: Maksim Date: Tue, 27 Aug 2019 10:28:34 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-20323=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 --- .../design/mainframe/chart/gui/type/AreaPlotPane.java | 4 +++- .../design/mainframe/chart/gui/type/BarPlotPane.java | 10 ++++++---- .../mainframe/chart/gui/type/ColumnPlotPane.java | 10 ++++++---- .../design/mainframe/chart/gui/type/MeterPlotPane.java | 10 ++++++---- .../com/fr/van/chart/area/VanChartAreaPlotPane.java | 10 ++++++---- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java index a50bc52b5..483a4f09f 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java @@ -114,7 +114,9 @@ public class AreaPlotPane extends AbstractDeprecatedChartTypePane { ((Area3DPlot)plot).setStacked(true); ((Area3DPlot)plot).getyAxis().setPercentage(true); } - createAreaCondition(plot); + if(plot != null) { + createAreaCondition(plot); + } return plot; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java index cd5e1b4d6..1a3808a6a 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java @@ -97,10 +97,12 @@ public class BarPlotPane extends AbstractBarPane{ } Plot cloned = null; - try { - cloned = (Plot)newPlot.clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error("Error In ColumnChart"); + if(newPlot != null) { + try { + cloned = (Plot) newPlot.clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error In ColumnChart"); + } } return cloned; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java index 55de24714..e421bdeba 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java @@ -94,10 +94,12 @@ public class ColumnPlotPane extends AbstractBarPane{ } Plot cloned = null; - try { - cloned = (Plot)newPlot.clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error("Error In ColumnChart"); + if(newPlot != null) { + try { + cloned = (Plot) newPlot.clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error In ColumnChart"); + } } return cloned; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java index a02bcf5d1..94527c04b 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java @@ -66,10 +66,12 @@ public class MeterPlotPane extends AbstractDeprecatedChartTypePane { } Plot cloned = null; - try { - cloned = (Plot)newPlot.clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error("Error In ColumnChart"); + if(newPlot != null) { + try { + cloned = (Plot) newPlot.clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error In ColumnChart"); + } } return cloned; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java index 2642daa28..3d655d005 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaPlotPane.java @@ -68,10 +68,12 @@ public class VanChartAreaPlotPane extends AbstractVanChartTypePane { } } Plot cloned = null; - try { - cloned = (Plot) newPlot.clone(); - } catch (CloneNotSupportedException e) { - FineLoggerFactory.getLogger().error("Error In AreaChart"); + if(newPlot != null) { + try { + cloned = (Plot) newPlot.clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error In AreaChart"); + } } return cloned; }