From 2c479b4967b22b877a86f9bd6ec4ef5c4f85510f Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 15 Jul 2022 21:06:30 +0000 Subject: [PATCH] [github-347] make some inner classes static to save memory. Thanks to XenoAmess. This closes #347 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902749 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java | 2 +- .../org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java | 2 +- poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java b/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java index a88c0e50ec..4669e2e707 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xddf/usermodel/chart/XDDFChartData.java @@ -142,7 +142,7 @@ public abstract class XDDFChartData { public abstract XDDFChartData.Series addSeries(XDDFDataSource category, XDDFNumericalDataSource values); - public abstract class Series { + public abstract static class Series { protected abstract CTSerTx getSeriesText(); public abstract void setShowLeaderLines(boolean showLeaderLines); diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java index 2d6e57e049..3fa96264f0 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/eventusermodel/TestXSSFBReader.java @@ -165,7 +165,7 @@ class TestXSSFBReader { } - private class TestSheetHandler implements XSSFSheetXMLHandler.SheetContentsHandler { + private static class TestSheetHandler implements XSSFSheetXMLHandler.SheetContentsHandler { private final StringBuilder sb = new StringBuilder(); void startSheet(String sheetName) { diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java index 38266f409d..c8e9aabd74 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFChart.java @@ -1120,7 +1120,7 @@ public final class HSSFChart { } } - linkedDataRecord.setFormulaOfLink(ptgList.toArray(new Ptg[0])); + linkedDataRecord.setFormulaOfLink(ptgList.toArray(Ptg.EMPTY_PTG_ARRAY)); return rowCount * colCount; } -- 2.39.5