From 66d86cb8dab832860b4dc8c23d4059f395960860 Mon Sep 17 00:00:00 2001 From: Josh Micich Date: Tue, 22 Dec 2009 00:13:56 +0000 Subject: [PATCH] put field initialisation in Workbook constructor git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@893045 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/model/Workbook.java | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/java/org/apache/poi/hssf/model/Workbook.java b/src/java/org/apache/poi/hssf/model/Workbook.java index e03e689cb4..eba4d100d1 100644 --- a/src/java/org/apache/poi/hssf/model/Workbook.java +++ b/src/java/org/apache/poi/hssf/model/Workbook.java @@ -128,13 +128,13 @@ public final class Workbook { /** * this contains the Worksheet record objects */ - private final WorkbookRecordList records = new WorkbookRecordList(); + private final WorkbookRecordList records; /** * this contains a reference to the SSTRecord so that new stings can be added * to it. */ - protected SSTRecord sst = null; + protected SSTRecord sst; private LinkTable linkTable; // optionally occurs if there are references in the document. (4.10.3) @@ -143,26 +143,36 @@ public final class Workbook { * holds the "boundsheet" records (aka bundlesheet) so that they can have their * reference to their "BOF" marker */ - private final List boundsheets = new ArrayList(); - private final List formats = new ArrayList(); - private final List hyperlinks = new ArrayList(); + private final List boundsheets; + private final List formats; + private final List hyperlinks; - protected int numxfs = 0; // hold the number of extended format records - protected int numfonts = 0; // hold the number of font records - private int maxformatid = -1; // holds the max format id - private boolean uses1904datewindowing = false; // whether 1904 date windowing is being used - private DrawingManager2 drawingManager; - private List escherBSERecords = new ArrayList(); + /** the number of extended format records */ + private int numxfs; + /** the number of font records */ + private int numfonts; + /** holds the max format id */ + private int maxformatid; + /** whether 1904 date windowing is being used */ + private boolean uses1904datewindowing; + private DrawingManager2 drawingManager; + private List escherBSERecords; private WindowOneRecord windowOne; private FileSharingRecord fileShare; private WriteAccessRecord writeAccess; private WriteProtectRecord writeProtect; - /** - * Creates new Workbook with no intitialization --useless right now - * @see #createWorkbook(List) - */ - public Workbook() { + private Workbook() { + records = new WorkbookRecordList(); + + boundsheets = new ArrayList(); + formats = new ArrayList(); + hyperlinks = new ArrayList(); + numxfs = 0; + numfonts = 0; + maxformatid = -1; + uses1904datewindowing = false; + escherBSERecords = new ArrayList(); } /**