From f27cb3354d5db1ebacc1624b7d2c32e4c1ad9343 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sat, 16 Sep 2017 08:22:59 +0000 Subject: [PATCH] Remove unnecessary initialization of members git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808510 13f79535-47bb-0310-9956-ffa450edef68 --- .../examples/AddDimensionedImage.java | 6 +-- .../hssf/usermodel/examples/InCellLists.java | 4 +- .../org/apache/poi/hssf/view/SVBorder.java | 18 +++---- .../poi/hssf/view/SVTableCellRenderer.java | 2 +- .../apache/poi/hssf/view/SVTableModel.java | 4 +- .../src/org/apache/poi/hssf/view/SViewer.java | 4 +- .../poi/ss/examples/AddDimensionedImage.java | 6 +-- .../src/org/apache/poi/ss/examples/ToCSV.java | 14 ++--- .../poi/xssf/eventusermodel/XLSX2CSV.java | 2 +- .../usermodel/examples/UpdateEmbeddedDoc.java | 4 +- .../poi/ss/excelant/ExcelAntEvaluateCell.java | 4 +- .../apache/poi/ss/excelant/ExcelAntTask.java | 2 +- .../apache/poi/ss/excelant/ExcelAntTest.java | 4 +- .../excelant/MockExcelAntWorkbookHandler.java | 4 +- .../util/TestExcelAntEvaluationResult.java | 4 +- .../apache/poi/stress/HPSFFileHandler.java | 6 +-- src/java/org/apache/poi/POITextExtractor.java | 2 +- .../poi/ddf/EscherClientAnchorRecord.java | 2 +- .../org/apache/poi/ddf/EscherColorRef.java | 2 +- .../org/apache/poi/hpsf/ClipboardData.java | 2 +- src/java/org/apache/poi/hpsf/Thumbnail.java | 2 +- .../apache/poi/hssf/dev/FormulaViewer.java | 2 +- .../eventusermodel/EventWorkbookBuilder.java | 2 +- .../extractor/EventBasedExcelExtractor.java | 4 +- .../poi/hssf/extractor/ExcelExtractor.java | 4 +- .../apache/poi/hssf/model/InternalSheet.java | 16 +++--- .../poi/hssf/model/WorkbookRecordList.java | 18 +++---- .../apache/poi/hssf/record/FontRecord.java | 2 +- .../apache/poi/hssf/record/FtCfSubRecord.java | 2 +- .../poi/hssf/record/FtPioGrbitSubRecord.java | 2 +- .../hssf/record/RecordFactoryInputStream.java | 2 +- .../aggregates/RowRecordsAggregate.java | 2 +- .../aggregates/ValueRecordsAggregate.java | 4 +- .../record/cf/ColorGradientFormatting.java | 2 +- .../poi/hssf/record/cf/DataBarFormatting.java | 6 +-- .../record/crypto/Biff8DecryptingStream.java | 2 +- .../apache/poi/hssf/usermodel/HSSFAnchor.java | 8 +-- .../poi/hssf/usermodel/HSSFDataFormat.java | 2 +- .../hssf/usermodel/HSSFDataValidation.java | 2 +- .../poi/hssf/usermodel/HSSFWorkbook.java | 2 +- .../poifs/crypt/ChunkedCipherInputStream.java | 2 +- .../crypt/ChunkedCipherOutputStream.java | 2 +- .../poi/poifs/crypt/DataSpaceMapUtils.java | 12 ++--- .../poi/poifs/crypt/xor/XORDecryptor.java | 4 +- .../poi/poifs/crypt/xor/XOREncryptor.java | 4 +- .../poifs/eventfilesystem/POIFSReader.java | 2 +- .../poifs/filesystem/DocumentDescriptor.java | 2 +- .../poi/poifs/filesystem/Ole10Native.java | 4 +- .../poifs/filesystem/POIFSDocumentPath.java | 2 +- .../poi/ss/format/CellDateFormatter.java | 2 +- .../org/apache/poi/ss/util/SheetBuilder.java | 4 +- .../apache/poi/ss/util/cellwalk/CellWalk.java | 6 +-- .../apache/poi/util/BoundedInputStream.java | 2 +- .../org/apache/poi/util/CommonsLogger.java | 2 +- src/java/org/apache/poi/util/IntList.java | 2 +- .../poi/util/LittleEndianCP950Reader.java | 2 +- .../org/apache/poi/util/POILogFactory.java | 2 +- .../apache/poi/util/ReplacingInputStream.java | 6 +-- src/java/org/apache/poi/util/StringUtil.java | 2 +- .../org/apache/poi/POIXMLDocumentPart.java | 2 +- .../apache/poi/openxml4j/opc/OPCPackage.java | 2 +- .../PackagePropertiesMarshaller.java | 2 +- .../poi/openxml4j/util/ZipSecureFile.java | 4 +- .../poi/poifs/crypt/dsig/SignatureConfig.java | 16 +++--- .../poi/poifs/crypt/dsig/SignatureInfo.java | 6 +-- .../poi/xdgf/usermodel/XDGFDocument.java | 8 +-- .../apache/poi/xdgf/usermodel/XDGFMaster.java | 2 +- .../apache/poi/xdgf/usermodel/XDGFPage.java | 2 +- .../apache/poi/xdgf/usermodel/XDGFShape.java | 54 +++++++++---------- .../apache/poi/xdgf/usermodel/XDGFSheet.java | 2 +- .../usermodel/section/CharacterSection.java | 4 +- .../usermodel/section/CombinedIterable.java | 4 +- .../usermodel/section/GeometrySection.java | 2 +- .../usermodel/section/geometry/ArcTo.java | 10 ++-- .../usermodel/section/geometry/Ellipse.java | 16 +++--- .../section/geometry/EllipticalArcTo.java | 18 +++---- .../section/geometry/InfiniteLine.java | 12 ++--- .../usermodel/section/geometry/LineTo.java | 8 +-- .../usermodel/section/geometry/MoveTo.java | 8 +-- .../usermodel/section/geometry/NURBSTo.java | 18 +++---- .../section/geometry/PolyLineTo.java | 10 ++-- .../section/geometry/RelCubBezTo.java | 16 +++--- .../section/geometry/RelEllipticalArcTo.java | 16 +++--- .../usermodel/section/geometry/RelLineTo.java | 8 +-- .../usermodel/section/geometry/RelMoveTo.java | 8 +-- .../section/geometry/RelQuadBezTo.java | 12 ++--- .../section/geometry/SplineKnot.java | 10 ++-- .../section/geometry/SplineStart.java | 16 +++--- .../shape/ShapeDebuggerRenderer.java | 2 +- .../extractor/XSLFPowerPointExtractor.java | 4 +- .../poi/xslf/usermodel/XSLFPictureData.java | 4 +- .../poi/xslf/usermodel/XSLFTableCell.java | 6 +-- .../poi/xssf/binary/XSSFBCommentsTable.java | 6 +-- .../poi/xssf/binary/XSSFBSheetHandler.java | 4 +- .../poi/xssf/binary/XSSFBStylesTable.java | 4 +- .../poi/xssf/eventusermodel/XSSFBReader.java | 2 +- .../XSSFBEventBasedExcelExtractor.java | 2 +- .../XSSFEventBasedExcelExtractor.java | 4 +- .../xssf/streaming/AutoSizeColumnTracker.java | 2 +- .../apache/poi/xssf/streaming/SXSSFRow.java | 6 +-- .../apache/poi/xssf/streaming/SXSSFSheet.java | 4 +- .../usermodel/BaseXSSFEvaluationWorkbook.java | 2 +- .../poi/xssf/usermodel/XSSFConnector.java | 2 +- .../poi/xssf/usermodel/XSSFDrawing.java | 2 +- .../poi/xssf/usermodel/XSSFGraphicFrame.java | 2 +- .../poi/xssf/usermodel/XSSFObjectData.java | 2 +- .../poi/xssf/usermodel/XSSFPicture.java | 2 +- .../poi/xssf/usermodel/XSSFShapeGroup.java | 2 +- .../poi/xssf/usermodel/XSSFSimpleShape.java | 2 +- .../extensions/XSSFHeaderFooter.java | 2 +- .../poi/xwpf/extractor/XWPFWordExtractor.java | 2 +- .../xwpf/usermodel/PositionInParagraph.java | 2 +- .../poi/xwpf/usermodel/XWPFTableCell.java | 8 +-- .../poi/poifs/crypt/TestSignatureInfo.java | 4 +- .../poi/sl/draw/TestDrawPictureShape.java | 2 +- .../poi/xslf/usermodel/TestPPTX2PNG.java | 2 +- .../poi/xslf/usermodel/TestXSLFTextShape.java | 2 +- .../apache/poi/hdgf/HDGFLZWCompressor.java | 12 ++--- .../hdgf/streams/CompressedStreamStore.java | 2 +- .../poi/hemf/extractor/HemfExtractor.java | 2 +- .../extractor/PublisherTextExtractor.java | 2 +- .../org/apache/poi/hslf/blip/Metafile.java | 2 +- .../hslf/extractor/PowerPointExtractor.java | 6 +-- .../textproperties/TextPropCollection.java | 4 +- .../poi/hslf/record/EscherPlaceholder.java | 6 +-- .../poi/hslf/record/OEPlaceholderAtom.java | 2 +- .../poi/hslf/record/SSSlideInfoAtom.java | 12 ++--- .../poi/hslf/record/StyleTextPropAtom.java | 2 +- .../poi/hslf/record/TextSpecInfoRun.java | 2 +- .../poi/hslf/usermodel/HSLFFontInfo.java | 4 +- .../usermodel/HSLFSlideShowEncrypted.java | 2 +- .../poi/hslf/usermodel/HSLFSlideShowImpl.java | 2 +- .../poi/hslf/usermodel/HSLFTextParagraph.java | 2 +- .../src/org/apache/poi/hsmf/MAPIMessage.java | 2 +- .../converter/AbstractExcelConverter.java | 4 +- .../hssf/converter/ExcelToHtmlConverter.java | 6 +-- .../poi/hwmf/draw/HwmfDrawProperties.java | 12 ++--- .../poi/hwmf/draw/HwmfSLImageRenderer.java | 4 +- .../apache/poi/hwmf/record/HwmfBitmapDib.java | 2 +- .../poi/hwpf/converter/WordToFoConverter.java | 2 +- .../hwpf/converter/WordToTextConverter.java | 4 +- .../org/apache/poi/hwpf/model/FontTable.java | 2 +- .../poi/hwpf/usermodel/BookmarksImpl.java | 4 +- .../apache/poi/hwpf/usermodel/HWPFList.java | 2 +- .../poi/hwpf/usermodel/HeaderStories.java | 2 +- .../apache/poi/hwpf/usermodel/NotesImpl.java | 2 +- .../hwpf/usermodel/ParagraphProperties.java | 2 +- .../poi/hwpf/usermodel/PictureRunMapper.java | 2 +- .../org/apache/poi/hwpf/usermodel/Table.java | 2 +- .../apache/poi/hwpf/usermodel/TableRow.java | 2 +- .../apache/poi/hdgf/streams/StreamTest.java | 2 +- .../org/apache/poi/hwmf/TestHwmfParsing.java | 2 +- .../poi/hwpf/model/TestCHPBinTable.java | 2 +- .../hwpf/model/TestDocumentProperties.java | 2 +- .../hwpf/model/TestFileInformationBlock.java | 2 +- .../apache/poi/hwpf/model/TestFontTable.java | 2 +- .../apache/poi/hwpf/model/TestPlexOfCps.java | 2 +- .../apache/poi/hwpf/model/TestStyleSheet.java | 2 +- .../poi/hwpf/usermodel/TestBorderCode.java | 2 +- .../poi/hssf/usermodel/TestCellStyle.java | 2 +- .../usermodel/TestFormulaEvaluatorBugs.java | 2 +- .../poi/poifs/storage/TestRawDataBlock.java | 2 +- .../poi/ss/util/cellwalk/TestCellWalk.java | 4 +- .../org/apache/poi/util/TestIOUtils.java | 6 +-- .../org/apache/poi/util/TestPOILogger.java | 2 +- 165 files changed, 394 insertions(+), 394 deletions(-) diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java index d9896a712..84898383b 100644 --- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java +++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/AddDimensionedImage.java @@ -794,9 +794,9 @@ public class AddDimensionedImage { */ public class ClientAnchorDetail { - public int fromIndex = 0; - public int toIndex = 0; - public int inset = 0; + public int fromIndex; + public int toIndex; + public int inset; /** * Create a new instance of the ClientAnchorDetail class using the diff --git a/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java b/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java index b25044111..c568a6ed2 100644 --- a/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java +++ b/src/examples/src/org/apache/poi/hssf/usermodel/examples/InCellLists.java @@ -512,8 +512,8 @@ public class InCellLists { */ public final class MultiLevelListItem { - private String itemText = null; - private ArrayList lowerLevelItems = null; + private String itemText; + private ArrayList lowerLevelItems; /** * Create a new instance of the MultiLevelListItem class using the diff --git a/src/examples/src/org/apache/poi/hssf/view/SVBorder.java b/src/examples/src/org/apache/poi/hssf/view/SVBorder.java index 273ed07fd..bb19bff82 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVBorder.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVBorder.java @@ -33,19 +33,19 @@ import org.apache.poi.ss.usermodel.BorderStyle; * @author Jason Height */ public class SVBorder extends AbstractBorder { - private Color northColor = null; - private Color eastColor = null; - private Color southColor = null; - private Color westColor = null; + private Color northColor; + private Color eastColor; + private Color southColor; + private Color westColor; private BorderStyle northBorderType = BorderStyle.NONE; private BorderStyle eastBorderType = BorderStyle.NONE; private BorderStyle southBorderType = BorderStyle.NONE; private BorderStyle westBorderType = BorderStyle.NONE; - private boolean northBorder=false; - private boolean eastBorder=false; - private boolean southBorder=false; - private boolean westBorder=false; - private boolean selected = false; + private boolean northBorder; + private boolean eastBorder; + private boolean southBorder; + private boolean westBorder; + private boolean selected; public void setBorder(Color northColor, Color eastColor, Color southColor, Color westColor, diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java b/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java index 1448c5363..fe7163c8c 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVTableCellRenderer.java @@ -56,7 +56,7 @@ public class SVTableCellRenderer extends JLabel protected SVBorder cellBorder = new SVBorder(); - private HSSFWorkbook wb = null; + private HSSFWorkbook wb; /** This class holds the references to the predefined cell formats. */ diff --git a/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java b/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java index 25ac83fc5..7c741aac7 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java +++ b/src/examples/src/org/apache/poi/hssf/view/SVTableModel.java @@ -34,8 +34,8 @@ import org.apache.poi.hssf.usermodel.HSSFCell; */ public class SVTableModel extends AbstractTableModel { - private HSSFSheet st = null; - int maxcol = 0; + private HSSFSheet st; + int maxcol; public SVTableModel(HSSFSheet st, int maxcol) { this.st = st; diff --git a/src/examples/src/org/apache/poi/hssf/view/SViewer.java b/src/examples/src/org/apache/poi/hssf/view/SViewer.java index a32399275..1d3fefdff 100644 --- a/src/examples/src/org/apache/poi/hssf/view/SViewer.java +++ b/src/examples/src/org/apache/poi/hssf/view/SViewer.java @@ -40,8 +40,8 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; */ public class SViewer extends JApplet { private SViewerPanel panel; - boolean isStandalone = false; - String filename = null; + boolean isStandalone; + String filename; /**Get a parameter value*/ public String getParameter(String key, String def) { diff --git a/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java b/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java index 4e644cda8..d4f8e0105 100644 --- a/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java +++ b/src/examples/src/org/apache/poi/ss/examples/AddDimensionedImage.java @@ -864,9 +864,9 @@ public class AddDimensionedImage { */ public class ClientAnchorDetail { - public int fromIndex = 0; - public int toIndex = 0; - public int inset = 0; + public int fromIndex; + public int toIndex; + public int inset; /** * Create a new instance of the ClientAnchorDetail class using the diff --git a/src/examples/src/org/apache/poi/ss/examples/ToCSV.java b/src/examples/src/org/apache/poi/ss/examples/ToCSV.java index b6c5ea972..1a9879f20 100644 --- a/src/examples/src/org/apache/poi/ss/examples/ToCSV.java +++ b/src/examples/src/org/apache/poi/ss/examples/ToCSV.java @@ -132,13 +132,13 @@ import org.apache.poi.ss.usermodel.WorkbookFactory; */ public class ToCSV { - private Workbook workbook = null; - private ArrayList> csvData = null; - private int maxRowWidth = 0; - private int formattingConvention = 0; - private DataFormatter formatter = null; - private FormulaEvaluator evaluator = null; - private String separator = null; + private Workbook workbook; + private ArrayList> csvData; + private int maxRowWidth; + private int formattingConvention; + private DataFormatter formatter; + private FormulaEvaluator evaluator; + private String separator; private static final String CSV_FILE_EXTENSION = ".csv"; private static final String DEFAULT_SEPARATOR = ","; diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java index 09ac0ed2c..22ee013cc 100644 --- a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java +++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java @@ -70,7 +70,7 @@ public class XLSX2CSV { * as a (basic) CSV. */ private class SheetToCSV implements SheetContentsHandler { - private boolean firstCellOfRow = false; + private boolean firstCellOfRow; private int currentRow = -1; private int currentCol = -1; diff --git a/src/examples/src/org/apache/poi/xwpf/usermodel/examples/UpdateEmbeddedDoc.java b/src/examples/src/org/apache/poi/xwpf/usermodel/examples/UpdateEmbeddedDoc.java index 4b1641b97..ad14d7271 100644 --- a/src/examples/src/org/apache/poi/xwpf/usermodel/examples/UpdateEmbeddedDoc.java +++ b/src/examples/src/org/apache/poi/xwpf/usermodel/examples/UpdateEmbeddedDoc.java @@ -49,8 +49,8 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument; */ public class UpdateEmbeddedDoc { - private XWPFDocument doc = null; - private File docFile = null; + private XWPFDocument doc; + private File docFile; private static final int SHEET_NUM = 0; private static final int ROW_NUM = 0; diff --git a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java index bf1334848..a624b98b5 100644 --- a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java +++ b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntEvaluateCell.java @@ -42,14 +42,14 @@ public class ExcelAntEvaluateCell extends Task { private double precision ; private double precisionToUse ; private double globalPrecision ; - private boolean requiredToPass = false ; + private boolean requiredToPass; private ExcelAntEvaluationResult result ; private ExcelAntWorkbookUtil wbUtil ; - private boolean showDelta = false ; + private boolean showDelta; public ExcelAntEvaluateCell() {} diff --git a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java index e9bb072e5..625d1a402 100644 --- a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java +++ b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTask.java @@ -37,7 +37,7 @@ public class ExcelAntTask extends Task { private String excelFileName ; - private boolean failOnError = false ; + private boolean failOnError; private ExcelAntWorkbookUtil workbookUtil ; diff --git a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java index fd8f93091..fc35eba08 100644 --- a/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java +++ b/src/excelant/java/org/apache/poi/ss/excelant/ExcelAntTest.java @@ -44,9 +44,9 @@ public class ExcelAntTest extends Task{ private double globalPrecision; - private boolean showSuccessDetails = false; + private boolean showSuccessDetails; - private boolean showFailureDetail = false; + private boolean showFailureDetail; LinkedList failureMessages; diff --git a/src/excelant/testcases/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java b/src/excelant/testcases/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java index 6e52e1d4b..cf4d8d7c0 100644 --- a/src/excelant/testcases/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java +++ b/src/excelant/testcases/org/apache/poi/ss/excelant/MockExcelAntWorkbookHandler.java @@ -22,8 +22,8 @@ import static org.junit.Assert.assertNotNull; import org.apache.poi.ss.usermodel.Workbook; public class MockExcelAntWorkbookHandler implements IExcelAntWorkbookHandler { - public static boolean executed = false; - public static Workbook workbook = null; + public static boolean executed; + public static Workbook workbook; @Override diff --git a/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntEvaluationResult.java b/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntEvaluationResult.java index 9c9213e52..7112f6aca 100644 --- a/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntEvaluationResult.java +++ b/src/excelant/testcases/org/apache/poi/ss/excelant/util/TestExcelAntEvaluationResult.java @@ -26,8 +26,8 @@ import org.junit.Test; public class TestExcelAntEvaluationResult { private ExcelAntEvaluationResult fixture; - private boolean completedWithError = false; - private boolean passed = false; + private boolean completedWithError; + private boolean passed; private double retValue = 1.1; private String errMessage = "error message"; private double delta = 2.2; diff --git a/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java index 5fe154c1d..d726e2647 100644 --- a/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/HPSFFileHandler.java @@ -46,7 +46,7 @@ import org.junit.Test; public class HPSFFileHandler extends POIFSFileHandler { private static final String NL = System.getProperty("line.separator"); - private static File copyOutput = null; + private static File copyOutput; static final Set EXCLUDES_HANDLE_ADD = unmodifiableHashSet( "spreadsheet/45290.xls", @@ -92,8 +92,8 @@ public class HPSFFileHandler extends POIFSFileHandler { try { return PropertySet.isPropertySetStream(dis); } finally { - dis.close();; - } + dis.close(); + } } @Override diff --git a/src/java/org/apache/poi/POITextExtractor.java b/src/java/org/apache/poi/POITextExtractor.java index 83e26be94..58cf5e6dd 100644 --- a/src/java/org/apache/poi/POITextExtractor.java +++ b/src/java/org/apache/poi/POITextExtractor.java @@ -32,7 +32,7 @@ import java.io.IOException; * @see org.apache.poi.hwpf.extractor.WordExtractor */ public abstract class POITextExtractor implements Closeable { - private Closeable fsToClose = null; + private Closeable fsToClose; /** * Retrieves all the text from the document. diff --git a/src/java/org/apache/poi/ddf/EscherClientAnchorRecord.java b/src/java/org/apache/poi/ddf/EscherClientAnchorRecord.java index deb11d698..b038c12d3 100644 --- a/src/java/org/apache/poi/ddf/EscherClientAnchorRecord.java +++ b/src/java/org/apache/poi/ddf/EscherClientAnchorRecord.java @@ -51,7 +51,7 @@ public class EscherClientAnchorRecord private short field_8_row2; private short field_9_dy2; private byte[] remainingData = new byte[0]; - private boolean shortRecord = false; + private boolean shortRecord; @Override public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) { diff --git a/src/java/org/apache/poi/ddf/EscherColorRef.java b/src/java/org/apache/poi/ddf/EscherColorRef.java index ceaf94cba..949a905c9 100644 --- a/src/java/org/apache/poi/ddf/EscherColorRef.java +++ b/src/java/org/apache/poi/ddf/EscherColorRef.java @@ -26,7 +26,7 @@ import org.apache.poi.util.LittleEndian; public class EscherColorRef { @SuppressWarnings("unused") private int opid = -1; - private int colorRef = 0; + private int colorRef; public enum SysIndexSource { /** Use the fill color of the shape. */ diff --git a/src/java/org/apache/poi/hpsf/ClipboardData.java b/src/java/org/apache/poi/hpsf/ClipboardData.java index 396a58277..3617c4ac6 100644 --- a/src/java/org/apache/poi/hpsf/ClipboardData.java +++ b/src/java/org/apache/poi/hpsf/ClipboardData.java @@ -28,7 +28,7 @@ import org.apache.poi.util.POILogger; class ClipboardData { private static final POILogger LOG = POILogFactory.getLogger( ClipboardData.class ); - private int _format = 0; + private int _format; private byte[] _value; ClipboardData() {} diff --git a/src/java/org/apache/poi/hpsf/Thumbnail.java b/src/java/org/apache/poi/hpsf/Thumbnail.java index a1faf3d08..87bd68228 100644 --- a/src/java/org/apache/poi/hpsf/Thumbnail.java +++ b/src/java/org/apache/poi/hpsf/Thumbnail.java @@ -123,7 +123,7 @@ public final class Thumbnail { *

A byte[] to hold a thumbnail image in ({@link * Variant#VT_CF VT_CF}) format.

*/ - private byte[] _thumbnailData = null; + private byte[] _thumbnailData; diff --git a/src/java/org/apache/poi/hssf/dev/FormulaViewer.java b/src/java/org/apache/poi/hssf/dev/FormulaViewer.java index 4ef3ede77..c506ad47b 100644 --- a/src/java/org/apache/poi/hssf/dev/FormulaViewer.java +++ b/src/java/org/apache/poi/hssf/dev/FormulaViewer.java @@ -42,7 +42,7 @@ import org.apache.poi.ss.formula.ptg.Ptg; public class FormulaViewer { private String file; - private boolean list=false; + private boolean list; /** Creates new FormulaViewer */ diff --git a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java index eb65517ce..ed0f8f246 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java @@ -116,7 +116,7 @@ public class EventWorkbookBuilder { private final HSSFListener childListener; private final List boundSheetRecords = new ArrayList(); private final List externSheetRecords = new ArrayList(); - private SSTRecord sstRecord = null; + private SSTRecord sstRecord; public SheetRecordCollectingListener(HSSFListener childListener) { this.childListener = childListener; diff --git a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java index f5475507a..1b6b93434 100644 --- a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java +++ b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java @@ -63,7 +63,7 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements org.apache.poi.ss.extractor.ExcelExtractor { private DirectoryNode _dir; boolean _includeSheetNames = true; - boolean _formulasNotResults = false; + boolean _formulasNotResults; public EventBasedExcelExtractor( DirectoryNode dir ) { @@ -167,7 +167,7 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or private int sheetNum = -1; private int rowNum; - private boolean outputNextStringValue = false; + private boolean outputNextStringValue; private int nextRow = -1; public TextListener() { diff --git a/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java index 0e7e31ac4..f313b96e3 100644 --- a/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java +++ b/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java @@ -58,8 +58,8 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p private final HSSFDataFormatter _formatter; private boolean _includeSheetNames = true; private boolean _shouldEvaluateFormulas = true; - private boolean _includeCellComments = false; - private boolean _includeBlankCells = false; + private boolean _includeCellComments; + private boolean _includeBlankCells; private boolean _includeHeadersFooters = true; public ExcelExtractor(HSSFWorkbook wb) { diff --git a/src/java/org/apache/poi/hssf/model/InternalSheet.java b/src/java/org/apache/poi/hssf/model/InternalSheet.java index 397c1f6e3..be21dff69 100644 --- a/src/java/org/apache/poi/hssf/model/InternalSheet.java +++ b/src/java/org/apache/poi/hssf/model/InternalSheet.java @@ -66,9 +66,9 @@ public final class InternalSheet { private static POILogger log = POILogFactory.getLogger(InternalSheet.class); private List _records; - protected PrintGridlinesRecord printGridlines = null; - protected PrintHeadersRecord printHeaders = null; - protected GridsetRecord gridset = null; + protected PrintGridlinesRecord printGridlines; + protected PrintHeadersRecord printHeaders; + protected GridsetRecord gridset; private GutsRecord _gutsRecord; protected DefaultColWidthRecord defaultcolwidth = new DefaultColWidthRecord(); protected DefaultRowHeightRecord defaultrowheight = new DefaultRowHeightRecord(); @@ -80,8 +80,8 @@ public final class InternalSheet { */ private final WorksheetProtectionBlock _protectionBlock = new WorksheetProtectionBlock(); - protected WindowTwoRecord windowTwo = null; - protected SelectionRecord _selection = null; + protected WindowTwoRecord windowTwo; + protected SelectionRecord _selection; /** java object always present, but if empty no BIFF records are written */ private final MergedCellsTable _mergedCellsTable; /** always present in this POI object, not always written to Excel file */ @@ -90,13 +90,13 @@ public final class InternalSheet { private DimensionsRecord _dimensions; /** always present */ protected final RowRecordsAggregate _rowsAggregate; - private DataValidityTable _dataValidityTable= null; + private DataValidityTable _dataValidityTable; private ConditionalFormattingTable condFormatting; - private Iterator rowRecIterator = null; + private Iterator rowRecIterator; /** Add an UncalcedRecord if not true indicating formulas have not been calculated */ - protected boolean _isUncalced = false; + protected boolean _isUncalced; public static final byte PANE_LOWER_RIGHT = (byte)0; public static final byte PANE_UPPER_RIGHT = (byte)1; diff --git a/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java b/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java index b29d7268e..28c1e519b 100644 --- a/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java +++ b/src/java/org/apache/poi/hssf/model/WorkbookRecordList.java @@ -26,23 +26,23 @@ public final class WorkbookRecordList { private List records = new ArrayList(); /** holds the position of the protect record */ - private int protpos = 0; + private int protpos; /** holds the position of the last bound sheet */ - private int bspos = 0; + private int bspos; /** holds the position of the tabid record */ - private int tabpos = 0; + private int tabpos; /** hold the position of the last font record */ - private int fontpos = 0; + private int fontpos; /** hold the position of the last extended font record */ - private int xfpos = 0; + private int xfpos; /** holds the position of the backup record */ - private int backuppos = 0; + private int backuppos; /** holds the position of last name record */ - private int namepos = 0; + private int namepos; /** holds the position of sup book */ - private int supbookpos = 0; + private int supbookpos; /** holds the position of the extern sheet */ - private int externsheetPos = 0; + private int externsheetPos; /** hold the position of the palette, if applicable */ private int palettepos = -1; diff --git a/src/java/org/apache/poi/hssf/record/FontRecord.java b/src/java/org/apache/poi/hssf/record/FontRecord.java index 03efd8403..1af6142ed 100644 --- a/src/java/org/apache/poi/hssf/record/FontRecord.java +++ b/src/java/org/apache/poi/hssf/record/FontRecord.java @@ -58,7 +58,7 @@ public final class FontRecord extends StandardRecord { private byte field_6_underline; // 00none/01single/02double/21singleaccounting/22doubleaccounting private byte field_7_family; // ?? defined by windows api logfont structure? private byte field_8_charset; // ?? defined by windows api logfont structure? - private byte field_9_zero = 0; // must be 0 + private byte field_9_zero; // must be 0 /** possibly empty string never null */ private String field_11_font_name; diff --git a/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java b/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java index 87075c91c..7e202c083 100644 --- a/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java +++ b/src/java/org/apache/poi/hssf/record/FtCfSubRecord.java @@ -46,7 +46,7 @@ public final class FtCfSubRecord extends SubRecord implements Cloneable { */ public static final short UNSPECIFIED_BIT = (short)0xFFFF; - private short flags = 0; + private short flags; /** * Construct a new FtPioGrbitSubRecord and diff --git a/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java b/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java index c15a6cbdd..eaf8a5af2 100644 --- a/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java +++ b/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java @@ -83,7 +83,7 @@ public final class FtPioGrbitSubRecord extends SubRecord implements Cloneable { public static final int AUTO_LOAD_BIT = 1 << 9; - private short flags = 0; + private short flags; /** * Construct a new FtPioGrbitSubRecord and diff --git a/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java b/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java index 0a9616d71..7ec0c83dc 100644 --- a/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java +++ b/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java @@ -163,7 +163,7 @@ public final class RecordFactoryInputStream { /** * The most recent record that we gave to the user */ - private Record _lastRecord = null; + private Record _lastRecord; /** * The most recent DrawingRecord seen */ diff --git a/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java index 8a9782768..d1c12e0fc 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.java @@ -43,7 +43,7 @@ public final class RowRecordsAggregate extends RecordAggregate { // Cache values to speed up performance of // getStartRowNumberForBlock / getEndRowNumberForBlock, see Bugzilla 47405 - private RowRecord[] _rowRecordValues = null; + private RowRecord[] _rowRecordValues; /** Creates a new instance of ValueRecordsAggregate */ public RowRecordsAggregate() { diff --git a/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java index ac72b997c..95040905e 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java @@ -307,8 +307,8 @@ public final class ValueRecordsAggregate implements Iterable { - int curRowIndex = 0, curColIndex = -1; - int nextRowIndex = 0, nextColIndex = -1; + int curRowIndex, curColIndex = -1; + int nextRowIndex, nextColIndex = -1; public ValueIterator() { getNextPos(); diff --git a/src/java/org/apache/poi/hssf/record/cf/ColorGradientFormatting.java b/src/java/org/apache/poi/hssf/record/cf/ColorGradientFormatting.java index 5197d814f..02bfa3367 100644 --- a/src/java/org/apache/poi/hssf/record/cf/ColorGradientFormatting.java +++ b/src/java/org/apache/poi/hssf/record/cf/ColorGradientFormatting.java @@ -33,7 +33,7 @@ import org.apache.poi.util.POILogger; public final class ColorGradientFormatting implements Cloneable { private static POILogger log = POILogFactory.getLogger(ColorGradientFormatting.class); - private byte options = 0; + private byte options; private ColorGradientThreshold[] thresholds; private ExtendedColor[] colors; diff --git a/src/java/org/apache/poi/hssf/record/cf/DataBarFormatting.java b/src/java/org/apache/poi/hssf/record/cf/DataBarFormatting.java index 8810ef59c..60c1a521f 100644 --- a/src/java/org/apache/poi/hssf/record/cf/DataBarFormatting.java +++ b/src/java/org/apache/poi/hssf/record/cf/DataBarFormatting.java @@ -31,9 +31,9 @@ import org.apache.poi.util.POILogger; public final class DataBarFormatting implements Cloneable { private static POILogger log = POILogFactory.getLogger(DataBarFormatting.class); - private byte options = 0; - private byte percentMin = 0; - private byte percentMax = 0; + private byte options; + private byte percentMin; + private byte percentMax; private ExtendedColor color; private DataBarThreshold thresholdMin; private DataBarThreshold thresholdMax; diff --git a/src/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java b/src/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java index b8d8e393d..1b5ea03cc 100644 --- a/src/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java +++ b/src/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java @@ -39,7 +39,7 @@ public final class Biff8DecryptingStream implements BiffHeaderInput, LittleEndia private final EncryptionInfo info; private ChunkedCipherInputStream ccis; private final byte buffer[] = new byte[LittleEndianConsts.LONG_SIZE]; - private boolean shouldSkipEncryptionOnCurrentRecord = false; + private boolean shouldSkipEncryptionOnCurrentRecord; public Biff8DecryptingStream(InputStream in, int initialOffset, EncryptionInfo info) throws RecordFormatException { try { diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFAnchor.java b/src/java/org/apache/poi/hssf/usermodel/HSSFAnchor.java index a9e09bbe4..56c918af4 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFAnchor.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFAnchor.java @@ -30,8 +30,8 @@ import org.apache.poi.ss.usermodel.ChildAnchor; */ public abstract class HSSFAnchor implements ChildAnchor { - protected boolean _isHorizontallyFlipped = false; - protected boolean _isVerticallyFlipped = false; + protected boolean _isHorizontallyFlipped; + protected boolean _isVerticallyFlipped; public HSSFAnchor() { createEscherAnchor(); @@ -47,10 +47,10 @@ public abstract class HSSFAnchor implements ChildAnchor { public static HSSFAnchor createAnchorFromEscher(EscherContainerRecord container){ if (null != container.getChildById(EscherChildAnchorRecord.RECORD_ID)){ - return new HSSFChildAnchor((EscherChildAnchorRecord) container.getChildById(EscherChildAnchorRecord.RECORD_ID)); + return new HSSFChildAnchor(container.getChildById(EscherChildAnchorRecord.RECORD_ID)); } else { if (null != container.getChildById(EscherClientAnchorRecord.RECORD_ID)){ - return new HSSFClientAnchor((EscherClientAnchorRecord) container.getChildById(EscherClientAnchorRecord.RECORD_ID)); + return new HSSFClientAnchor(container.getChildById(EscherClientAnchorRecord.RECORD_ID)); } return null; } diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java index 7c3b636fd..b6276f0ba 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java @@ -44,7 +44,7 @@ public final class HSSFDataFormat implements DataFormat { private final Vector _formats = new Vector(); private final InternalWorkbook _workbook; - private boolean _movedBuiltins = false; // Flag to see if need to + private boolean _movedBuiltins; // Flag to see if need to // check the built in list // or if the regular list // has all entries. diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFDataValidation.java b/src/java/org/apache/poi/hssf/usermodel/HSSFDataValidation.java index 206ee11b9..40c0ada46 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFDataValidation.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFDataValidation.java @@ -35,7 +35,7 @@ public final class HSSFDataValidation implements DataValidation { private int _errorStyle = ErrorStyle.STOP; private boolean _emptyCellAllowed = true; - private boolean _suppress_dropdown_arrow = false; + private boolean _suppress_dropdown_arrow; private boolean _showPromptBox = true; private boolean _showErrorBox = true; private CellRangeAddressList _regions; diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index a705dc86a..69610c5a7 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -960,7 +960,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss private final class SheetIterator implements Iterator { final private Iterator it; - private T cursor = null; + private T cursor; @SuppressWarnings("unchecked") public SheetIterator() { it = (Iterator) _sheets.iterator(); diff --git a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java index ba60cb2fe..e71cbd412 100644 --- a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java +++ b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java @@ -41,7 +41,7 @@ public abstract class ChunkedCipherInputStream extends LittleEndianInputStream { private int lastIndex; private long pos; - private boolean chunkIsValid = false; + private boolean chunkIsValid; public ChunkedCipherInputStream(InputStream stream, long size, int chunkSize) throws GeneralSecurityException { diff --git a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java index 65579bebe..a846cca34 100644 --- a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java +++ b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java @@ -64,7 +64,7 @@ public abstract class ChunkedCipherOutputStream extends FilterOutputStream { // the cipher can't be final, because for the last chunk we change the padding // and therefore need to change the cipher too private Cipher cipher; - private boolean isClosed = false; + private boolean isClosed; public ChunkedCipherOutputStream(DirectoryNode dir, int chunkSize) throws IOException, GeneralSecurityException { super(null); diff --git a/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java b/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java index 9c377fa2d..2f5ccfd7a 100644 --- a/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java +++ b/src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java @@ -203,9 +203,9 @@ public class DataSpaceMapUtils { int transformType; String transformerId; String transformerName; - int readerVersionMajor = 1, readerVersionMinor = 0; - int updaterVersionMajor = 1, updaterVersionMinor = 0; - int writerVersionMajor = 1, writerVersionMinor = 0; + int readerVersionMajor = 1, readerVersionMinor; + int updaterVersionMajor = 1, updaterVersionMinor; + int writerVersionMajor = 1, writerVersionMinor; public TransformInfoHeader( int transformType, @@ -257,9 +257,9 @@ public class DataSpaceMapUtils { public static class DataSpaceVersionInfo implements EncryptionRecord { String featureIdentifier; - int readerVersionMajor = 1, readerVersionMinor = 0; - int updaterVersionMajor = 1, updaterVersionMinor = 0; - int writerVersionMajor = 1, writerVersionMinor = 0; + int readerVersionMajor = 1, readerVersionMinor; + int updaterVersionMajor = 1, updaterVersionMinor; + int writerVersionMajor = 1, writerVersionMinor; public DataSpaceVersionInfo(LittleEndianInput is) { featureIdentifier = readUnicodeLPP4(is); diff --git a/src/java/org/apache/poi/poifs/crypt/xor/XORDecryptor.java b/src/java/org/apache/poi/poifs/crypt/xor/XORDecryptor.java index 3eb66b549..26fc78d8b 100644 --- a/src/java/org/apache/poi/poifs/crypt/xor/XORDecryptor.java +++ b/src/java/org/apache/poi/poifs/crypt/xor/XORDecryptor.java @@ -101,8 +101,8 @@ public class XORDecryptor extends Decryptor implements Cloneable { private class XORCipherInputStream extends ChunkedCipherInputStream { private final int initialOffset; - private int recordStart = 0; - private int recordEnd = 0; + private int recordStart; + private int recordEnd; public XORCipherInputStream(InputStream stream, int initialPos) throws GeneralSecurityException { diff --git a/src/java/org/apache/poi/poifs/crypt/xor/XOREncryptor.java b/src/java/org/apache/poi/poifs/crypt/xor/XOREncryptor.java index 1c0834c8c..c090fe361 100644 --- a/src/java/org/apache/poi/poifs/crypt/xor/XOREncryptor.java +++ b/src/java/org/apache/poi/poifs/crypt/xor/XOREncryptor.java @@ -88,8 +88,8 @@ public class XOREncryptor extends Encryptor implements Cloneable { } private class XORCipherOutputStream extends ChunkedCipherOutputStream { - private int recordStart = 0; - private int recordEnd = 0; + private int recordStart; + private int recordEnd; public XORCipherOutputStream(OutputStream stream, int initialPos) throws IOException, GeneralSecurityException { super(stream, -1); diff --git a/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReader.java b/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReader.java index c236c4b83..c4aaecfe0 100644 --- a/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReader.java +++ b/src/java/org/apache/poi/poifs/eventfilesystem/POIFSReader.java @@ -51,7 +51,7 @@ public class POIFSReader { private final POIFSReaderRegistry registry; private boolean registryClosed; - private boolean notifyEmptyDirectories = false; + private boolean notifyEmptyDirectories; /** * Create a POIFSReader diff --git a/src/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java b/src/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java index cc9d7eb5e..303822421 100644 --- a/src/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java +++ b/src/java/org/apache/poi/poifs/filesystem/DocumentDescriptor.java @@ -30,7 +30,7 @@ public class DocumentDescriptor { private POIFSDocumentPath path; private String name; - private int hashcode = 0; + private int hashcode; /** * Trivial constructor diff --git a/src/java/org/apache/poi/poifs/filesystem/Ole10Native.java b/src/java/org/apache/poi/poifs/filesystem/Ole10Native.java index 7ccdf5ed2..5d197a800 100644 --- a/src/java/org/apache/poi/poifs/filesystem/Ole10Native.java +++ b/src/java/org/apache/poi/poifs/filesystem/Ole10Native.java @@ -42,11 +42,11 @@ public class Ole10Native { private short flags1 = 2; // 2 bytes, unknown, mostly [02 00] private String label; // ASCIIZ, stored in this field without the terminating zero private String fileName; // ASCIIZ, stored in this field without the terminating zero - private short flags2 = 0; // 2 bytes, unknown, mostly [00 00] + private short flags2; // 2 bytes, unknown, mostly [00 00] private short unknown1 = 3; // see below private String command; // ASCIIZ, stored in this field without the terminating zero private byte[] dataBuffer; // varying size, the actual native data - private short flags3 = 0; // some final flags? or zero terminators?, sometimes not there + private short flags3; // some final flags? or zero terminators?, sometimes not there /** * the field encoding mode - merely a try-and-error guess ... diff --git a/src/java/org/apache/poi/poifs/filesystem/POIFSDocumentPath.java b/src/java/org/apache/poi/poifs/filesystem/POIFSDocumentPath.java index 916267b65..2c35ac51e 100644 --- a/src/java/org/apache/poi/poifs/filesystem/POIFSDocumentPath.java +++ b/src/java/org/apache/poi/poifs/filesystem/POIFSDocumentPath.java @@ -36,7 +36,7 @@ public class POIFSDocumentPath private static final POILogger log = POILogFactory.getLogger(POIFSDocumentPath.class); private final String[] components; - private int hashcode = 0; //lazy-compute hashCode + private int hashcode; //lazy-compute hashCode /** * constructor for the path of a document that is not in the root diff --git a/src/java/org/apache/poi/ss/format/CellDateFormatter.java b/src/java/org/apache/poi/ss/format/CellDateFormatter.java index 4af6d6b4b..848a9e372 100644 --- a/src/java/org/apache/poi/ss/format/CellDateFormatter.java +++ b/src/java/org/apache/poi/ss/format/CellDateFormatter.java @@ -41,7 +41,7 @@ public class CellDateFormatter extends CellFormatter { private final Calendar EXCEL_EPOCH_CAL = LocaleUtil.getLocaleCalendar(1904, 0, 1); - private static /* final */ CellDateFormatter SIMPLE_DATE = null; + private static /* final */ CellDateFormatter SIMPLE_DATE; private class DatePartHandler implements CellFormatPart.PartHandler { private int mStart = -1; diff --git a/src/java/org/apache/poi/ss/util/SheetBuilder.java b/src/java/org/apache/poi/ss/util/SheetBuilder.java index ba80711e7..9dc0c6096 100644 --- a/src/java/org/apache/poi/ss/util/SheetBuilder.java +++ b/src/java/org/apache/poi/ss/util/SheetBuilder.java @@ -35,8 +35,8 @@ public class SheetBuilder { private final Workbook workbook; private final Object[][] cells; - private boolean shouldCreateEmptyCells = false; - private String sheetName = null; + private boolean shouldCreateEmptyCells; + private String sheetName; public SheetBuilder(Workbook workbook, Object[][] cells) { this.workbook = workbook; diff --git a/src/java/org/apache/poi/ss/util/cellwalk/CellWalk.java b/src/java/org/apache/poi/ss/util/cellwalk/CellWalk.java index b6fbbb3ff..c69294676 100644 --- a/src/java/org/apache/poi/ss/util/cellwalk/CellWalk.java +++ b/src/java/org/apache/poi/ss/util/cellwalk/CellWalk.java @@ -110,9 +110,9 @@ public class CellWalk { * @author Roman Kashitsyn */ private static class SimpleCellWalkContext implements CellWalkContext { - public long ordinalNumber = 0; - public int rowNumber = 0; - public int colNumber = 0; + public long ordinalNumber; + public int rowNumber; + public int colNumber; public long getOrdinalNumber() { return ordinalNumber; diff --git a/src/java/org/apache/poi/util/BoundedInputStream.java b/src/java/org/apache/poi/util/BoundedInputStream.java index 1ef84d9ff..8b5a7a8dd 100644 --- a/src/java/org/apache/poi/util/BoundedInputStream.java +++ b/src/java/org/apache/poi/util/BoundedInputStream.java @@ -42,7 +42,7 @@ public class BoundedInputStream extends InputStream { private final long max; /** the number of bytes already returned */ - private long pos = 0; + private long pos; /** the marked position */ private long mark = -1; diff --git a/src/java/org/apache/poi/util/CommonsLogger.java b/src/java/org/apache/poi/util/CommonsLogger.java index a204fde17..1825deaac 100644 --- a/src/java/org/apache/poi/util/CommonsLogger.java +++ b/src/java/org/apache/poi/util/CommonsLogger.java @@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory; public class CommonsLogger extends POILogger { private static final LogFactory _creator = LogFactory.getFactory(); - private Log log = null; + private Log log; @Override public void initialize(final String cat) diff --git a/src/java/org/apache/poi/util/IntList.java b/src/java/org/apache/poi/util/IntList.java index 08f024082..62276d920 100644 --- a/src/java/org/apache/poi/util/IntList.java +++ b/src/java/org/apache/poi/util/IntList.java @@ -47,7 +47,7 @@ public class IntList { private int[] _array; private int _limit; - private int fillval = 0; + private int fillval; private static final int _default_size = 128; /** diff --git a/src/java/org/apache/poi/util/LittleEndianCP950Reader.java b/src/java/org/apache/poi/util/LittleEndianCP950Reader.java index d3d29307c..61808afca 100644 --- a/src/java/org/apache/poi/util/LittleEndianCP950Reader.java +++ b/src/java/org/apache/poi/util/LittleEndianCP950Reader.java @@ -54,7 +54,7 @@ public class LittleEndianCP950Reader extends Reader { private int offset; private int trailing; private int leading; - int cnt = 0; + int cnt; //the char that is logically trailing in Big5 encoding //however in LittleEndian order, this is the first encountered. public LittleEndianCP950Reader(byte[] data) { diff --git a/src/java/org/apache/poi/util/POILogFactory.java b/src/java/org/apache/poi/util/POILogFactory.java index 1e34ccd29..34460702f 100644 --- a/src/java/org/apache/poi/util/POILogFactory.java +++ b/src/java/org/apache/poi/util/POILogFactory.java @@ -46,7 +46,7 @@ public final class POILogFactory { * The name of the class to use. Initialised the * first time we need it */ - static String _loggerClassName = null; + static String _loggerClassName; /** * Construct a POILogFactory. diff --git a/src/java/org/apache/poi/util/ReplacingInputStream.java b/src/java/org/apache/poi/util/ReplacingInputStream.java index 47c153432..884bd838f 100644 --- a/src/java/org/apache/poi/util/ReplacingInputStream.java +++ b/src/java/org/apache/poi/util/ReplacingInputStream.java @@ -35,9 +35,9 @@ public class ReplacingInputStream extends FilterInputStream { // while matching, this is where the bytes go. final int[] buf; - private int matchedIndex=0; - private int unbufferIndex=0; - private int replacedIndex=0; + private int matchedIndex; + private int unbufferIndex; + private int replacedIndex; private final byte[] pattern; private final byte[] replacement; diff --git a/src/java/org/apache/poi/util/StringUtil.java b/src/java/org/apache/poi/util/StringUtil.java index fa84f6ef5..30aee7a06 100644 --- a/src/java/org/apache/poi/util/StringUtil.java +++ b/src/java/org/apache/poi/util/StringUtil.java @@ -315,7 +315,7 @@ public class StringUtil { */ public static class StringsIterator implements Iterator { private String[] strings = {}; - private int position = 0; + private int position; public StringsIterator(String[] strings) { if (strings != null) { this.strings = strings.clone(); diff --git a/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java b/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java index 41435ec4a..a777887e9 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java +++ b/src/ooxml/java/org/apache/poi/POIXMLDocumentPart.java @@ -93,7 +93,7 @@ public class POIXMLDocumentPart { * Counter that provides the amount of incoming relations from other parts * to this part. */ - private int relationCounter = 0; + private int relationCounter; int incrementRelationCounter() { relationCounter++; diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java index 1389fb742..15031fbcf 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/OPCPackage.java @@ -116,7 +116,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable { /** * Flag if a modification is done to the document. */ - protected boolean isDirty = false; + protected boolean isDirty; /** * File path of this package. diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/PackagePropertiesMarshaller.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/PackagePropertiesMarshaller.java index 7a8f40072..613c6f020 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/PackagePropertiesMarshaller.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/PackagePropertiesMarshaller.java @@ -80,7 +80,7 @@ public class PackagePropertiesMarshaller implements PartMarshaller { PackagePropertiesPart propsPart; // The document - Document xmlDoc = null; + Document xmlDoc; /** * Marshall package core properties to an XML document. Always return diff --git a/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java b/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java index f5d2737c8..971ba3669 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/util/ZipSecureFile.java @@ -197,8 +197,8 @@ public class ZipSecureFile extends ZipFile { } public static class ThresholdInputStream extends PushbackInputStream { - long counter = 0; - long markPos = 0; + long counter; + long markPos; ThresholdInputStream cis; public ThresholdInputStream(InputStream is, ThresholdInputStream cis) { diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java index fa87be191..187272a90 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java @@ -83,12 +83,12 @@ public class SignatureConfig { * the optional signature policy service used for XAdES-EPES. */ private SignaturePolicyService signaturePolicyService; - private URIDereferencer uriDereferencer = null; + private URIDereferencer uriDereferencer; private String canonicalizationMethod = CanonicalizationMethod.INCLUSIVE; private boolean includeEntireCertificateChain = true; - private boolean includeIssuerSerial = false; - private boolean includeKeyValue = false; + private boolean includeIssuerSerial; + private boolean includeKeyValue; /** * the time-stamp service used for XAdES-T and XAdES-X. @@ -98,11 +98,11 @@ public class SignatureConfig { * timestamp service provider URL */ private String tspUrl; - private boolean tspOldProtocol = false; + private boolean tspOldProtocol; /** * if not defined, it's the same as the main digest */ - private HashAlgorithm tspDigestAlgo = null; + private HashAlgorithm tspDigestAlgo; private String tspUser; private String tspPass; private TimeStampServiceValidator tspValidator; @@ -121,8 +121,8 @@ public class SignatureConfig { /** * if not defined, it's the same as the main digest */ - private HashAlgorithm xadesDigestAlgo = null; - private String xadesRole = null; + private HashAlgorithm xadesDigestAlgo; + private String xadesRole; private String xadesSignatureId = "idSignedProperties"; private boolean xadesSignaturePolicyImplied = true; private String xadesCanonicalizationMethod = CanonicalizationMethod.EXCLUSIVE; @@ -150,7 +150,7 @@ public class SignatureConfig { * with certain namespaces, so this EventListener is used to interfere * with the marshalling process. */ - EventListener signatureMarshalListener = null; + EventListener signatureMarshalListener; /** * Map of namespace uris to prefix diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java index 9edb1c3bb..766f8e686 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java @@ -171,7 +171,7 @@ import org.xml.sax.SAXException; public class SignatureInfo implements SignatureConfigurable { private static final POILogger LOG = POILogFactory.getLogger(SignatureInfo.class); - private static boolean isInitialized = false; + private static boolean isInitialized; private SignatureConfig signatureConfig; @@ -376,8 +376,8 @@ public class SignatureInfo implements SignatureConfigurable { OPCPackage pkg = signatureConfig.getOpcPackage(); Iterator sigOrigRels = pkg.getRelationshipsByType(PackageRelationshipTypes.DIGITAL_SIGNATURE_ORIGIN).iterator(); - Iterator sigRels = null; - PackagePart sigPart = null; + Iterator sigRels; + PackagePart sigPart; public boolean hasNext() { while (sigRels == null || !sigRels.hasNext()) { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java index ba460cc13..1fe9515e3 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFDocument.java @@ -40,10 +40,10 @@ public class XDGFDocument { Map _styleSheets = new HashMap(); // defaults - long _defaultFillStyle = 0; - long _defaultGuideStyle = 0; - long _defaultLineStyle = 0; - long _defaultTextStyle = 0; + long _defaultFillStyle; + long _defaultGuideStyle; + long _defaultLineStyle; + long _defaultTextStyle; public XDGFDocument(VisioDocumentType document) { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java index 68c2c8626..b1edbcb27 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFMaster.java @@ -29,7 +29,7 @@ public class XDGFMaster { private MasterType _master; protected XDGFMasterContents _content; - protected XDGFSheet _pageSheet = null; + protected XDGFSheet _pageSheet; public XDGFMaster(MasterType master, XDGFMasterContents content, XDGFDocument document) { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java index 3bdbd2e1b..388d50a25 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFPage.java @@ -34,7 +34,7 @@ public class XDGFPage { private PageType _page; protected XDGFPageContents _content; protected XDGFPages _pages; - protected XDGFSheet _pageSheet = null; + protected XDGFSheet _pageSheet; public XDGFPage(PageType page, XDGFPageContents content, XDGFDocument document, XDGFPages pages) { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java index 42deac4c2..7cb2be629 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFShape.java @@ -49,58 +49,58 @@ public class XDGFShape extends XDGFSheet { XDGFBaseContents _parentPage; XDGFShape _parent; // only non-null if a subshape - XDGFMaster _master = null; - XDGFShape _masterShape = null; + XDGFMaster _master; + XDGFShape _masterShape; - XDGFText _text = null; + XDGFText _text; // subshapes if they exist - List _shapes = null; + List _shapes; // properties specific to shapes // center of rotation relative to origin of parent - Double _pinX = null; - Double _pinY = null; + Double _pinX; + Double _pinY; - Double _width = null; - Double _height = null; + Double _width; + Double _height; // center of rotation relative to self - Double _locPinX = null; - Double _locPinY = null; + Double _locPinX; + Double _locPinY; // start x coordinate, relative to parent // -> one dimensional shapes only - Double _beginX = null; - Double _beginY = null; + Double _beginX; + Double _beginY; // end x coordinate, relative to parent // -> one dimensional shapes only - Double _endX = null; - Double _endY = null; + Double _endX; + Double _endY; - Double _angle = null; - Double _rotationXAngle = null; - Double _rotationYAngle = null; - Double _rotationZAngle = null; + Double _angle; + Double _rotationXAngle; + Double _rotationYAngle; + Double _rotationZAngle; // end x coordinate, relative to parent - Boolean _flipX = null; - Boolean _flipY = null; + Boolean _flipX; + Boolean _flipY; // center of text relative to this shape - Double _txtPinX = null; - Double _txtPinY = null; + Double _txtPinX; + Double _txtPinY; // center of text relative to text block - Double _txtLocPinX = null; - Double _txtLocPinY = null; + Double _txtLocPinX; + Double _txtLocPinY; - Double _txtAngle = null; + Double _txtAngle; - Double _txtWidth = null; - Double _txtHeight = null; + Double _txtWidth; + Double _txtHeight; public XDGFShape(ShapeSheetType shapeSheet, XDGFBaseContents parentPage, XDGFDocument document) { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java index 1cc807fdf..ab2c1d511 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/XDGFSheet.java @@ -52,7 +52,7 @@ public abstract class XDGFSheet { protected SortedMap _geometry = new TreeMap(); // special: character section - protected CharacterSection _character = null; + protected CharacterSection _character; public XDGFSheet(SheetType sheet, XDGFDocument document) { try { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java index 7c1aa3f0c..97d62c5c2 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CharacterSection.java @@ -30,8 +30,8 @@ import com.microsoft.schemas.office.visio.x2012.main.SectionType; public class CharacterSection extends XDGFSection { - Double _fontSize = null; - Color _fontColor = null; + Double _fontSize; + Color _fontColor; Map _characterCells = new HashMap(); diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java index d51e9070d..2d6f251bb 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/CombinedIterable.java @@ -56,8 +56,8 @@ public class CombinedIterable implements Iterable { Long lastI = Long.MIN_VALUE; - Entry currentBase = null; - Entry currentMaster = null; + Entry currentBase; + Entry currentMaster; // grab the iterator for both Iterator> baseI = _baseItems.entrySet().iterator(); diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java index bc7cdf60b..6f47ad593 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/GeometrySection.java @@ -40,7 +40,7 @@ import com.microsoft.schemas.office.visio.x2012.main.SectionType; public class GeometrySection extends XDGFSection { - GeometrySection _master = null; + GeometrySection _master; // rows SortedMap _rows = new TreeMap(); diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/ArcTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/ArcTo.java index fdcce8056..be2a291c1 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/ArcTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/ArcTo.java @@ -31,18 +31,18 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class ArcTo implements GeometryRow { - ArcTo _master = null; + ArcTo _master; // The x-coordinate of the ending vertex of an arc. - Double x = null; + Double x; // The y-coordinate of the ending vertex of an arc. - Double y = null; + Double y; // The distance from the arc's midpoint to the midpoint of its chord. - Double a = null; + Double a; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/Ellipse.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/Ellipse.java index 01eecdd00..ba4d3ff67 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/Ellipse.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/Ellipse.java @@ -30,24 +30,24 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class Ellipse implements GeometryRow { - Ellipse _master = null; + Ellipse _master; // x coordinate of center point - Double x = null; + Double x; // y coordinate of center point - Double y = null; + Double y; // x coordinate of first point on ellipse - Double a = null; + Double a; // y coordinate of first point on ellipse - Double b = null; + Double b; // x coordinate of second point on ellipse - Double c = null; + Double c; // y coordinate of second point on ellipse - Double d = null; + Double d; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/EllipticalArcTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/EllipticalArcTo.java index 02fc5aef4..17db67c1f 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/EllipticalArcTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/EllipticalArcTo.java @@ -30,36 +30,36 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class EllipticalArcTo implements GeometryRow { - EllipticalArcTo _master = null; + EllipticalArcTo _master; // The x-coordinate of the ending vertex on an arc. - Double x = null; + Double x; // The y-coordinate of the ending vertex on an arc. - Double y = null; + Double y; // The x-coordinate of the arc's control point; a point on the arc. The // control point is best located about halfway between the beginning and // ending vertices of the arc. Otherwise, the arc may grow to an extreme // size in order to pass through the control point, with unpredictable // results. - Double a = null; + Double a; // The y-coordinate of an arc's control point. - Double b = null; + Double b; // The angle of an arc's major axis relative to the x-axis of its parent // shape. - Double c = null; + Double c; // The ratio of an arc's major axis to its minor axis. Despite the usual // meaning of these words, the "major" axis does not have to be greater than // the "minor" axis, so this ratio does not have to be greater than 1. // Setting this cell to a value less than or equal to 0 or greater than 1000 // can lead to unpredictable results. - Double d = null; + Double d; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas @@ -129,7 +129,7 @@ public class EllipticalArcTo implements GeometryRow { _master = (EllipticalArcTo) row; } - public static int draw = 0; + public static int draw; @Override public void addToPath(java.awt.geom.Path2D.Double path, XDGFShape parent) { diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/InfiniteLine.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/InfiniteLine.java index 6965c1b89..0fc79c231 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/InfiniteLine.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/InfiniteLine.java @@ -31,25 +31,25 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; */ public class InfiniteLine implements GeometryRow { - InfiniteLine _master = null; + InfiniteLine _master; // An x-coordinate of a point on the infinite line; paired with y-coordinate // represented by the Y cell. - Double x = null; + Double x; // A y-coordinate of a point on the infinite line; paired with x-coordinate // represented by the X cell. - Double y = null; + Double y; // An x-coordinate of a point on the infinite line; paired with y-coordinate // represented by the B cell. - Double a = null; + Double a; // A y-coordinate of a point on an infinite line; paired with x-coordinate // represented by the A cell. - Double b = null; + Double b; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java index 93857f09b..9c24988b3 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/LineTo.java @@ -26,12 +26,12 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class LineTo implements GeometryRow { - LineTo _master = null; + LineTo _master; - Double x = null; - Double y = null; + Double x; + Double y; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java index 6dca12b2b..297b213e0 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/MoveTo.java @@ -31,12 +31,12 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; */ public class MoveTo implements GeometryRow { - MoveTo _master = null; + MoveTo _master; - Double x = null; - Double y = null; + Double x; + Double y; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/NURBSTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/NURBSTo.java index 353d694f9..f94580265 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/NURBSTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/NURBSTo.java @@ -33,30 +33,30 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class NURBSTo implements GeometryRow { - NURBSTo _master = null; + NURBSTo _master; // The x-coordinate of the last control point of a NURBS. - Double x = null; + Double x; // The y-coordinate of the last control point of a NURBS. - Double y = null; + Double y; // The second to the last knot of the NURBS. - Double a = null; + Double a; // The last weight of the NURBS. - Double b = null; + Double b; // The first knot of the NURBS. - Double c = null; + Double c; // The first weight of the NURBS. - Double d = null; + Double d; // A NURBS formula. - String e = null; + String e; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/PolyLineTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/PolyLineTo.java index c5f1ba011..4b6d37ae5 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/PolyLineTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/PolyLineTo.java @@ -27,18 +27,18 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class PolyLineTo implements GeometryRow { - PolyLineTo _master = null; + PolyLineTo _master; // The x-coordinate of the ending vertex of a polyline. - Double x = null; + Double x; // The y-coordinate of the ending vertex of a polyline. - Double y = null; + Double y; // The polyline formula - String a = null; + String a; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelCubBezTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelCubBezTo.java index 3a419bb50..3988de313 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelCubBezTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelCubBezTo.java @@ -26,35 +26,35 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class RelCubBezTo implements GeometryRow { - RelCubBezTo _master = null; + RelCubBezTo _master; // The x-coordinate of the ending vertex of a cubic Bezier curve relative to // the width of the shape. - Double x = null; + Double x; // The y-coordinate of the ending vertex of a cubic Bezier curve relative to // the height of the shape. - Double y = null; + Double y; // The x-coordinate of the curve's beginning control point relative to the // shape's width; a point on the arc. The control point is best located // between the beginning and ending vertices of the arc. - Double a = null; + Double a; // The y-coordinate of a curve's beginning control point relative to the // shape's height. - Double b = null; + Double b; // The x-coordinate of the curve's ending control point relative to the // shape's width; a point on the arc. The control point is best located // between the beginning control point and ending vertices of the arc. - Double c = null; + Double c; // The y-coordinate of a curve's ending control point relative to the // shape's height. - Double d = null; + Double d; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelEllipticalArcTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelEllipticalArcTo.java index 9b58406cd..d8fe5c69c 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelEllipticalArcTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelEllipticalArcTo.java @@ -26,32 +26,32 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class RelEllipticalArcTo implements GeometryRow { - RelEllipticalArcTo _master = null; + RelEllipticalArcTo _master; // The x-coordinate of the ending vertex on an arc relative to the width of // the shape. - Double x = null; + Double x; // The y-coordinate of the ending vertex on an arc relative to the height of // the shape. - Double y = null; + Double y; // The x-coordinate of the arc's control point relative to the shape's // width; a point on the arc. - Double a = null; + Double a; // The y-coordinate of an arc's control point relative to the shape's width. - Double b = null; + Double b; // The angle of an arc's major axis relative to the x-axis of its parent. - Double c = null; + Double c; // The ratio of an arc's major axis to its minor axis. Despite the usual // meaning of these words, the "major" axis does not have to be greater than // the "minor" axis, so this ratio does not have to be greater than 1. - Double d = null; + Double d; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelLineTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelLineTo.java index 1886f2059..dc5521129 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelLineTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelLineTo.java @@ -30,12 +30,12 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; */ public class RelLineTo implements GeometryRow { - RelLineTo _master = null; + RelLineTo _master; - Double x = null; - Double y = null; + Double x; + Double y; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelMoveTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelMoveTo.java index 0b6f51c19..0a2f9bf9d 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelMoveTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelMoveTo.java @@ -26,12 +26,12 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; public class RelMoveTo implements GeometryRow { - RelMoveTo _master = null; + RelMoveTo _master; - Double x = null; - Double y = null; + Double x; + Double y; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelQuadBezTo.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelQuadBezTo.java index ecb4a3a43..ae0702548 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelQuadBezTo.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/RelQuadBezTo.java @@ -31,26 +31,26 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; */ public class RelQuadBezTo implements GeometryRow { - RelQuadBezTo _master = null; + RelQuadBezTo _master; // The x-coordinate of the ending vertex of a quadratic Bezier curve // relative to the width of the shape. - Double x = null; + Double x; // The y-coordinate of the ending vertex of a quadratic Bezier curve // relative to the height of the shape. - Double y = null; + Double y; // The x-coordinate of the curve's control point relative to the shape's // width; a point on the arc. The control point is best located about // halfway between the beginning and ending vertices of the arc. - Double a = null; + Double a; // The y-coordinate of a curve's control point relative to the shape's // height. - Double b = null; + Double b; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineKnot.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineKnot.java index f75490b07..640b10ea4 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineKnot.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineKnot.java @@ -30,18 +30,18 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; */ public class SplineKnot implements GeometryRow { - SplineKnot _master = null; + SplineKnot _master; // The x-coordinate of a control point. - Double x = null; + Double x; // The y-coordinate of a control point. - Double y = null; + Double y; // One of the spline's knots (other than the last one or the first two). - Double a = null; + Double a; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineStart.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineStart.java index 224a36c03..a427de6f1 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineStart.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/section/geometry/SplineStart.java @@ -29,27 +29,27 @@ import com.microsoft.schemas.office.visio.x2012.main.RowType; */ public class SplineStart implements GeometryRow { - SplineStart _master = null; + SplineStart _master; // The x-coordinate of a spline's second control point. - Double x = null; + Double x; // The y-coordinate of a spline's second control point. - Double y = null; + Double y; // The second knot of the spline. - Double a = null; + Double a; // The first knot of a spline. - Double b = null; + Double b; // The last knot of a spline. - Double c = null; + Double c; // The degree of a spline (an integer from 1 to 25). - Integer d = null; + Integer d; - Boolean deleted = null; + Boolean deleted; // TODO: support formulas diff --git a/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeDebuggerRenderer.java b/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeDebuggerRenderer.java index d4a010ba2..062f987ab 100644 --- a/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeDebuggerRenderer.java +++ b/src/ooxml/java/org/apache/poi/xdgf/usermodel/shape/ShapeDebuggerRenderer.java @@ -25,7 +25,7 @@ import org.apache.poi.xdgf.usermodel.XDGFShape; public class ShapeDebuggerRenderer extends ShapeRenderer { - ShapeVisitorAcceptor _debugAcceptor = null; + ShapeVisitorAcceptor _debugAcceptor; public ShapeDebuggerRenderer() { super(); diff --git a/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java b/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java index d3ff89613..6e96f0e2b 100644 --- a/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java +++ b/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java @@ -49,8 +49,8 @@ public class XSLFPowerPointExtractor extends POIXMLTextExtractor { private XMLSlideShow slideshow; private boolean slidesByDefault = true; - private boolean notesByDefault = false; - private boolean masterByDefault = false; + private boolean notesByDefault; + private boolean masterByDefault; public XSLFPowerPointExtractor(XMLSlideShow slideshow) { super(slideshow); diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java index 95abdebf2..bfff18d83 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java @@ -43,10 +43,10 @@ import org.apache.poi.util.Units; */ @Beta public final class XSLFPictureData extends POIXMLDocumentPart implements PictureData { - private Long checksum = null; + private Long checksum; // original image dimensions (for formats supported by BufferedImage) - private Dimension origSize = null; + private Dimension origSize; private int index = -1; /** diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java index b159dcaec..589f84e91 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTableCell.java @@ -69,14 +69,14 @@ import org.openxmlformats.schemas.drawingml.x2006.main.STTextVerticalType; * Represents a cell of a table in a .pptx presentation */ public class XSLFTableCell extends XSLFTextShape implements TableCell { - private CTTableCellProperties _tcPr = null; + private CTTableCellProperties _tcPr; private final XSLFTable table; - private int row = 0, col = 0; + private int row, col; /** * Volatile/temporary anchor - e.g. for rendering */ - private Rectangle2D anchor = null; + private Rectangle2D anchor; /*package*/ XSLFTableCell(CTTableCell cell, XSLFTable table){ super(cell, table.getSheet()); diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java index 6504a6df1..fa81c44b3 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBCommentsTable.java @@ -42,9 +42,9 @@ public class XSSFBCommentsTable extends XSSFBParser { //these are all used only during parsing, and they are mutable! private int authorId = -1; - private CellAddress cellAddress = null; - private XSSFBCellRange cellRange = null; - private String comment = null; + private CellAddress cellAddress; + private XSSFBCellRange cellRange; + private String comment; private StringBuilder authorBuffer = new StringBuilder(); diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java index 819281f65..639300df1 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBSheetHandler.java @@ -47,9 +47,9 @@ public class XSSFBSheetHandler extends XSSFBParser { private int lastEndedRow = -1; private int lastStartedRow = -1; - private int currentRow = 0; + private int currentRow; private byte[] rkBuffer = new byte[8]; - private XSSFBCellRange hyperlinkCellRange = null; + private XSSFBCellRange hyperlinkCellRange; private StringBuilder xlWideStringBuffer = new StringBuilder(); private final XSSFBCellHeader cellBuffer = new XSSFBCellHeader(); diff --git a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java index 583c9fcec..6394074ba 100644 --- a/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBStylesTable.java @@ -40,8 +40,8 @@ public class XSSFBStylesTable extends XSSFBParser { private final SortedMap numberFormats = new TreeMap(); private final List styleIds = new ArrayList(); - private boolean inCellXFS = false; - private boolean inFmts = false; + private boolean inCellXFS; + private boolean inFmts; public XSSFBStylesTable(InputStream is) throws IOException { super(is); parse(); diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java index 6653ee655..aa1f2b214 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFBReader.java @@ -183,7 +183,7 @@ public class XSSFBReader extends XSSFReader { static { RECORDS.set(XSSFBRecordType.BrtAbsPath15.getId()); } - private String path = null; + private String path; public PathExtractor(InputStream is) { super(is, RECORDS); } diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFBEventBasedExcelExtractor.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFBEventBasedExcelExtractor.java index 4e2a5c27b..a55686f79 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFBEventBasedExcelExtractor.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFBEventBasedExcelExtractor.java @@ -51,7 +51,7 @@ public class XSSFBEventBasedExcelExtractor extends XSSFEventBasedExcelExtractor XSSFRelation.XLSB_BINARY_WORKBOOK }; - private boolean handleHyperlinksInCells = false; + private boolean handleHyperlinksInCells; public XSSFBEventBasedExcelExtractor(String path) throws XmlException, OpenXML4JException, IOException { super(path); diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java index dd14c6cd0..b80df3960 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java @@ -65,9 +65,9 @@ public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor private Locale locale; private boolean includeTextBoxes = true; private boolean includeSheetNames = true; - private boolean includeCellComments = false; + private boolean includeCellComments; private boolean includeHeadersFooters = true; - private boolean formulasNotResults = false; + private boolean formulasNotResults; private boolean concatenatePhoneticRuns = true; public XSSFEventBasedExcelExtractor(String path) throws XmlException, OpenXML4JException, IOException { diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java b/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java index 03a29a367..06b02c9bc 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/AutoSizeColumnTracker.java @@ -59,7 +59,7 @@ import org.apache.poi.util.Internal; // untrackedColumns stores columns have been explicitly untracked so they aren't implicitly re-tracked by trackAllColumns // Using a HashSet instead of a TreeSet because we don't care about order. private final Set untrackedColumns = new HashSet(); - private boolean trackAllColumns = false; + private boolean trackAllColumns; /** * Tuple to store the column widths considering and not considering merged cells diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java index 5eebd7eb8..1ab5c8a23 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFRow.java @@ -42,8 +42,8 @@ public class SXSSFRow implements Row, Comparable private final SortedMap _cells = new TreeMap(); private short _style = -1; // index of cell style in style table private short _height = -1; // row height in twips (1/20 point) - private boolean _zHeight = false; // row zero-height (this is somehow different than being hidden) - private int _outlineLevel = 0; // Outlining level of the row, when outlining is on + private boolean _zHeight; // row zero-height (this is somehow different than being hidden) + private int _outlineLevel; // Outlining level of the row, when outlining is on // use Boolean to have a tri-state for on/off/undefined private Boolean _hidden = UNDEFINED; private Boolean _collapsed = UNDEFINED; @@ -490,7 +490,7 @@ public class SXSSFRow implements Row, Comparable public class CellIterator implements Iterator { final int maxColumn = getLastCellNum(); //last column PLUS ONE - int pos = 0; + int pos; @Override public boolean hasNext() diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java index 6fce52945..78a8a4916 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFSheet.java @@ -70,9 +70,9 @@ public class SXSSFSheet implements Sheet private final SheetDataWriter _writer; private int _randomAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE; private final AutoSizeColumnTracker _autoSizeColumnTracker; - private int outlineLevelRow = 0; + private int outlineLevelRow; private int lastFlushedRowNumber = -1; - private boolean allFlushed = false; + private boolean allFlushed; public SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet) throws IOException { _workbook = workbook; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java index 9c5e6ffb1..e6400c447 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java @@ -56,7 +56,7 @@ public abstract class BaseXSSFEvaluationWorkbook implements FormulaRenderingWork // lazily populated. This should only be accessed through getTableCache // keys are lower-case to make this a quasi-case-insensitive map - private Map _tableCache = null; + private Map _tableCache; protected BaseXSSFEvaluationWorkbook(XSSFWorkbook book) { diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java index f0d9d12af..78d4e402e 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFConnector.java @@ -42,7 +42,7 @@ import org.apache.poi.util.Internal; */ public final class XSSFConnector extends XSSFShape { - private static CTConnector prototype = null; + private static CTConnector prototype; private CTConnector ctShape; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java index 7078f3c09..b67c7eb44 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFDrawing.java @@ -83,7 +83,7 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing { - private static CTGroupShape prototype = null; + private static CTGroupShape prototype; private CTGroupShape ctGroup; diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java index a3e78dac3..08e35f30e 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSimpleShape.java @@ -46,7 +46,7 @@ public class XSSFSimpleShape extends XSSFShape implements Iterable paragraphs = null; - protected List tables = null; - protected List bodyElements = null; + protected List paragraphs; + protected List tables; + protected List bodyElements; protected IBody part; - private XWPFTableRow tableRow = null; + private XWPFTableRow tableRow; /** * If a table cell does not include at least one block-level element, then this document shall be considered corrupt diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java index 991107bf0..f93e47b7e 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java @@ -101,8 +101,8 @@ public class TestSignatureInfo { private static final POIDataSamples testdata = POIDataSamples.getXmlDSignInstance(); private static Calendar cal; - private KeyPair keyPair = null; - private X509Certificate x509 = null; + private KeyPair keyPair; + private X509Certificate x509; @AfterClass public static void removeUserLocale() { diff --git a/src/ooxml/testcases/org/apache/poi/sl/draw/TestDrawPictureShape.java b/src/ooxml/testcases/org/apache/poi/sl/draw/TestDrawPictureShape.java index 809a307d5..45f92e8b2 100644 --- a/src/ooxml/testcases/org/apache/poi/sl/draw/TestDrawPictureShape.java +++ b/src/ooxml/testcases/org/apache/poi/sl/draw/TestDrawPictureShape.java @@ -42,7 +42,7 @@ import org.junit.Test; public class TestDrawPictureShape { final static POIDataSamples ssSamples = POIDataSamples.getSlideShowInstance(); - private static boolean xslfOnly = false; + private static boolean xslfOnly; @BeforeClass public static void checkHslf() { diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java index 50ad6347a..b77550f78 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestPPTX2PNG.java @@ -43,7 +43,7 @@ import org.junit.runners.Parameterized.Parameters; */ @RunWith(Parameterized.class) public class TestPPTX2PNG { - private static boolean xslfOnly = false; + private static boolean xslfOnly; private static final POIDataSamples samples = POIDataSamples.getSlideShowInstance(); private static final File basedir = null; private static final String files = diff --git a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java index c7029ad38..8856a2a64 100644 --- a/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java +++ b/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFTextShape.java @@ -49,7 +49,7 @@ import org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder; import org.openxmlformats.schemas.presentationml.x2006.main.STPlaceholderType; public class TestXSLFTextShape { - private static boolean xslfOnly = false; + private static boolean xslfOnly; @BeforeClass public static void checkHslf() { diff --git a/src/scratchpad/src/org/apache/poi/hdgf/HDGFLZWCompressor.java b/src/scratchpad/src/org/apache/poi/hdgf/HDGFLZWCompressor.java index d79c43c87..41864e95a 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/HDGFLZWCompressor.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/HDGFLZWCompressor.java @@ -44,21 +44,21 @@ import java.io.OutputStream; // And how long it is // (Un-compressed codes are 1 byte each, compressed codes // are two) - private int bufferLen = 0; + private int bufferLen; // The raw length of a code is limited to 4 bits + 2 private byte[] rawCode = new byte[18]; // And how much we're using - private int rawCodeLen = 0; + private int rawCodeLen; // How far through the input and output streams we are - private int posInp = 0; - private int posOut = 0; + private int posInp; + private int posOut; // What the next mask byte to output will be - private int nextMask = 0; + private int nextMask; // And how many bits we've already set - private int maskBitsSet = 0; + private int maskBitsSet; public HDGFLZWCompressor() {} diff --git a/src/scratchpad/src/org/apache/poi/hdgf/streams/CompressedStreamStore.java b/src/scratchpad/src/org/apache/poi/hdgf/streams/CompressedStreamStore.java index 2fae8888d..24ba19653 100644 --- a/src/scratchpad/src/org/apache/poi/hdgf/streams/CompressedStreamStore.java +++ b/src/scratchpad/src/org/apache/poi/hdgf/streams/CompressedStreamStore.java @@ -34,7 +34,7 @@ public final class CompressedStreamStore extends StreamStore { * real contents in the de-compressed data */ private byte[] blockHeader = new byte[4]; - private boolean blockHeaderInContents = false; + private boolean blockHeaderInContents; protected byte[] _getCompressedContents() { return compressedContents; } protected byte[] _getBlockHeader() { return blockHeader; } diff --git a/src/scratchpad/src/org/apache/poi/hemf/extractor/HemfExtractor.java b/src/scratchpad/src/org/apache/poi/hemf/extractor/HemfExtractor.java index 05379e552..ab4add4eb 100644 --- a/src/scratchpad/src/org/apache/poi/hemf/extractor/HemfExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hemf/extractor/HemfExtractor.java @@ -59,7 +59,7 @@ public class HemfExtractor implements Iterable { private class HemfRecordIterator implements Iterator { - private HemfRecord currentRecord = null; + private HemfRecord currentRecord; HemfRecordIterator() { //queue the first non-header record diff --git a/src/scratchpad/src/org/apache/poi/hpbf/extractor/PublisherTextExtractor.java b/src/scratchpad/src/org/apache/poi/hpbf/extractor/PublisherTextExtractor.java index a0dc8b9af..af3018ce7 100644 --- a/src/scratchpad/src/org/apache/poi/hpbf/extractor/PublisherTextExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hpbf/extractor/PublisherTextExtractor.java @@ -35,7 +35,7 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; */ public final class PublisherTextExtractor extends POIOLE2TextExtractor { private HPBFDocument doc; - private boolean hyperlinksByDefault = false; + private boolean hyperlinksByDefault; public PublisherTextExtractor(HPBFDocument doc) { super(doc); diff --git a/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java b/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java index 88d8a6198..b5f2643c4 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java +++ b/src/scratchpad/src/org/apache/poi/hslf/blip/Metafile.java @@ -66,7 +66,7 @@ public abstract class Metafile extends HSLFPictureData { /** * Reserved. Always 0. */ - private int compression = 0; + private int compression; /** * Reserved. Always 254. diff --git a/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java b/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java index 7e09764e1..247cd8a88 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java +++ b/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java @@ -58,9 +58,9 @@ public final class PowerPointExtractor extends POIOLE2TextExtractor { private final List _slides; private boolean _slidesByDefault = true; - private boolean _notesByDefault = false; - private boolean _commentsByDefault = false; - private boolean _masterByDefault = false; + private boolean _notesByDefault; + private boolean _commentsByDefault; + private boolean _masterByDefault; /** * Basic extractor. Returns all the text, and optionally all the notes diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java index e82b966e6..45ef1b7f9 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java +++ b/src/scratchpad/src/org/apache/poi/hslf/model/textproperties/TextPropCollection.java @@ -93,9 +93,9 @@ public class TextPropCollection { // indentLevel is only valid for paragraph collection // if it's set to -1, it must be omitted - see 2.9.36 TextMasterStyleLevel - private short indentLevel = 0; + private short indentLevel; private final Map textProps = new HashMap(); - private int maskSpecial = 0; + private int maskSpecial; private final TextPropType textPropType; /** diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java b/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java index a5e120d82..9d984180e 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/EscherPlaceholder.java @@ -32,9 +32,9 @@ public class EscherPlaceholder extends EscherRecord { public static final String RECORD_DESCRIPTION = "msofbtClientTextboxPlaceholder"; private int position = -1; - private byte placementId = 0; - private byte size = 0; - private short unused = 0; + private byte placementId; + private byte size; + private short unused; public EscherPlaceholder() {} diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/OEPlaceholderAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/OEPlaceholderAtom.java index 3bdea4e4b..e91ddd042 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/OEPlaceholderAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/OEPlaceholderAtom.java @@ -53,7 +53,7 @@ public final class OEPlaceholderAtom extends RecordAtom{ private int placementId; private int placeholderId; private int placeholderSize; - private short unusedShort = 0; + private short unusedShort; /** diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/SSSlideInfoAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/SSSlideInfoAtom.java index fc6b3795a..f13cd756a 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/SSSlideInfoAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/SSSlideInfoAtom.java @@ -118,18 +118,18 @@ public class SSSlideInfoAtom extends RecordAtom { * before advancing to the next presentation slide. It MUST be greater than or equal to 0 and * less than or equal to 86399000. It MUST be ignored unless AUTO_ADVANCE_BIT is TRUE. */ - private int _slideTime = 0; + private int _slideTime; /** * A SoundIdRef that specifies which sound to play when the transition starts. */ - private int _soundIdRef = 0; + private int _soundIdRef; /** * A byte that specifies the variant of effectType. In combination of the effectType * there are further restriction and specification of this field. */ - private short _effectDirection = 0; // byte + private short _effectDirection; // byte /** * A byte that specifies which transition is used when transitioning to the @@ -137,18 +137,18 @@ public class SSSlideInfoAtom extends RecordAtom { * determined by the rendering application. As such, the same transition can have * many variations depending on the implementation. */ - private short _effectType = 0; // byte + private short _effectType; // byte /** * Various flags - see bitmask for more details */ - private short _effectTransitionFlags = 0; + private short _effectTransitionFlags; /** * A byte value that specifies how long the transition takes to run. * (0x00 = 0.75 seconds, 0x01 = 0.5 seconds, 0x02 = 0.25 seconds) */ - private short _speed = 0; // byte + private short _speed; // byte private byte[] _unused; // 3-byte public SSSlideInfoAtom() { diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java index 5291eb2fe..3940e9222 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java @@ -55,7 +55,7 @@ public final class StyleTextPropAtom extends RecordAtom { * Only set to true once setParentTextSize(int) is called. * Until then, no stylings will have been decoded */ - private boolean initialised = false; + private boolean initialised; /** * The list of all the different paragraph stylings we code for. diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java b/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java index c76699abd..7ab311ecf 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java @@ -120,7 +120,7 @@ public class TextSpecInfoRun { private short bidi = -1; private int pp10extMask = -1; - private byte[] smartTagsBytes = null; + private byte[] smartTagsBytes; /** * Inits a TextSpecInfoRun with default values diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFontInfo.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFontInfo.java index b56b55381..f2cc64c51 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFontInfo.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFontInfo.java @@ -35,7 +35,7 @@ import org.apache.poi.util.BitFieldFactory; public class HSLFFontInfo implements FontInfo { public enum FontRenderType { - raster, device, truetype; + raster, device, truetype } /** A bit that specifies whether a subset of this font is embedded. */ @@ -51,7 +51,7 @@ public class HSLFFontInfo implements FontInfo { private FontRenderType renderType = FontRenderType.truetype; private FontFamily family = FontFamily.FF_SWISS; private FontPitch pitch = FontPitch.VARIABLE; - private boolean isSubsetted = false; + private boolean isSubsetted; private boolean isSubstitutable = true; /** diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java index 83925bc54..a2b6c3cdb 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java @@ -56,7 +56,7 @@ public class HSLFSlideShowEncrypted implements Closeable { DocumentEncryptionAtom dea; EncryptionInfo _encryptionInfo; // Cipher cipher = null; - ChunkedCipherOutputStream cyos = null; + ChunkedCipherOutputStream cyos; private static final BitField fieldRecInst = new BitField(0xFFF0); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java index 814d58834..5220a3fd7 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowImpl.java @@ -861,7 +861,7 @@ public final class HSLFSlideShowImpl extends POIDocument implements Closeable { } private static class CountingOS extends OutputStream { - int count = 0; + int count; @Override public void write(int b) throws IOException { diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java index 97ff5b4c8..263d45844 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java @@ -103,7 +103,7 @@ public final class HSLFTextParagraph implements TextParagraph parentList; diff --git a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java index 98c2db8d0..5a5d5dc94 100644 --- a/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java +++ b/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java @@ -85,7 +85,7 @@ public class MAPIMessage extends POIReadOnlyDocument { private RecipientChunks[] recipientChunks; private AttachmentChunks[] attachmentChunks; - private boolean returnNullOnMissingChunk = false; + private boolean returnNullOnMissingChunk; /** * Constructor for creating new files. diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelConverter.java b/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelConverter.java index a3d162411..920c1aeb0 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelConverter.java +++ b/src/scratchpad/src/org/apache/poi/hssf/converter/AbstractExcelConverter.java @@ -57,9 +57,9 @@ public abstract class AbstractExcelConverter private boolean outputColumnHeaders = true; - private boolean outputHiddenColumns = false; + private boolean outputHiddenColumns; - private boolean outputHiddenRows = false; + private boolean outputHiddenRows; private boolean outputLeadingSpacesAsNonBreaking = true; diff --git a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java index c1fab638c..c2769861e 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java +++ b/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToHtmlConverter.java @@ -158,9 +158,9 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter return doc; } - private String cssClassContainerCell = null; + private String cssClassContainerCell; - private String cssClassContainerDiv = null; + private String cssClassContainerDiv; private String cssClassPrefixCell = "c"; @@ -174,7 +174,7 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter private final HtmlDocumentFacade htmlDocumentFacade; - private boolean useDivsToSpan = false; + private boolean useDivsToSpan; public ExcelToHtmlConverter( Document doc ) { diff --git a/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java b/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java index 243393db9..bd8c9ff9a 100644 --- a/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java @@ -41,24 +41,24 @@ import org.apache.poi.hwmf.record.HwmfText.HwmfTextVerticalAlignment; public class HwmfDrawProperties { private final Rectangle2D window; - private Rectangle2D viewport = null; + private Rectangle2D viewport; private final Point2D location; private HwmfMapMode mapMode = HwmfMapMode.MM_ANISOTROPIC; private HwmfColorRef backgroundColor = new HwmfColorRef(Color.BLACK); private HwmfBrushStyle brushStyle = HwmfBrushStyle.BS_SOLID; private HwmfColorRef brushColor = new HwmfColorRef(Color.BLACK); private HwmfHatchStyle brushHatch = HwmfHatchStyle.HS_HORIZONTAL; - private BufferedImage brushBitmap = null; + private BufferedImage brushBitmap; private double penWidth = 1; private HwmfPenStyle penStyle = HwmfPenStyle.valueOf(0); private HwmfColorRef penColor = new HwmfColorRef(Color.BLACK); private double penMiterLimit = 10; private HwmfBkMode bkMode = HwmfBkMode.OPAQUE; private HwmfPolyfillMode polyfillMode = HwmfPolyfillMode.WINDING; - private Shape region = null; - private List palette = null; - private int paletteOffset = 0; - private HwmfFont font = null; + private Shape region; + private List palette; + private int paletteOffset; + private HwmfFont font; private HwmfColorRef textColor = new HwmfColorRef(Color.BLACK); private HwmfTextAlignment textAlignLatin = HwmfTextAlignment.LEFT; private HwmfTextVerticalAlignment textVAlignLatin = HwmfTextVerticalAlignment.TOP; diff --git a/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfSLImageRenderer.java b/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfSLImageRenderer.java index 34a677fa2..e2601bc65 100644 --- a/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfSLImageRenderer.java +++ b/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfSLImageRenderer.java @@ -39,8 +39,8 @@ import org.apache.poi.util.Units; * via reflection */ public class HwmfSLImageRenderer implements ImageRenderer { - HwmfPicture image = null; - double alpha = 0; + HwmfPicture image; + double alpha; @Override public void loadImage(InputStream data, String contentType) throws IOException { diff --git a/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmapDib.java b/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmapDib.java index b9522730e..82f593963 100644 --- a/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmapDib.java +++ b/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmapDib.java @@ -210,7 +210,7 @@ public class HwmfBitmapDib { private long headerColorImportant = -1; private Color colorTable[]; @SuppressWarnings("unused") - private int colorMaskR=0,colorMaskG=0,colorMaskB=0; + private int colorMaskR,colorMaskG,colorMaskB; // size of header and color table, for start of image data calculation private int introSize; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java index 3386f4e25..daf86e7cc 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java @@ -109,7 +109,7 @@ public class WordToFoConverter extends AbstractWordConverter private AtomicInteger internalLinkCounter = new AtomicInteger( 0 ); - private boolean outputCharactersLanguage = false; + private boolean outputCharactersLanguage; private Set usedIds = new LinkedHashSet(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java index ba88a905a..0cdc68d63 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToTextConverter.java @@ -126,9 +126,9 @@ public class WordToTextConverter extends AbstractWordConverter private AtomicInteger noteCounters = new AtomicInteger( 1 ); - private Element notes = null; + private Element notes; - private boolean outputSummaryInformation = false; + private boolean outputSummaryInformation; private final TextDocumentFacade textDocumentFacade; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java b/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java index dc25a8307..32105686e 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/FontTable.java @@ -46,7 +46,7 @@ public final class FontTable private int fcSttbfffn;// table stream offset for sttbfffn // FFN structure containing strings of font names - private Ffn[] _fontNames = null; + private Ffn[] _fontNames; public FontTable(byte[] buf, int offset, int lcbSttbfffn) diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java index ce4df164b..e692d0c1e 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/BookmarksImpl.java @@ -122,9 +122,9 @@ public class BookmarksImpl implements Bookmarks private final BookmarksTables bookmarksTables; - private Map> sortedDescriptors = null; + private Map> sortedDescriptors; - private int[] sortedStartPositions = null; + private int[] sortedStartPositions; public BookmarksImpl( BookmarksTables bookmarksTables ) { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java index 3364aecb0..dff4e56a6 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HWPFList.java @@ -48,7 +48,7 @@ import org.apache.poi.hwpf.sprm.ParagraphSprmCompressor; */ public final class HWPFList { - private boolean _ignoreLogicalLeftIdentation = false; + private boolean _ignoreLogicalLeftIdentation; private LFO _lfo; private LFOData _lfoData; private ListData _listData; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java index 84a0e9b34..16ae1c40d 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/HeaderStories.java @@ -37,7 +37,7 @@ public final class HeaderStories { private Range headerStories; private PlexOfCps plcfHdd; - private boolean stripFields = false; + private boolean stripFields; public HeaderStories(HWPFDocument doc) { this.headerStories = doc.getHeaderStoryRange(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java index ec3b17f69..54a0c9596 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/NotesImpl.java @@ -28,7 +28,7 @@ import org.apache.poi.hwpf.model.NotesTables; */ public class NotesImpl implements Notes { - private Map anchorToIndexMap = null; + private Map anchorToIndexMap; private final NotesTables notesTables; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java index 1dbeae4f8..6b2fdfc6d 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/ParagraphProperties.java @@ -23,7 +23,7 @@ public final class ParagraphProperties extends PAPAbstractType implements Cloneable { - private boolean jcLogical = false; + private boolean jcLogical; public ParagraphProperties() { diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java index 928dd188f..6b5a51529 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/PictureRunMapper.java @@ -45,7 +45,7 @@ public class PictureRunMapper { private Map lookup; private List nonU1based; private List all; - private int pn = 0; + private int pn; public PictureRunMapper(HWPFDocument doc) { picturesTable = doc.getPicturesTable(); diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java index fb99df52f..74921b15b 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Table.java @@ -23,7 +23,7 @@ public final class Table extends Range { private ArrayList _rows; - private boolean _rowsFound = false; + private boolean _rowsFound; private int _tableLevel; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java index a12dc63be..4bfac1d4a 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/TableRow.java @@ -39,7 +39,7 @@ public final class TableRow extends Range private final static char TABLE_CELL_MARK = '\u0007'; private TableCell[] _cells; - private boolean _cellsFound = false; + private boolean _cellsFound; int _levelNum; private SprmBuffer _papx; diff --git a/src/scratchpad/testcases/org/apache/poi/hdgf/streams/StreamTest.java b/src/scratchpad/testcases/org/apache/poi/hdgf/streams/StreamTest.java index eeb55a56c..1e18b9847 100644 --- a/src/scratchpad/testcases/org/apache/poi/hdgf/streams/StreamTest.java +++ b/src/scratchpad/testcases/org/apache/poi/hdgf/streams/StreamTest.java @@ -26,7 +26,7 @@ import org.apache.poi.hdgf.pointers.Pointer; public abstract class StreamTest { public static class TestPointer extends Pointer { private final boolean compressed; - protected boolean hasPointers = false; + protected boolean hasPointers; public TestPointer(boolean compressed, int offset, int length, int type, short format) { this.compressed = compressed; setOffset(offset); diff --git a/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java b/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java index 7e3bf2ec6..97a042c76 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java +++ b/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java @@ -158,7 +158,7 @@ public class TestHwmfParsing { outdir.mkdirs(); final String startFile = ""; File files[] = indir.listFiles(new FileFilter() { - boolean foundStartFile = false; + boolean foundStartFile; @Override public boolean accept(File pathname) { foundStartFile |= startFile.isEmpty() || pathname.getName().contains(startFile); diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java index 759e1afb0..96ca5cc64 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java @@ -28,7 +28,7 @@ import org.apache.poi.hwpf.model.io.HWPFFileSystem; public final class TestCHPBinTable extends TestCase { - private CHPBinTable _cHPBinTable = null; + private CHPBinTable _cHPBinTable; private HWPFDocFixture _hWPFDocFixture; private final TextPieceTable fakeTPT = new TextPieceTable() { diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java index 9dfc57208..60703f280 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestDocumentProperties.java @@ -28,7 +28,7 @@ import org.junit.Test; // TODO: Add DocumentProperties#equals ??? public final class TestDocumentProperties { - private DocumentProperties _documentProperties = null; + private DocumentProperties _documentProperties; private HWPFDocFixture _hWPFDocFixture; @Test diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFileInformationBlock.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFileInformationBlock.java index e6e21458c..a2fa09e12 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFileInformationBlock.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFileInformationBlock.java @@ -26,7 +26,7 @@ import org.junit.Before; import org.junit.Test; public final class TestFileInformationBlock { - private FileInformationBlock _fileInformationBlock = null; + private FileInformationBlock _fileInformationBlock; private HWPFDocFixture _hWPFDocFixture; @Test diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFontTable.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFontTable.java index 1b332db07..860e56885 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFontTable.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestFontTable.java @@ -29,7 +29,7 @@ import org.junit.Before; import org.junit.Test; public final class TestFontTable { - private FontTable _fontTable = null; + private FontTable _fontTable; private HWPFDocFixture _hWPFDocFixture; @Test diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestPlexOfCps.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestPlexOfCps.java index 07540541e..09fefc21e 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestPlexOfCps.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestPlexOfCps.java @@ -25,7 +25,7 @@ import org.apache.poi.util.LittleEndian; public final class TestPlexOfCps extends TestCase { - private PlexOfCps _plexOfCps = null; + private PlexOfCps _plexOfCps; private HWPFDocFixture _hWPFDocFixture; public void testWriteRead() { diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestStyleSheet.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestStyleSheet.java index 2e374c299..328e5d428 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestStyleSheet.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestStyleSheet.java @@ -29,7 +29,7 @@ import org.junit.Before; import org.junit.Test; public final class TestStyleSheet { - private StyleSheet _styleSheet = null; + private StyleSheet _styleSheet; private HWPFDocFixture _hWPFDocFixture; @Test diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBorderCode.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBorderCode.java index 4adf93996..4dde3ef23 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBorderCode.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBorderCode.java @@ -27,7 +27,7 @@ import org.apache.poi.hwpf.HWPFTestDataSamples; */ public final class TestBorderCode extends TestCase { - private int pos = 0; + private int pos; private Range range; public void test() { diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java index 9912b42a1..0a9414c6f 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java @@ -420,7 +420,7 @@ public final class TestCellStyle extends TestCase { private static class CellFormatBugExample extends Thread { private final String fileName; - private Throwable exception = null; + private Throwable exception; public CellFormatBugExample(String fileName) { this.fileName = fileName; diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java index 593963b14..1533f36ed 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java @@ -51,7 +51,7 @@ import org.junit.Test; * */ public final class TestFormulaEvaluatorBugs { - private static boolean OUTPUT_TEST_FILES = false; + private static boolean OUTPUT_TEST_FILES; private static String tmpDirName; @BeforeClass diff --git a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java index ea995c11f..400b52512 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java @@ -193,7 +193,7 @@ public final class TestRawDataBlock extends TestCase { private final Random rnd = new Random(); private final byte[] data; private final int chunkSize; - private int pos = 0; + private int pos; public SlowInputStream(byte[] data, int chunkSize) { this.chunkSize = chunkSize; diff --git a/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java b/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java index d3adcce0c..f9ec43425 100644 --- a/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java +++ b/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java @@ -54,8 +54,8 @@ public class TestCellWalk extends TestCase { private static class CountCellHandler implements CellHandler { - private int cellsVisited = 0; - private long ordinalNumberSum = 0L; + private int cellsVisited; + private long ordinalNumberSum; @Override public void onCell(Cell cell, CellWalkContext ctx) { diff --git a/src/testcases/org/apache/poi/util/TestIOUtils.java b/src/testcases/org/apache/poi/util/TestIOUtils.java index 4a08a32e0..2156040b3 100644 --- a/src/testcases/org/apache/poi/util/TestIOUtils.java +++ b/src/testcases/org/apache/poi/util/TestIOUtils.java @@ -42,7 +42,7 @@ import org.junit.Test; */ public final class TestIOUtils { - static File TMP = null; + static File TMP; static final long LENGTH = new Random().nextInt(10000); @BeforeClass @@ -176,8 +176,8 @@ public final class TestIOUtils { * as requested. This tests that the fallback to read() works. */ private static class WonkyInputStream extends InputStream { - int skipCalled = 0; - int readCalled = 0; + int skipCalled; + int readCalled; @Override public int read() throws IOException { diff --git a/src/testcases/org/apache/poi/util/TestPOILogger.java b/src/testcases/org/apache/poi/util/TestPOILogger.java index 6650ed9e6..7a2860017 100644 --- a/src/testcases/org/apache/poi/util/TestPOILogger.java +++ b/src/testcases/org/apache/poi/util/TestPOILogger.java @@ -29,7 +29,7 @@ import org.junit.Test; */ public final class TestPOILogger extends POILogger { private String lastLog = ""; - private Throwable lastEx = null; + private Throwable lastEx; /** * Test different types of log output.