From: Javen O'Neal Date: Thu, 20 Oct 2016 02:21:14 +0000 (+0000) Subject: Eclipse automated refactor/cleanup: add final modifier to private fields to unit... X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a1ec4334cf81e39780628cffbca364623234bf19;p=poi.git 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 --- diff --git a/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java b/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java index 19a06ab635..fcea580586 100644 --- a/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java +++ b/src/integrationtest/org/apache/poi/stress/HSSFFileHandler.java @@ -30,7 +30,7 @@ import java.util.Set; import static org.junit.Assert.assertFalse; public class HSSFFileHandler extends SpreadsheetHandler { - private POIFSFileHandler delegate = new POIFSFileHandler(); + private final POIFSFileHandler delegate = new POIFSFileHandler(); @Override public void handleFile(InputStream stream) throws Exception { HSSFWorkbook wb = new HSSFWorkbook(stream); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java index b867dc1099..ffeceb2898 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java @@ -41,8 +41,8 @@ import org.junit.Test; import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor; public class TestThemesTable { - private String testFileSimple = "Themes.xlsx"; - private String testFileComplex = "Themes2.xlsx"; + private final String testFileSimple = "Themes.xlsx"; + private final String testFileComplex = "Themes2.xlsx"; // TODO .xls version available too, add HSSF support then check // What colours they should show up as diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java index f1351f1862..41e02b12ff 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/charts/TestXSSFChartAxis.java @@ -30,7 +30,7 @@ import org.apache.poi.xssf.usermodel.*; public final class TestXSSFChartAxis extends TestCase { private static final double EPSILON = 1E-7; - private XSSFChartAxis axis; + private final XSSFChartAxis axis; public TestXSSFChartAxis() { super(); 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 6693ce05df..99bb4a2bc4 100644 --- a/src/scratchpad/testcases/org/apache/poi/hdgf/streams/StreamTest.java +++ b/src/scratchpad/testcases/org/apache/poi/hdgf/streams/StreamTest.java @@ -23,7 +23,7 @@ import junit.framework.TestCase; public abstract class StreamTest extends TestCase { public static class TestPointer extends Pointer { - private boolean compressed; + private final boolean compressed; protected boolean hasPointers = false; public TestPointer(boolean compressed, int offset, int length, int type, short format) { this.compressed = compressed; diff --git a/src/scratchpad/testcases/org/apache/poi/hdgf/streams/TestStreamComplex.java b/src/scratchpad/testcases/org/apache/poi/hdgf/streams/TestStreamComplex.java index 3af4c6b361..d1092e2bba 100644 --- a/src/scratchpad/testcases/org/apache/poi/hdgf/streams/TestStreamComplex.java +++ b/src/scratchpad/testcases/org/apache/poi/hdgf/streams/TestStreamComplex.java @@ -29,8 +29,8 @@ import org.apache.poi.POIDataSamples; public final class TestStreamComplex extends StreamTest { private byte[] contents; - private int trailerPointerAt = 0x24; - private int trailerDataAt = 0x8a94; + private final int trailerPointerAt = 0x24; + private final int trailerDataAt = 0x8a94; private ChunkFactory chunkFactory; private PointerFactory ptrFactory; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java b/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java index de43a37537..58498e0298 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/TestReWriteSanity.java @@ -36,9 +36,9 @@ import org.apache.poi.POIDataSamples; */ public final class TestReWriteSanity extends TestCase { // HSLFSlideShow primed on the test data - private HSLFSlideShowImpl ss; + private final HSLFSlideShowImpl ss; // POIFS primed on the test data - private POIFSFileSystem pfs; + private final POIFSFileSystem pfs; public TestReWriteSanity() throws Exception { POIDataSamples slTests = POIDataSamples.getSlideShowInstance(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/TestRecordCounts.java b/src/scratchpad/testcases/org/apache/poi/hslf/TestRecordCounts.java index 4c5044fc71..473c9d3306 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/TestRecordCounts.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/TestRecordCounts.java @@ -32,7 +32,7 @@ import org.apache.poi.POIDataSamples; */ public final class TestRecordCounts extends TestCase { // HSLFSlideShow primed on the test data - private HSLFSlideShowImpl ss; + private final HSLFSlideShowImpl ss; public TestRecordCounts() throws Exception { POIDataSamples slTests = POIDataSamples.getSlideShowInstance(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestCruddyExtractor.java b/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestCruddyExtractor.java index f9df1a469e..33807ac576 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestCruddyExtractor.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/extractor/TestCruddyExtractor.java @@ -32,7 +32,7 @@ import org.apache.poi.util.StringUtil; */ public final class TestCruddyExtractor extends TestCase { // Extractor primed on the test data - private QuickButCruddyTextExtractor te; + private final QuickButCruddyTextExtractor te; // All the text to be found in the file String[] allTheText = new String[] { "This is a test title", diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestAnimationInfoAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestAnimationInfoAtom.java index 87d40fa160..df3150c59e 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestAnimationInfoAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestAnimationInfoAtom.java @@ -37,7 +37,7 @@ public final class TestAnimationInfoAtom extends TestCase { 00 00 00 */ - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x01, 0x00, (byte)0xF1, 0x0F, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java index 13090c812a..4289c27710 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestCString.java @@ -28,10 +28,10 @@ import java.io.ByteArrayOutputStream; */ public final class TestCString extends TestCase { // From a real file - private byte[] data_a = new byte[] { 0, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0, + private final byte[] data_a = new byte[] { 0, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0, 0x48, 00, 0x6F, 00, 0x67, 00, 0x77, 00, 0x61, 00, 0x72, 00, 0x74, 00, 0x73, 00 }; - private byte[] data_b = new byte[] { 0x10, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0, + private final byte[] data_b = new byte[] { 0x10, 0, 0xBA-256, 0x0f, 0x10, 0, 0, 0, 0x43, 00, 0x6F, 00, 0x6D, 00, 0x6D, 00, 0x65, 00, 0x6E, 00, 0x74, 00, 0x73, 00 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestColorSchemeAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestColorSchemeAtom.java index e506075e04..9e0af0d9d5 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestColorSchemeAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestColorSchemeAtom.java @@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream; */ public final class TestColorSchemeAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { 60, 0, 0xF0-256, 0x07, 0x20, 0, 0, 0, + private final byte[] data_a = new byte[] { 60, 0, 0xF0-256, 0x07, 0x20, 0, 0, 0, 0xFF-256, 0xFF-256, 0xFF-256, 00, 00, 00, 00, 00, 0x80-256, 0x80-256, 0x80-256, 00, 00, 00, 00, 00, 0xBB-256, 0xE0-256, 0xE3-256, 00, 0x33, 0x33, 0x99-256, 00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000.java index 4ceea41fe5..0081b8420d 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000.java @@ -40,7 +40,7 @@ import org.junit.Test; */ public final class TestComment2000 { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 0x0F, 00, 0xE0-256, 0x2E, 0x9C-256, 00, 00, 00, 00, 00, 0xBA-256, 0x0F, 0x14, 00, 00, 00, 0x44, 00, 0x75, 00, 0x6D, 00, 0x62, 00, @@ -64,7 +64,7 @@ public final class TestComment2000 { 0x0F, 00, 0xCD-256, 00, 0x92-256, 00, 00, 00, 0x92-256, 00, 00, 00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 0x0F, 00, 0xE0-256, 0x2E, 0xAC-256, 00, 00, 00, 00, 00, 0xBA-256, 0x0F, 0x10, 00, 00, 00, 0x48, 00, 0x6F, 00, 0x67, 00, 0x77, 00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000Atom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000Atom.java index 26ca6dbb31..05a3a671b5 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000Atom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestComment2000Atom.java @@ -36,14 +36,14 @@ import org.junit.Test; */ public final class TestComment2000Atom { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 00, 00, 0xE1-256, 0x2E, 0x1C, 00, 00, 00, 01, 00, 00, 00, 0xD6-256, 07, 01, 00, 02, 00, 0x18, 00, 0x0A, 00, 0x1A, 00, 0x0F, 00, 0xCD-256, 00, 0x92-256, 00, 00, 00, 0x92-256, 00, 00, 00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 00, 00, 0xE1-256, 0x2E, 0x1C, 00, 00, 00, 05, 00, 00, 00, 0xD6-256, 0x07, 01, 00, 02, 00, 0x18, 00, 0x15, 00, 0x19, 00, 03, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java index 8018ba3b86..e9134eea48 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocument.java @@ -30,9 +30,9 @@ import org.apache.poi.POIDataSamples; */ public final class TestDocument extends TestCase { // HSLFSlideShow primed on the test data - private HSLFSlideShowImpl ss; + private final HSLFSlideShowImpl ss; // POIFS primed on the test data - private POIFSFileSystem pfs; + private final POIFSFileSystem pfs; public TestDocument() throws Exception { POIDataSamples slTests = POIDataSamples.getSlideShowInstance(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentAtom.java index 890c0a73b7..40f4cd787f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentAtom.java @@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream; */ public final class TestDocumentAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { 1, 0, 0xE9-256, 3, 0x28, 0, 0, 0, + private final byte[] data_a = new byte[] { 1, 0, 0xE9-256, 3, 0x28, 0, 0, 0, 0x80-256, 0x16, 0, 0, 0xE0-256, 0x10, 0, 0, 0xE0-256, 0x10, 0, 0, 0x80-256, 0x16, 0, 0, 0x05, 0, 0, 0, 0x0A, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java index c0cb358372..7e394cbdeb 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentEncryptionAtom.java @@ -31,7 +31,7 @@ import org.junit.Test; */ public final class TestDocumentEncryptionAtom { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 0x0F, 00, 0x14, 0x2F, 0xBE-256, 00, 00, 00, 02, 00, 02, 00, 0x0C, 00, 00, 00, 0x76, 00, 00, 00, 0x0C, 00, 00, 00, @@ -67,7 +67,7 @@ public final class TestDocumentEncryptionAtom { 0xB2-256, 0x8E-256, 0x67, 0x54, 0x07, 0x04, 0x00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 15, 0, 20, 47, -66, 0, 0, 0, 2, 0, 2, 0, 4, 0, 0, 0, 118, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExControl.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExControl.java index 6b4d7a21a4..29c7ee2369 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExControl.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExControl.java @@ -55,7 +55,7 @@ public final class TestExControl extends TestCase { */ - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x0F, 0x00, (byte)0xEE, 0x0F, (byte)0xDA, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0xFB, 0x0F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, (byte)0xC3, 0x0F, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, (byte)0x96, 0x13, 0x00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java index ab08f9068d..dfd840b1b7 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlink.java @@ -36,7 +36,7 @@ import org.apache.poi.POIDataSamples; */ public final class TestExHyperlink extends TestCase { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 0x0F, 00, 0xD7-256, 0x0F, 0xA8-256, 00, 00, 00, 00, 00, 0xD3-256, 0x0F, 04, 00, 00, 00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlinkAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlinkAtom.java index ee6c5586cb..eba79e05a6 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlinkAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExHyperlinkAtom.java @@ -28,11 +28,11 @@ import java.io.ByteArrayOutputStream; */ public class TestExHyperlinkAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 00, 00, 0xD3-256, 0x0F, 04, 00, 00, 00, 01, 00, 00, 00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 00, 00, 0xD3-256, 0x0F, 04, 00, 00, 00, 04, 00, 00, 00 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExObjListAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExObjListAtom.java index e978f37e4c..7f1110863c 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExObjListAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExObjListAtom.java @@ -28,11 +28,11 @@ import java.io.ByteArrayOutputStream; */ public class TestExObjListAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 00, 00, 0x0A, 0x04, 04, 00, 00, 00, 01, 00, 00, 00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 00, 00, 0x0A, 0x04, 04, 00, 00, 00, 04, 00, 00, 00 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjAtom.java index b69e5f40cc..ca33bb4d6b 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjAtom.java @@ -30,7 +30,7 @@ import junit.framework.TestCase; */ public final class TestExOleObjAtom extends TestCase { // From a real file (embedded SWF control) - private byte[] data = { + private final byte[] data = { 0x01, 0x00, (byte)0xC3, 0x0F, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, (byte)0x96, 0x13, 0x00 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjStg.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjStg.java index 83d932fdea..07147f1fe1 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjStg.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExOleObjStg.java @@ -55,7 +55,7 @@ public final class TestExOleObjStg extends TestCase { 88 97 08 35 91 83 81 07 EC 27 10 BF 18 E8 9B E1 0F 00 BD 65 3D D4 */ - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x10, 0x00, 0x11, 0x10, 0x5B, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x78, (byte)0x9C, (byte)0xBB, 0x70, 0x5E, (byte)0xF0, (byte)0xC1, (byte)0xC2, (byte)0x8D, 0x52, 0x0F, 0x19, (byte)0xD0, (byte)0x80, 0x1D, 0x03, 0x33, (byte)0xC3, (byte)0xBF, (byte)0xFF, (byte)0x9C, 0x0C, 0x6C, 0x48, 0x62, (byte)0x8C, 0x40, (byte)0xCC, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExVideoContainer.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExVideoContainer.java index a16c8ed469..10dc9404c8 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExVideoContainer.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestExVideoContainer.java @@ -32,7 +32,7 @@ import junit.framework.TestCase; public final class TestExVideoContainer extends TestCase { // From a real file - private byte[] data = new byte[]{ + private final byte[] data = new byte[]{ 0x0F, 0x00, 0x05, 0x10, (byte) 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestFontCollection.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestFontCollection.java index c005c023f9..2d595f3325 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestFontCollection.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestFontCollection.java @@ -30,7 +30,7 @@ import junit.framework.TestCase; */ public final class TestFontCollection extends TestCase { // From a real file - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x0F, 0x00, 0xD5-256, 0x07, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7-256, 0x0F, 0x44, 0x00, 0x00, 0x00, 0x54, 0x00, 0x69, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x73, 0x00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersAtom.java index 07a7b42d45..c694b90d4f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersAtom.java @@ -31,7 +31,7 @@ import junit.framework.TestCase; */ public final class TestHeadersFootersAtom extends TestCase { // From a real file - private byte[] data = new byte[] { + private final byte[] data = new byte[] { 0x00, 0x00, (byte)0xDA, 0x0F, 0x04, 0x00, 0x00, 00, 0x00, 0x00, 0x23, 0x00 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersContainer.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersContainer.java index ef6f31f7c7..6e787e7c83 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersContainer.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestHeadersFootersContainer.java @@ -31,7 +31,7 @@ import junit.framework.TestCase; */ public final class TestHeadersFootersContainer extends TestCase { // SlideHeadersFootersContainer - private byte[] slideData = new byte[] { + private final byte[] slideData = new byte[] { 0x3F, 0x00, (byte)0xD9, 0x0F, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0xDA, 0x0F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x20, 0x00, (byte)0xBA, 0x0F, 0x1A, 0x00, 0x00, 0x00, @@ -41,7 +41,7 @@ public final class TestHeadersFootersContainer extends TestCase { }; // NotesHeadersFootersContainer - private byte[] notesData = new byte[] { + private final byte[] notesData = new byte[] { 0x4F, 0x00, (byte)0xD9, 0x0F, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0xDA, 0x0F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x10, 0x00, (byte)0xBA, 0x0F, 0x16, 0x00, 0x00, 0x00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfo.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfo.java index 9ecb03b22c..24278fa14e 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfo.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfo.java @@ -32,7 +32,7 @@ import junit.framework.TestCase; */ public class TestInteractiveInfo extends TestCase { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 0x0F, 00, 0xF2-256, 0x0F, 0x18, 00, 00, 00, 00, 00, 0xF3-256, 0x0F, 0x10, 00, 00, 00, 00, 00, 00, 00, 01, 00, 00, 00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfoAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfoAtom.java index 7a59921936..cabed2578c 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfoAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestInteractiveInfoAtom.java @@ -28,12 +28,12 @@ import java.io.ByteArrayOutputStream; */ public class TestInteractiveInfoAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 00, 00, 0xF3-256, 0x0F, 0x10, 00, 00, 00, 00, 00, 00, 00, 01, 00, 00, 00, 04, 00, 00, 00, 8, 00, 00, 00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 00, 00, 0xF3-256, 0x0F, 0x10, 00, 00, 00, 00, 00, 00, 00, 04, 00, 00, 00, 04, 00, 00, 00, 8, 00, 00, 00 diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestNotesAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestNotesAtom.java index e12ecd75c5..fc207ea3ca 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestNotesAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestNotesAtom.java @@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream; */ public final class TestNotesAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { 1, 0, 0xF1-256, 3, 8, 0, 0, 0, + private final byte[] data_a = new byte[] { 1, 0, 0xF1-256, 3, 8, 0, 0, 0, 0, 0, 0, 0x80-256, 0, 0, 0x0D, 0x30 }; public void testRecordType() { diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java index 6271e53402..7e6137ba47 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlideAtom.java @@ -32,7 +32,7 @@ import junit.framework.TestCase; */ public final class TestSlideAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { 1, 0, 0xEF-256, 3, 0x18, 0, 0, 0, + private final byte[] data_a = new byte[] { 1, 0, 0xEF-256, 3, 0x18, 0, 0, 0, 0, 0, 0, 0, 0x0F, 0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80-256, 0, 1, 0, 0, 7, 0, 0x0C, 0x30 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java index 25aa8a5350..87d8a17502 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestSlidePersistAtom.java @@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream; */ public final class TestSlidePersistAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { 0, 0, 0xF3-256, 3, 0x14, 0, 0, 0, + private final byte[] data_a = new byte[] { 0, 0, 0xF3-256, 3, 0x14, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java index 15877fdcf3..533d250a92 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java @@ -125,7 +125,7 @@ public final class TestStyleTextPropAtom { 28, 0, 1, 0, 0, 0, 0, 0, 3, 0, 1, 0, 24, 0 }; - private int data_c_text_len = 123-1; + private final int data_c_text_len = 123-1; /** * From a real file supplied for Bug 40143 by tales@great.ufc.br diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java index 85d5b7a552..9078bd1663 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextBytesAtom.java @@ -28,15 +28,15 @@ import java.io.ByteArrayOutputStream; */ public final class TestTextBytesAtom extends TestCase { // From a real file - private byte[] data = new byte[] { 0, 0, 0xA8-256, 0x0f, 0x1c, 0, 0, 0, + private final byte[] data = new byte[] { 0, 0, 0xA8-256, 0x0f, 0x1c, 0, 0, 0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x69, 0x74, 0x6C, 0x65, 0x20, 0x6F, 0x6E, 0x20, 0x70, 0x61, 0x67, 0x65, 0x20, 0x32 }; - private String data_text = "This is the title on page 2"; - private byte[] alt_data = new byte[] { 0, 0, 0xA8-256, 0x0F, 0x14, 0, 0, 0, + private final String data_text = "This is the title on page 2"; + private final byte[] alt_data = new byte[] { 0, 0, 0xA8-256, 0x0F, 0x14, 0, 0, 0, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x74, 0x69, 0x74, 0x6C, 0x65 }; - private String alt_text = "This is a test title"; + private final String alt_text = "This is a test title"; public void testRecordType() { TextBytesAtom tba = new TextBytesAtom(data,0,data.length); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java index b37a234ba5..8158cb1127 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextCharsAtom.java @@ -28,12 +28,12 @@ import java.io.ByteArrayOutputStream; */ public final class TestTextCharsAtom extends TestCase { // From a real file - private byte[] data = new byte[] { 0, 0, 0xA0-256, 0x0f, 0x08, 0, 0, 0, + private final byte[] data = new byte[] { 0, 0, 0xA0-256, 0x0f, 0x08, 0, 0, 0, 0x54, 0x00, 0x68, 0x00, 0x69, 0x00, 0x73, 0x00 }; - private String data_text = "This"; - private byte[] alt_data = new byte[] { 0, 0, 0xA0-256, 0x0F, 0x0a, 0, 0, 0, + private final String data_text = "This"; + private final byte[] alt_data = new byte[] { 0, 0, 0xA0-256, 0x0F, 0x0a, 0, 0, 0, 0x54, 0x00, 0x68, 0x00, 0x69, 0x00, 0x73, 0x00, 0xa3-256, 0x01 }; - private String alt_text = "This\u01A3"; + private final String alt_text = "This\u01A3"; public void testRecordType() { TextCharsAtom tca = new TextCharsAtom(data,0,data.length); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java index b2c819439f..8ac7453405 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextHeaderAtom.java @@ -28,9 +28,9 @@ import java.io.ByteArrayOutputStream; */ public final class TestTextHeaderAtom extends TestCase { // From a real file - private byte[] notes_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 2, 0, 0, 0}; - private byte[] title_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 0, 0, 0, 0 }; - private byte[] body_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 1, 0, 0, 0 }; + private final byte[] notes_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 2, 0, 0, 0}; + private final byte[] title_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 0, 0, 0, 0 }; + private final byte[] body_data = new byte[] { 0, 0, 0x9f-256, 0x0f, 4, 0, 0, 0, 1, 0, 0, 0 }; public void testRecordType() { TextHeaderAtom tha = new TextHeaderAtom(notes_data,0,12); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextRulerAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextRulerAtom.java index 7987bde6d5..475918cd1c 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextRulerAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextRulerAtom.java @@ -31,14 +31,14 @@ import junit.framework.TestCase; public final class TestTextRulerAtom extends TestCase { //from a real file - private byte[] data_1 = new byte[] { + private final byte[] data_1 = new byte[] { 0x00, 0x00, (byte)0xA6, 0x0F, 0x18, 0x00, 0x00, 0x00, (byte)0xF8, 0x1F, 0x00, 0x00, 0x75, 0x00, (byte)0xE2, 0x00, 0x59, 0x01, (byte)0xC3, 0x01, 0x1A, 0x03, (byte)0x87, 0x03, (byte)0xF8, 0x03, 0x69, 0x04, (byte)0xF6, 0x05, (byte)0xF6, 0x05 }; - private byte[] data_2 = new byte[] { + private final byte[] data_2 = new byte[] { 0x00, 0x00, (byte)0xA6, 0x0F, 0x0A, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, (byte)0xF9, 0x00, 0x41, 0x01, 0x41, 0x01 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java index 593f116cab..4f88d4cfd1 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTextSpecInfoAtom.java @@ -31,7 +31,7 @@ import junit.framework.TestCase; public final class TestTextSpecInfoAtom extends TestCase { //from a real file - private byte[] data_1 = new byte[] { + private final byte[] data_1 = new byte[] { 0x00, 0x00, (byte)0xAA, 0x0F, 0x2C, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxInteractiveInfoAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxInteractiveInfoAtom.java index 4e3d07ade0..7f6eab12f9 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxInteractiveInfoAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestTxInteractiveInfoAtom.java @@ -28,12 +28,12 @@ import java.io.ByteArrayOutputStream; */ public final class TestTxInteractiveInfoAtom extends TestCase { // From WithLinks.ppt - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 00, 00, (byte)0xDF, 0x0F, 0x08, 00, 00, 00, 0x19, 00, 00, 00, 0x38, 00, 00, 00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 00, 00, (byte)0xDF, 0x0F, 0x08, 00, 00, 00, 0x39, 00, 00, 00, 0x4E, 00, 00, 00 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java index 3607dd4e3a..fca70287c0 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/record/TestUserEditAtom.java @@ -28,7 +28,7 @@ import java.io.ByteArrayOutputStream; */ public final class TestUserEditAtom extends TestCase { // From a real file - private byte[] data_a = new byte[] { 0, 0, 0xF5-256, 0x0F, 0x1C, 0, 0, 0, + private final byte[] data_a = new byte[] { 0, 0, 0xF5-256, 0x0F, 0x1C, 0, 0, 0, 00, 01, 00, 00, 0xD9-256, 18, 00, 03, 00, 00, 00, 00, 00, 0x18, 00, 00, 01, 00, 00, 00, 05, 00, 00, 00, 01, 00, 0xF6-256, 77 }; diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java index cb51595f57..a52cee4129 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestCounts.java @@ -31,7 +31,7 @@ import org.apache.poi.POIDataSamples; */ public final class TestCounts extends TestCase { // SlideShow primed on the test data - private HSLFSlideShow ss; + private final HSLFSlideShow ss; public TestCounts() throws Exception { POIDataSamples slTests = POIDataSamples.getSlideShowInstance(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java index 6cdefca545..a7e2a62d51 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestMostRecentRecords.java @@ -30,9 +30,9 @@ import junit.framework.TestCase; */ public final class TestMostRecentRecords extends TestCase { // HSLFSlideShow primed on the test data - private HSLFSlideShowImpl hss; + private final HSLFSlideShowImpl hss; // SlideShow primed on the test data - private HSLFSlideShow ss; + private final HSLFSlideShow ss; public TestMostRecentRecords() throws Exception { POIDataSamples slTests = POIDataSamples.getSlideShowInstance(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java index 0623b56953..59c5c65a70 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestNotesText.java @@ -29,7 +29,7 @@ import junit.framework.TestCase; */ public final class TestNotesText extends TestCase { // SlideShow primed on the test data - private HSLFSlideShow ss; + private final HSLFSlideShow ss; public TestNotesText() throws Exception { POIDataSamples slTests = POIDataSamples.getSlideShowInstance(); diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/util/TestSystemTimeUtils.java b/src/scratchpad/testcases/org/apache/poi/hslf/util/TestSystemTimeUtils.java index 1de83d9971..776da2fc54 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/util/TestSystemTimeUtils.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/util/TestSystemTimeUtils.java @@ -35,12 +35,12 @@ import org.junit.Test; */ public final class TestSystemTimeUtils { // From real files - private byte[] data_a = new byte[] { + private final byte[] data_a = new byte[] { 0xD6-256, 07, 01, 00, 02, 00, 0x18, 00, 0x0A, 00, 0x1A, 00, 0x0F, 00, 0xCD-256, 00 }; - private byte[] data_b = new byte[] { + private final byte[] data_b = new byte[] { 00, 00, 0xE1-256, 0x2E, 0x1C, 00, 00, 00, 01, 00, 00, 00, 0xD6-256, 0x07, 01, 00, 02, 00, 0x18, 00, 0x15, 00, 0x19, 00, 03, diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestBasics.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestBasics.java index a6e468767e..7cdfdb1989 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestBasics.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestBasics.java @@ -29,14 +29,14 @@ import org.apache.poi.hsmf.exceptions.ChunkNotFoundException; * a range of files */ public final class TestBasics extends TestCase { - private MAPIMessage simple; - private MAPIMessage quick; - private MAPIMessage outlook30; - private MAPIMessage attachments; - private MAPIMessage noRecipientAddress; - private MAPIMessage unicode; - private MAPIMessage cyrillic; - private MAPIMessage chinese; + private final MAPIMessage simple; + private final MAPIMessage quick; + private final MAPIMessage outlook30; + private final MAPIMessage attachments; + private final MAPIMessage noRecipientAddress; + private final MAPIMessage unicode; + private final MAPIMessage cyrillic; + private final MAPIMessage chinese; /** * Initialize this test, load up the blank.msg mapi message. diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestBlankFileRead.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestBlankFileRead.java index 79fe7ebd9b..c4f13a6272 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestBlankFileRead.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestBlankFileRead.java @@ -30,7 +30,7 @@ import junit.framework.TestCase; * Tests to verify that the library can read blank msg files. */ public final class TestBlankFileRead extends TestCase { - private MAPIMessage mapiMessage; + private final MAPIMessage mapiMessage; /** * Initialize this test, load up the blank.msg mapi message. diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java index 3c6ed37ba6..12ffb62e89 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java @@ -31,8 +31,8 @@ import org.apache.poi.hsmf.exceptions.ChunkNotFoundException; * @author Nicolas Bureau */ public class TestFileWithAttachmentsRead extends TestCase { - private MAPIMessage twoSimpleAttachments; - private MAPIMessage pdfMsgAttachments; + private final MAPIMessage twoSimpleAttachments; + private final MAPIMessage pdfMsgAttachments; /** * Initialize this test, load up the attachment_test_msg.msg mapi message. diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunk.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunk.java index 0cbad21b96..dc4f1c969f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunk.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunk.java @@ -29,8 +29,8 @@ import junit.framework.TestCase; public final class TestMessageSubmissionChunk extends TestCase { - private MAPIMessage mapiMessageExtraHyphenSubmissionChunk; - private MAPIMessage mapiMessageNormalSubmissionChunk; + private final MAPIMessage mapiMessageExtraHyphenSubmissionChunk; + private final MAPIMessage mapiMessageNormalSubmissionChunk; /** * Initialise this test, load up the test messages. diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunkY2KRead.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunkY2KRead.java index c10ba0b65f..ef770d441f 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunkY2KRead.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestMessageSubmissionChunkY2KRead.java @@ -29,9 +29,9 @@ import junit.framework.TestCase; public final class TestMessageSubmissionChunkY2KRead extends TestCase { - private MAPIMessage mapiMessage1979; - private MAPIMessage mapiMessage1980; - private MAPIMessage mapiMessage1981; + private final MAPIMessage mapiMessage1979; + private final MAPIMessage mapiMessage1980; + private final MAPIMessage mapiMessage1981; /** * Initialise this test, load up the three test messages. diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java index a791874ced..1496e082dc 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestOutlook30FileRead.java @@ -29,7 +29,7 @@ import junit.framework.TestCase; * Tests to verify that we can still work on the newer Outlook 3.0 files. */ public final class TestOutlook30FileRead extends TestCase { - private MAPIMessage mapiMessage; + private final MAPIMessage mapiMessage; /** * Initialize this test, load up the blank.msg mapi message. diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java b/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java index 318031015c..bdfff10788 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/TestSimpleFileRead.java @@ -30,7 +30,7 @@ import junit.framework.TestCase; * format with no attachments or extra recipents. */ public final class TestSimpleFileRead extends TestCase { - private MAPIMessage mapiMessage; + private final MAPIMessage mapiMessage; /** * Initialize this test, load up the blank.msg mapi message. diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/extractor/TestOutlookTextExtractor.java b/src/scratchpad/testcases/org/apache/poi/hsmf/extractor/TestOutlookTextExtractor.java index b8f34a17e2..755bb63804 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/extractor/TestOutlookTextExtractor.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/extractor/TestOutlookTextExtractor.java @@ -39,7 +39,7 @@ import org.junit.Test; * Tests to verify that the text extractor works */ public final class TestOutlookTextExtractor { - private POIDataSamples samples = POIDataSamples.getHSMFInstance(); + private final POIDataSamples samples = POIDataSamples.getHSMFInstance(); private static TimeZone userTZ; diff --git a/src/scratchpad/testcases/org/apache/poi/hsmf/parsers/TestPOIFSChunkParser.java b/src/scratchpad/testcases/org/apache/poi/hsmf/parsers/TestPOIFSChunkParser.java index e4b8142b90..58ff1cc162 100644 --- a/src/scratchpad/testcases/org/apache/poi/hsmf/parsers/TestPOIFSChunkParser.java +++ b/src/scratchpad/testcases/org/apache/poi/hsmf/parsers/TestPOIFSChunkParser.java @@ -46,7 +46,7 @@ import org.junit.Test; * Tests to verify that the chunk parser works properly */ public final class TestPOIFSChunkParser { - private POIDataSamples samples = POIDataSamples.getHSMFInstance(); + private final POIDataSamples samples = POIDataSamples.getHSMFInstance(); @Test public void testFindsCore() throws Exception { diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/HWPFDocFixture.java b/src/scratchpad/testcases/org/apache/poi/hwpf/HWPFDocFixture.java index d306bfabc0..763ec672c1 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/HWPFDocFixture.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/HWPFDocFixture.java @@ -32,7 +32,7 @@ public final class HWPFDocFixture public byte[] _tableStream; public byte[] _mainStream; public FileInformationBlock _fib; - private String _testFile; + private final String _testFile; public HWPFDocFixture(Object obj, String testFile) { 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 3ee35eded0..759e1afb04 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestCHPBinTable.java @@ -31,7 +31,7 @@ public final class TestCHPBinTable private CHPBinTable _cHPBinTable = null; private HWPFDocFixture _hWPFDocFixture; - private TextPieceTable fakeTPT = new TextPieceTable() { + private final TextPieceTable fakeTPT = new TextPieceTable() { @Override public boolean isIndexInTable(int bytePos) { return true; diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestSavedByTable.java b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestSavedByTable.java index 57ad140c6f..2b96f21597 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestSavedByTable.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/model/TestSavedByTable.java @@ -36,7 +36,7 @@ public final class TestSavedByTable { /** The expected entries in the test document. */ - private List expected = Arrays.asList(new Object[] { + private final List expected = Arrays.asList(new Object[] { new SavedByEntry("cic22", "C:\\DOCUME~1\\phamill\\LOCALS~1\\Temp\\AutoRecovery save of Iraq - security.asd"), new SavedByEntry("cic22", "C:\\DOCUME~1\\phamill\\LOCALS~1\\Temp\\AutoRecovery save of Iraq - security.asd"), new SavedByEntry("cic22", "C:\\DOCUME~1\\phamill\\LOCALS~1\\Temp\\AutoRecovery save of Iraq - security.asd"), diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java index b4591ad455..7bd9d55d94 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java @@ -811,16 +811,16 @@ public class TestBugs extends TestCase // These are the values the are expected to be read when the file // is checked. - private int section1LeftMargin = 1440; - private int section1RightMargin = 1440; - private int section1TopMargin = 1440; - private int section1BottomMargin = 1440; - private int section1NumColumns = 1; + private final int section1LeftMargin = 1440; + private final int section1RightMargin = 1440; + private final int section1TopMargin = 1440; + private final int section1BottomMargin = 1440; + private final int section1NumColumns = 1; private int section2LeftMargin = 1440; private int section2RightMargin = 1440; private int section2TopMargin = 1440; private int section2BottomMargin = 1440; - private int section2NumColumns = 3; + private final int section2NumColumns = 3; public void testHWPFSections() { HWPFDocument document = null; diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java index 4d0648b39a..bf52606d31 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeDelete.java @@ -30,19 +30,19 @@ import junit.framework.TestCase; public final class TestRangeDelete extends TestCase { // u201c and u201d are "smart-quotes" - private String introText = + private final String introText = "Introduction\r"; - private String fillerText = + private final String fillerText = "${delete} This is an MS-Word 97 formatted document created using NeoOffice v. 2.2.4 Patch 0 (OpenOffice.org v. 2.2.1).\r"; - private String originalText = + private final String originalText = "It is used to confirm that text delete works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the ${organization} ${delete} and all the POI contributors for their assistance in this matter.\r"; - private String lastText = + private final String lastText = "Thank you, ${organization} ${delete}!\r"; - private String searchText = "${delete}"; - private String expectedText1 = " This is an MS-Word 97 formatted document created using NeoOffice v. 2.2.4 Patch 0 (OpenOffice.org v. 2.2.1).\r"; - private String expectedText2 = + private final String searchText = "${delete}"; + private final String expectedText1 = " This is an MS-Word 97 formatted document created using NeoOffice v. 2.2.4 Patch 0 (OpenOffice.org v. 2.2.1).\r"; + private final String expectedText2 = "It is used to confirm that text delete works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the ${organization} and all the POI contributors for their assistance in this matter.\r"; - private String expectedText3 = "Thank you, ${organization} !\r"; + private final String expectedText3 = "Thank you, ${organization} !\r"; private String illustrativeDocFile; diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java index 79c2af67f1..18ae0e7ac5 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeInsertion.java @@ -31,10 +31,10 @@ import org.apache.poi.hwpf.HWPFTestDataSamples; public final class TestRangeInsertion extends TestCase { // u201c and u201d are "smart-quotes" - private String originalText = + private final String originalText = "It is used to confirm that text insertion works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present.\r"; - private String textToInsert = "Look at me! I'm cool! "; - private int insertionPoint = 122; + private final String textToInsert = "Look at me! I'm cool! "; + private final int insertionPoint = 122; private String illustrativeDocFile; diff --git a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java index 9798a756d6..370c4f3f41 100644 --- a/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java +++ b/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestRangeReplacement.java @@ -31,15 +31,15 @@ import org.apache.poi.hwpf.HWPFTestDataSamples; public final class TestRangeReplacement extends TestCase { // u201c and u201d are "smart-quotes" - private String originalText = + private final String originalText = "It is used to confirm that text replacement works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the ${organization} and all the POI contributors for their assistance in this matter.\r"; - private String searchText = "${organization}"; - private String replacementText = "Apache Software Foundation"; - private String expectedText2 = + private final String searchText = "${organization}"; + private final String replacementText = "Apache Software Foundation"; + private final String expectedText2 = "It is used to confirm that text replacement works even if Unicode characters (such as \u201c\u2014\u201d (U+2014), \u201c\u2e8e\u201d (U+2E8E), or \u201c\u2714\u201d (U+2714)) are present. Everybody should be thankful to the Apache Software Foundation and all the POI contributors for their assistance in this matter.\r"; - private String expectedText3 = "Thank you, Apache Software Foundation!\r"; + private final String expectedText3 = "Thank you, Apache Software Foundation!\r"; - private String illustrativeDocFile = "testRangeReplacement.doc"; + private final String illustrativeDocFile = "testRangeReplacement.doc"; /** * Test just opening the files 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 { /** true 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 _records = new ArrayList(); - 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 _list = new ArrayList(); + private final List _list = new ArrayList(); @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 _list; + private final List _list; public RecordCollector() { _list = new ArrayList(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 record; char occurance; // 1 = one time, M = 1..many times, * = 0..many, 0 = optional - private boolean together; + private final boolean together; public CheckRecord( Class 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 dataMap; + private final Map 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 _list; + private final List _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 _logList; private final HSSFWorkbook _book; - private Map _formulaCellsByCacheEntry; - private Map _plainCellLocsByCacheEntry; + private final Map _formulaCellsByCacheEntry; + private final Map _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();