From e98e3e2cda6b2748a3158e39881cc8c43bcbe2bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 06:19:42 +0000 Subject: [PATCH 1/5] Bump org.jenkins-ci.plugins:plugin from 5.9 to 5.12 Bumps [org.jenkins-ci.plugins:plugin](https://github.com/jenkinsci/plugin-pom) from 5.9 to 5.12. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](https://github.com/jenkinsci/plugin-pom/compare/plugin-5.9...plugin-5.12) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-version: '5.12' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 45be857..bfdfbe5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 5.9 + 5.12 From 5dc3cd2b9d120ba2ddecbee4863929ca2f200bad Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 1 May 2025 11:09:48 -0600 Subject: [PATCH 2/5] Format with spotless --- .../java/hudson/plugins/plot/CSVSeries.java | 14 ++---- src/main/java/hudson/plugins/plot/Plot.java | 50 +++++++++++-------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/main/java/hudson/plugins/plot/CSVSeries.java b/src/main/java/hudson/plugins/plot/CSVSeries.java index 986bf06..b9b7515 100644 --- a/src/main/java/hudson/plugins/plot/CSVSeries.java +++ b/src/main/java/hudson/plugins/plot/CSVSeries.java @@ -280,18 +280,12 @@ private boolean excludePoint(final String label, int index) { boolean retVal = switch (inclusionFlag) { - case INCLUDE_BY_STRING -> - // if the set contains it, don't exclude it. - !checkExclusionSet(label); - case EXCLUDE_BY_STRING -> - // if the set doesn't contain it, exclude it. - checkExclusionSet(label); + case INCLUDE_BY_STRING -> !checkExclusionSet(label); // if the set contains it, don't exclude it. + case EXCLUDE_BY_STRING -> checkExclusionSet(label); // if the set doesn't contain it, exclude it. case INCLUDE_BY_COLUMN -> - // if the set contains it, don't exclude it. - !(colExclusionSet.contains(index)); + !(colExclusionSet.contains(index)); // if the set contains it, don't exclude it. case EXCLUDE_BY_COLUMN -> - // if the set doesn't contain it, don't exclude it. - colExclusionSet.contains(index); + colExclusionSet.contains(index); // if the set doesn't contain it, don't exclude it. default -> false; }; diff --git a/src/main/java/hudson/plugins/plot/Plot.java b/src/main/java/hudson/plugins/plot/Plot.java index 17c33ba..7839229 100644 --- a/src/main/java/hudson/plugins/plot/Plot.java +++ b/src/main/java/hudson/plugins/plot/Plot.java @@ -896,26 +896,36 @@ private void generatePlot(boolean forceGenerate) { */ private JFreeChart createChart(PlotCategoryDataset dataset) { return switch (ChartStyle.forName(getUrlStyle())) { - case AREA -> ChartFactory.createAreaChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case BAR -> ChartFactory.createBarChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case BAR_3D -> ChartFactory.createBarChart3D( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case LINE_3D -> ChartFactory.createLineChart3D( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case LINE_SIMPLE -> ChartFactory.createLineChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case STACKED_AREA -> ChartFactory.createStackedAreaChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case STACKED_BAR -> ChartFactory.createStackedBarChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case STACKED_BAR_3D -> ChartFactory.createStackedBarChart3D( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - case WATERFALL -> ChartFactory.createWaterfallChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); - default -> ChartFactory.createLineChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case AREA -> + ChartFactory.createAreaChart( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case BAR -> + ChartFactory.createBarChart( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case BAR_3D -> + ChartFactory.createBarChart3D( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case LINE_3D -> + ChartFactory.createLineChart3D( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case LINE_SIMPLE -> + ChartFactory.createLineChart( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case STACKED_AREA -> + ChartFactory.createStackedAreaChart( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case STACKED_BAR -> + ChartFactory.createStackedBarChart( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case STACKED_BAR_3D -> + ChartFactory.createStackedBarChart3D( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + case WATERFALL -> + ChartFactory.createWaterfallChart( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + default -> + ChartFactory.createLineChart( + getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); }; } From 4e3537d2db3522c7b7f95d2d9064993715870dba Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 1 May 2025 11:36:57 -0600 Subject: [PATCH 3/5] Improve failure log output --- src/main/java/hudson/plugins/plot/Plot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/hudson/plugins/plot/Plot.java b/src/main/java/hudson/plugins/plot/Plot.java index 7839229..71fd4cf 100644 --- a/src/main/java/hudson/plugins/plot/Plot.java +++ b/src/main/java/hudson/plugins/plot/Plot.java @@ -417,7 +417,7 @@ public Double getDoubleFromString(String input) { } catch (NumberFormatException nfe) { LOGGER.log( Level.INFO, - "Failed to parse Double value from String." + " Not a problem, result already set", + "Failed to parse double from '" + input + "'. Not a problem, result already set", nfe); } } From 804e7d48629cd3725a3db9ea021402e48bcdfc9d Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 1 May 2025 11:59:02 -0600 Subject: [PATCH 4/5] Modify the affected lines --- src/main/java/hudson/plugins/plot/Plot.java | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/hudson/plugins/plot/Plot.java b/src/main/java/hudson/plugins/plot/Plot.java index 71fd4cf..8c7acea 100644 --- a/src/main/java/hudson/plugins/plot/Plot.java +++ b/src/main/java/hudson/plugins/plot/Plot.java @@ -5,6 +5,8 @@ */ package hudson.plugins.plot; +import static org.jfree.chart.plot.PlotOrientation.VERTICAL; + import com.opencsv.CSVReader; import com.opencsv.CSVWriter; import com.opencsv.exceptions.CsvValidationException; @@ -49,7 +51,6 @@ import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.DefaultDrawingSupplier; import org.jfree.chart.plot.DrawingSupplier; -import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.renderer.category.AbstractCategoryItemRenderer; import org.jfree.chart.renderer.category.LineAndShapeRenderer; import org.kohsuke.stapler.DataBoundConstructor; @@ -898,34 +899,34 @@ private JFreeChart createChart(PlotCategoryDataset dataset) { return switch (ChartStyle.forName(getUrlStyle())) { case AREA -> ChartFactory.createAreaChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case BAR -> ChartFactory.createBarChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case BAR_3D -> ChartFactory.createBarChart3D( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case LINE_3D -> ChartFactory.createLineChart3D( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case LINE_SIMPLE -> ChartFactory.createLineChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case STACKED_AREA -> ChartFactory.createStackedAreaChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case STACKED_BAR -> ChartFactory.createStackedBarChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case STACKED_BAR_3D -> ChartFactory.createStackedBarChart3D( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); case WATERFALL -> ChartFactory.createWaterfallChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); default -> ChartFactory.createLineChart( - getURLTitle(), null, getYaxis(), dataset, PlotOrientation.VERTICAL, hasLegend(), true, false); + getURLTitle(), null, getYaxis(), dataset, VERTICAL, hasLegend(), true, false); }; } From 4d9adccb3ba2ade8e256d181126c98db54b5502b Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 1 May 2025 15:20:43 -0600 Subject: [PATCH 5/5] Skip spotless checking temporarily --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bfdfbe5..9c35e61 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 2.479 ${jenkins.baseline}.3 - false + true