diff options
author | Javen O'Neal <onealj@apache.org> | 2016-10-20 02:21:14 +0000 |
---|---|---|
committer | Javen O'Neal <onealj@apache.org> | 2016-10-20 02:21:14 +0000 |
commit | db63b9cf69c66b15638f7400d7c88c6c02deea92 (patch) | |
tree | d5bdab09166f29ad765c1b74ab6dcf33ed2eea48 /src/testcases | |
parent | 7520fcd4fb8f130cb86e11e3d9a11ab431f825e5 (diff) | |
download | poi-db63b9cf69c66b15638f7400d7c88c6c02deea92.tar.gz poi-db63b9cf69c66b15638f7400d7c88c6c02deea92.zip |
Eclipse automated refactor/cleanup: add final modifier to private fields to unit tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1765739 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
24 files changed, 33 insertions, 33 deletions
diff --git a/src/testcases/org/apache/poi/POIDataSamples.java b/src/testcases/org/apache/poi/POIDataSamples.java index ef9da4767f..fbaa36b61b 100644 --- a/src/testcases/org/apache/poi/POIDataSamples.java +++ b/src/testcases/org/apache/poi/POIDataSamples.java @@ -50,7 +50,7 @@ public final class POIDataSamples { /** <code>true</code> if standard system propery is not set,
* but the data is available on the test runtime classpath */
private boolean _sampleDataIsAvaliableOnClassPath;
- private String _moduleDir;
+ private final String _moduleDir;
/**
*
diff --git a/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java b/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java index cc90724814..a4618aed47 100644 --- a/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java +++ b/src/testcases/org/apache/poi/hssf/eventmodel/TestAbortableListener.java @@ -86,7 +86,7 @@ public final class TestAbortableListener extends TestCase { } private static final class AbortableCountingListener extends AbortableHSSFListener { - private int abortAfterIndex; + private final int abortAfterIndex; public int countSeen; public Record lastRecordSeen; diff --git a/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java b/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java index fa59266c16..b3bf668804 100644 --- a/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java +++ b/src/testcases/org/apache/poi/hssf/eventmodel/TestEventRecordFactory.java @@ -150,7 +150,7 @@ public final class TestEventRecordFactory extends TestCase { final int[] recCnt = { 0 }; final int[] offset = { 0 }; ERFListener listener = new ERFListener() { - private String[] expectedRecordTypes = { + private final String[] expectedRecordTypes = { UnknownRecord.class.getName(), ContinueRecord.class.getName(), ContinueRecord.class.getName() diff --git a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java index eaf4b52c11..0867720f79 100644 --- a/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java +++ b/src/testcases/org/apache/poi/hssf/eventusermodel/TestMissingRecordAwareHSSFListener.java @@ -365,7 +365,7 @@ public final class TestMissingRecordAwareHSSFListener extends TestCase { private static final class MockHSSFListener implements HSSFListener { public MockHSSFListener() {} private final List<Record> _records = new ArrayList<Record>(); - private boolean logToStdOut = false; + private final boolean logToStdOut = false; @Override public void processRecord(Record record) { diff --git a/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java b/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java index 8d69af8ba5..45819504f6 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestAutoFilterInfoRecord.java @@ -26,7 +26,7 @@ import junit.framework.TestCase; * @author Yegor Kozlov */ public final class TestAutoFilterInfoRecord extends TestCase { - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x05, 0x00 }; diff --git a/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java index d8a1de9d03..3823072348 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestFtCblsSubRecord.java @@ -28,7 +28,7 @@ import junit.framework.TestCase; * @author Yegor Kozlov */ public final class TestFtCblsSubRecord extends TestCase { - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x01, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00 }; diff --git a/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java index 4da04e014f..5f238f80c7 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNoteRecord.java @@ -31,7 +31,7 @@ import org.apache.poi.util.HexRead; * @author Yegor Kozlov */ public final class TestNoteRecord extends TestCase { - private byte[] testData = HexRead.readFromString( + private final byte[] testData = HexRead.readFromString( "06 00 01 00 02 00 02 04 " + "1A 00 00 " + "41 70 61 63 68 65 20 53 6F 66 74 77 61 72 65 20 46 6F 75 6E 64 61 74 69 6F 6E " + diff --git a/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java b/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java index 1b5fb008e3..5a4d5c887c 100644 --- a/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java +++ b/src/testcases/org/apache/poi/hssf/record/TestNoteStructureSubRecord.java @@ -29,7 +29,7 @@ import junit.framework.TestCase; * @author Yegor Kozlov */ public final class TestNoteStructureSubRecord extends TestCase { - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0x80, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0x81, 0x01, (byte)0xCC, (byte)0xEC diff --git a/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java b/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java index 98bcc6ba4e..28299b8cad 100644 --- a/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java +++ b/src/testcases/org/apache/poi/hssf/record/aggregates/TestColumnInfoRecordsAggregate.java @@ -64,7 +64,7 @@ public final class TestColumnInfoRecordsAggregate { private static final class CIRCollector implements RecordVisitor { - private List<Record> _list = new ArrayList<Record>(); + private final List<Record> _list = new ArrayList<Record>(); @Override public void visitRecord(Record r) { diff --git a/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java b/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java index b1586f0f12..1784d95aa6 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/RecordInspector.java @@ -36,7 +36,7 @@ public final class RecordInspector { public static final class RecordCollector implements RecordVisitor { - private List<Record> _list; + private final List<Record> _list; public RecordCollector() { _list = new ArrayList<Record>(128); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java b/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java index 15588e81e8..5f90b7285f 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/SanityChecker.java @@ -85,7 +85,7 @@ public class SanityChecker { { Class<? extends RecordBase> record; char occurance; // 1 = one time, M = 1..many times, * = 0..many, 0 = optional - private boolean together; + private final boolean together; public CheckRecord( Class<? extends RecordBase> record, char occurance ) { diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java index eec69b211c..f02b950f84 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestCellStyle.java @@ -417,7 +417,7 @@ public final class TestCellStyle extends TestCase { private static class CellFormatBugExample extends Thread { - private String fileName; + private final String fileName; private Throwable exception = null; public CellFormatBugExample(String fileName) { diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java b/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java index 1a28cb4219..1a695407b8 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestNonStandardWorkbookStreamNames.java @@ -33,8 +33,8 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; * the more usual, Workbook) */ public final class TestNonStandardWorkbookStreamNames extends TestCase { - private String xlsA = "WORKBOOK_in_capitals.xls"; - private String xlsB = "BOOK_in_capitals.xls"; + private final String xlsA = "WORKBOOK_in_capitals.xls"; + private final String xlsB = "BOOK_in_capitals.xls"; /** * Test that we can open a file with WORKBOOK diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java index b310180b29..347fb219f5 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java @@ -51,7 +51,7 @@ public final class TestWorkbook { private static final String LAST_NAME_VALUE = "Bush"; private static final String FIRST_NAME_VALUE = "George"; private static final String SSN_VALUE = "555555555"; - private SanityChecker sanityChecker = new SanityChecker(); + private final SanityChecker sanityChecker = new SanityChecker(); private static HSSFWorkbook openSample(String sampleFileName) { diff --git a/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java b/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java index ac9a4f5bf5..7a0e3d6d0c 100644 --- a/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java +++ b/src/testcases/org/apache/poi/poifs/eventfilesystem/TestPOIFSReaderRegistry.java @@ -31,11 +31,11 @@ import org.apache.poi.poifs.filesystem.POIFSDocumentPath; * @author Marc Johnson */ public final class TestPOIFSReaderRegistry extends TestCase { - private POIFSReaderListener[] listeners = + private final POIFSReaderListener[] listeners = { new Listener(), new Listener(), new Listener(), new Listener() }; - private POIFSDocumentPath[] paths = + private final POIFSDocumentPath[] paths = { new POIFSDocumentPath(), new POIFSDocumentPath(new String[] { @@ -48,7 +48,7 @@ public final class TestPOIFSReaderRegistry extends TestCase { "c" }) }; - private String[] names = + private final String[] names = { "a0", "a1", "a2", "a3" }; diff --git a/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java b/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java index f04efbe9c0..b3a328c9ef 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java @@ -40,11 +40,11 @@ import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener; public class ReaderWriter implements POIFSReaderListener, POIFSWriterListener { - private POIFSFileSystem filesystem; - private DirectoryEntry root; + private final POIFSFileSystem filesystem; + private final DirectoryEntry root; // keys are DocumentDescriptors, values are byte[]s - private Map<DocumentDescriptor, byte[]> dataMap; + private final Map<DocumentDescriptor, byte[]> dataMap; /** * Constructor ReaderWriter diff --git a/src/testcases/org/apache/poi/poifs/filesystem/SlowInputStream.java b/src/testcases/org/apache/poi/poifs/filesystem/SlowInputStream.java index 01f668c45d..f818d21978 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/SlowInputStream.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/SlowInputStream.java @@ -28,7 +28,7 @@ import java.util.Random; */ public class SlowInputStream extends FilterInputStream { - private Random r = new Random(0); + private final Random r = new Random(0); public SlowInputStream(InputStream in) { super(in); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java b/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java index 3cf452acff..2800e94547 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestEntryUtils.java @@ -26,8 +26,8 @@ import java.util.List; import junit.framework.TestCase; public class TestEntryUtils extends TestCase { - private byte[] dataSmallA = new byte[] { 12, 42, 11, -12, -121 }; - private byte[] dataSmallB = new byte[] { 11, 73, 21, -92, -103 }; + private final byte[] dataSmallA = new byte[] { 12, 42, 11, -12, -121 }; + private final byte[] dataSmallB = new byte[] { 11, 73, 21, -92, -103 }; public void testCopyRecursively() throws Exception { POIFSFileSystem fsD = new POIFSFileSystem(); diff --git a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java index 1afd67c35f..73aafb82c5 100644 --- a/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java +++ b/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSFileSystem.java @@ -38,7 +38,7 @@ import org.apache.poi.poifs.storage.RawDataBlockList; * Tests for the older OPOIFS-based POIFSFileSystem */ public final class TestPOIFSFileSystem extends TestCase { - private POIDataSamples _samples = POIDataSamples.getPOIFSInstance(); + private final POIDataSamples _samples = POIDataSamples.getPOIFSInstance(); /** * Mock exception used to ensure correct error handling diff --git a/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java b/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java index c9a849ba23..7358f00249 100644 --- a/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java +++ b/src/testcases/org/apache/poi/poifs/storage/LocalRawDataBlockList.java @@ -32,7 +32,7 @@ import org.apache.poi.util.LittleEndianConsts; * @author Marc Johnson(mjohnson at apache dot org) */ public final class LocalRawDataBlockList extends RawDataBlockList { - private List<RawDataBlock> _list; + private final List<RawDataBlock> _list; private RawDataBlock[] _array; public LocalRawDataBlockList() diff --git a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java index a7af8af8f8..ea995c11f4 100644 --- a/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java +++ b/src/testcases/org/apache/poi/poifs/storage/TestRawDataBlock.java @@ -190,9 +190,9 @@ public final class TestRawDataBlock extends TestCase { * not to have any data */ public static class SlowInputStream extends InputStream { - private Random rnd = new Random(); - private byte[] data; - private int chunkSize; + private final Random rnd = new Random(); + private final byte[] data; + private final int chunkSize; private int pos = 0; public SlowInputStream(byte[] data, int chunkSize) { diff --git a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java index 1abc92b064..4641c4fdc3 100644 --- a/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java +++ b/src/testcases/org/apache/poi/ss/formula/TestEvaluationCache.java @@ -91,8 +91,8 @@ public class TestEvaluationCache extends TestCase { private final List<String> _logList; private final HSSFWorkbook _book; - private Map<ICacheEntry,EvaluationCell> _formulaCellsByCacheEntry; - private Map<ICacheEntry,Loc> _plainCellLocsByCacheEntry; + private final Map<ICacheEntry,EvaluationCell> _formulaCellsByCacheEntry; + private final Map<ICacheEntry,Loc> _plainCellLocsByCacheEntry; public EvalListener(HSSFWorkbook wb) { _book = wb; diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java index a96a727ea2..6ce1e13d42 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetHiding.java @@ -35,7 +35,7 @@ public abstract class BaseTestSheetHiding { protected Workbook wbH; protected Workbook wbU; - private String _file1, _file2; + private final String _file1, _file2; /** * @param testDataProvider an object that provides test data in HSSF / specific way 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 3664aec712..d3adcce0c0 100644 --- a/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java +++ b/src/testcases/org/apache/poi/ss/util/cellwalk/TestCellWalk.java @@ -35,7 +35,7 @@ public class TestCellWalk extends TestCase { {null, null, "str"} }; - private CountCellHandler countCellHandler = new CountCellHandler(); + private final CountCellHandler countCellHandler = new CountCellHandler(); public void testNotTraverseEmptyCells() { Workbook wb = new HSSFWorkbook(); |