diff options
author | Dominik Stadler <centic@apache.org> | 2017-09-16 08:22:59 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2017-09-16 08:22:59 +0000 |
commit | 32370cfd1cf44caabb638356f32eba60ea2a79a8 (patch) | |
tree | d17d59b5ae589bcfc2efa17b95d9159f33e47b48 /src/java | |
parent | 128c17e83ed7487f320fb20122be1603a1c9fd29 (diff) | |
download | poi-32370cfd1cf44caabb638356f32eba60ea2a79a8.tar.gz poi-32370cfd1cf44caabb638356f32eba60ea2a79a8.zip |
Remove unnecessary initialization of members
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808510 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
43 files changed, 79 insertions, 79 deletions
diff --git a/src/java/org/apache/poi/POITextExtractor.java b/src/java/org/apache/poi/POITextExtractor.java index 83e26be942..58cf5e6ddb 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 deb11d6983..b038c12d30 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 ceaf94cbaa..949a905c98 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 396a582772..3617c4ac6c 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 a1faf3d080..87bd68228f 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 { * <p>A <code>byte[]</code> to hold a thumbnail image in ({@link * Variant#VT_CF VT_CF}) format.</p> */ - 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 4ef3ede77a..c506ad47be 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 eb65517cea..ed0f8f2469 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<BoundSheetRecord> boundSheetRecords = new ArrayList<BoundSheetRecord>(); private final List<ExternSheetRecord> externSheetRecords = new ArrayList<ExternSheetRecord>(); - 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 f5475507a5..1b6b93434b 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 0e7e31ac47..f313b96e3a 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 397c1f6e31..be21dff695 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<RecordBase> _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<RowRecord> rowRecIterator = null; + private Iterator<RowRecord> 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 b29d7268e9..28c1e519b5 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<Record> records = new ArrayList<Record>(); /** 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 03efd84035..1af6142eda 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 <code>null</code> */ 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 87075c91c7..7e202c0831 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 <code>FtPioGrbitSubRecord</code> and diff --git a/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java b/src/java/org/apache/poi/hssf/record/FtPioGrbitSubRecord.java index c15a6cbdd3..eaf8a5af29 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 <code>FtPioGrbitSubRecord</code> and diff --git a/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java b/src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java index 0a9616d711..7ec0c83dc1 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 8a97827687..d1c12e0fce 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 ac72b997ce..95040905ed 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<CellValueRecordInte */ class ValueIterator implements Iterator<CellValueRecordInterface> { - 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 5197d814f9..02bfa33676 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 8810ef59c5..60c1a521fc 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 b8d8e393dd..1b5ea03cc5 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 a9e09bbe4e..56c918af47 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 7c3b636fda..b6276f0ba0 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<String> _formats = new Vector<String>(); 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 206ee11b99..40c0ada463 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 a705dc86a9..69610c5a73 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<T extends Sheet> implements Iterator<T> { final private Iterator<T> it; - private T cursor = null; + private T cursor; @SuppressWarnings("unchecked") public SheetIterator() { it = (Iterator<T>) _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 ba60cb2fe4..e71cbd412e 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 65579bebe7..a846cca34f 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 9c377fa2d7..2f5ccfd7a9 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 3eb66b549e..26fc78d8b7 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 1c0834c8ca..c090fe3610 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 c236c4b83b..c4aaecfe0c 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 cc9d7eb5e6..3038224214 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 7ccdf5ed2f..5d197a8002 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 916267b654..2c35ac51eb 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 4af6d6b4b4..848a9e372c 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 ba80711e78..9dc0c6096f 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 b6fbbb3ffa..c69294676e 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 1ef84d9ff0..8b5a7a8dd5 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 a204fde17a..1825deaacd 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 08f024082e..62276d920d 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 d3d29307c4..61808afcaa 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 1e34ccd29b..34460702fc 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 47c153432c..884bd838f2 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 fa84f6ef5c..30aee7a066 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<String> { private String[] strings = {}; - private int position = 0; + private int position; public StringsIterator(String[] strings) { if (strings != null) { this.strings = strings.clone(); |