]> source.dussan.org Git - poi.git/commitdiff
Code-style: Unify how arrays are specified from C-style to normal Java-style
authorcentic <centic@unknown>
Tue, 25 Dec 2018 09:59:58 +0000 (09:59 +0000)
committercentic <centic@unknown>
Tue, 25 Dec 2018 09:59:58 +0000 (09:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1849716 13f79535-47bb-0310-9956-ffa450edef68

184 files changed:
src/examples/src/org/apache/poi/hslf/examples/DataExtraction.java
src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java
src/examples/src/org/apache/poi/xslf/usermodel/DataExtraction.java
src/examples/src/org/apache/poi/xslf/usermodel/MergePresentations.java
src/java/org/apache/poi/ddf/EscherBitmapBlip.java
src/java/org/apache/poi/ddf/EscherRecord.java
src/java/org/apache/poi/hpsf/Section.java
src/java/org/apache/poi/hpsf/Variant.java
src/java/org/apache/poi/hssf/dev/BiffViewer.java
src/java/org/apache/poi/hssf/dev/FormulaViewer.java
src/java/org/apache/poi/hssf/model/InternalWorkbook.java
src/java/org/apache/poi/hssf/record/BoundSheetRecord.java
src/java/org/apache/poi/hssf/record/FilePassRecord.java
src/java/org/apache/poi/hssf/record/WSBoolRecord.java
src/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java
src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java
src/java/org/apache/poi/hssf/usermodel/EscherGraphics2d.java
src/java/org/apache/poi/hssf/usermodel/FontDetails.java
src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java
src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java
src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java
src/java/org/apache/poi/poifs/crypt/CipherAlgorithm.java
src/java/org/apache/poi/poifs/crypt/CryptoFunctions.java
src/java/org/apache/poi/poifs/crypt/DataSpaceMapUtils.java
src/java/org/apache/poi/poifs/crypt/EncryptionHeader.java
src/java/org/apache/poi/poifs/crypt/Encryptor.java
src/java/org/apache/poi/poifs/crypt/binaryrc4/BinaryRC4Decryptor.java
src/java/org/apache/poi/poifs/crypt/binaryrc4/BinaryRC4EncryptionVerifier.java
src/java/org/apache/poi/poifs/crypt/binaryrc4/BinaryRC4Encryptor.java
src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java
src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDocumentInputStream.java
src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDocumentOutputStream.java
src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptionVerifier.java
src/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIEncryptor.java
src/java/org/apache/poi/poifs/crypt/standard/StandardDecryptor.java
src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptionVerifier.java
src/java/org/apache/poi/poifs/crypt/standard/StandardEncryptor.java
src/java/org/apache/poi/poifs/crypt/xor/XORDecryptor.java
src/java/org/apache/poi/poifs/crypt/xor/XOREncryptionVerifier.java
src/java/org/apache/poi/poifs/crypt/xor/XOREncryptor.java
src/java/org/apache/poi/poifs/dev/POIFSLister.java
src/java/org/apache/poi/poifs/dev/POIFSViewer.java
src/java/org/apache/poi/poifs/eventfilesystem/POIFSReader.java
src/java/org/apache/poi/poifs/filesystem/Ole10Native.java
src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
src/java/org/apache/poi/poifs/filesystem/POIFSStream.java
src/java/org/apache/poi/poifs/macros/VBAMacroExtractor.java
src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java
src/java/org/apache/poi/sl/draw/DrawFactory.java
src/java/org/apache/poi/sl/draw/DrawFontManagerDefault.java
src/java/org/apache/poi/sl/draw/DrawShape.java
src/java/org/apache/poi/sl/draw/DrawTableShape.java
src/java/org/apache/poi/sl/draw/ImageRenderer.java
src/java/org/apache/poi/sl/image/ImageHeaderBitmap.java
src/java/org/apache/poi/sl/image/ImageHeaderEMF.java
src/java/org/apache/poi/sl/image/ImageHeaderPICT.java
src/java/org/apache/poi/sl/usermodel/AutoNumberingScheme.java
src/java/org/apache/poi/sl/usermodel/PresetColor.java
src/java/org/apache/poi/sl/usermodel/SlideShowFactory.java
src/java/org/apache/poi/sl/usermodel/StrokeStyle.java
src/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java
src/java/org/apache/poi/ss/format/CellNumberFormatter.java
src/java/org/apache/poi/ss/formula/CacheAreaEval.java
src/java/org/apache/poi/ss/formula/OperationEvaluationContext.java
src/java/org/apache/poi/ss/formula/eval/TwoOperandNumericOperation.java
src/java/org/apache/poi/ss/formula/functions/Days360.java
src/java/org/apache/poi/ss/formula/functions/MatrixFunction.java
src/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
src/java/org/apache/poi/ss/util/CellUtil.java
src/java/org/apache/poi/util/IOUtils.java
src/java/org/apache/poi/util/LittleEndianInputStream.java
src/java/org/apache/poi/util/POILogger.java
src/java/org/apache/poi/util/StringUtil.java
src/ooxml/java/org/apache/poi/openxml4j/opc/StreamHelper.java
src/ooxml/java/org/apache/poi/openxml4j/util/ZipArchiveThresholdInputStream.java
src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java
src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java
src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileEncryptor.java
src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java
src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/SignatureFacet.java
src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/XAdESXLSignatureFacet.java
src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/RelationshipTransformService.java
src/ooxml/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFColor.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFMetroShape.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFShape.java
src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
src/ooxml/java/org/apache/poi/xssf/usermodel/helpers/XSSFPasswordHelper.java
src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFSettings.java
src/ooxml/testcases/org/apache/poi/TestDetectAsOOXML.java
src/ooxml/testcases/org/apache/poi/ooxml/TestPOIXMLDocument.java
src/ooxml/testcases/org/apache/poi/ooxml/util/OOXMLLiteAgent.java
src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java
src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestRelationships.java
src/ooxml/testcases/org/apache/poi/poifs/crypt/TestAgileEncryptionParameters.java
src/ooxml/testcases/org/apache/poi/poifs/crypt/TestCertificateEncryption.java
src/ooxml/testcases/org/apache/poi/poifs/crypt/TestDecryptor.java
src/ooxml/testcases/org/apache/poi/poifs/crypt/TestEncryptor.java
src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java
src/ooxml/testcases/org/apache/poi/sl/TestFonts.java
src/ooxml/testcases/org/apache/poi/sl/TestTable.java
src/ooxml/testcases/org/apache/poi/ss/extractor/TestEmbeddedExtractor.java
src/ooxml/testcases/org/apache/poi/ss/usermodel/TestEmbedOLEPackage.java
src/ooxml/testcases/org/apache/poi/util/TestTempFileThreaded.java
src/ooxml/testcases/org/apache/poi/xslf/TestXSLFBugs.java
src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFFreeformShape.java
src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSlideShow.java
src/ooxml/testcases/org/apache/poi/xssf/model/TestThemesTable.java
src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFVMLDrawing.java
src/ooxml/testcases/org/apache/poi/xwpf/TestXWPFBugs.java
src/scratchpad/src/org/apache/poi/hdgf/dev/VSDDumper.java
src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfDraw.java
src/scratchpad/src/org/apache/poi/hemf/record/emf/HemfFont.java
src/scratchpad/src/org/apache/poi/hmef/dev/HMEFDumper.java
src/scratchpad/src/org/apache/poi/hpbf/model/EscherPart.java
src/scratchpad/src/org/apache/poi/hpbf/model/HPBFPart.java
src/scratchpad/src/org/apache/poi/hpbf/model/QuillContents.java
src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCBit.java
src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCPLCBit.java
src/scratchpad/src/org/apache/poi/hpbf/model/qcbits/QCTextBit.java
src/scratchpad/src/org/apache/poi/hslf/dev/PPTXMLDump.java
src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowDumper.java
src/scratchpad/src/org/apache/poi/hslf/dev/SlideShowRecordDumper.java
src/scratchpad/src/org/apache/poi/hslf/extractor/ImageExtractor.java
src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
src/scratchpad/src/org/apache/poi/hslf/extractor/QuickButCruddyTextExtractor.java
src/scratchpad/src/org/apache/poi/hslf/model/HSLFMetroShape.java
src/scratchpad/src/org/apache/poi/hslf/model/textproperties/HSLFTabStopPropCollection.java
src/scratchpad/src/org/apache/poi/hslf/record/DocumentEncryptionAtom.java
src/scratchpad/src/org/apache/poi/hslf/record/HSLFEscherClientDataRecord.java
src/scratchpad/src/org/apache/poi/hslf/record/PersistPtrHolder.java
src/scratchpad/src/org/apache/poi/hslf/record/SSSlideInfoAtom.java
src/scratchpad/src/org/apache/poi/hslf/record/StyleTextPropAtom.java
src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoAtom.java
src/scratchpad/src/org/apache/poi/hslf/record/TextSpecInfoRun.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShape.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShow.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextShape.java
src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java
src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmapDib.java
src/scratchpad/src/org/apache/poi/hwmf/record/HwmfEscape.java
src/scratchpad/src/org/apache/poi/hwmf/record/HwmfFont.java
src/scratchpad/src/org/apache/poi/hwmf/record/HwmfTernaryRasterOp.java
src/scratchpad/src/org/apache/poi/hwmf/record/HwmfText.java
src/scratchpad/src/org/apache/poi/hwmf/record/HwmfWindowing.java
src/scratchpad/src/org/apache/poi/hwpf/HWPFDocument.java
src/scratchpad/src/org/apache/poi/hwpf/HWPFDocumentCore.java
src/scratchpad/src/org/apache/poi/hwpf/converter/NumberFormatter.java
src/scratchpad/src/org/apache/poi/hwpf/sprm/SprmOperation.java
src/scratchpad/testcases/org/apache/poi/hslf/model/TestOleEmbedding.java
src/scratchpad/testcases/org/apache/poi/hslf/model/TestSlideMaster.java
src/scratchpad/testcases/org/apache/poi/hslf/record/TestDocumentEncryption.java
src/scratchpad/testcases/org/apache/poi/hslf/record/TestStyleTextPropAtom.java
src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPicture.java
src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java
src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java
src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java
src/testcases/org/apache/poi/hpsf/TestVariantSupport.java
src/testcases/org/apache/poi/hssf/record/common/TestUnicodeString.java
src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java
src/testcases/org/apache/poi/hssf/usermodel/DummyGraphics2d.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java
src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java
src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java
src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java
src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java
src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java
src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java
src/testcases/org/apache/poi/ss/usermodel/TestDateUtil.java
src/testcases/org/apache/poi/util/TestHexDump.java
src/testcases/org/apache/poi/util/TestLittleEndian.java

index 97b9cd3d1857adb73fb440a4f1d9f106bbc25dc7..9da099eb4202e0db4a562409216ac0407e2db107 100644 (file)
@@ -39,7 +39,7 @@ import org.apache.poi.hwpf.usermodel.Range;
  */
 public final class DataExtraction {
 
-    public static void main(String args[]) throws Exception {
+    public static void main(String[] args) throws Exception {
 
         if (args.length == 0) {
             usage();
index 73675b7f9506f29a2f693ed15d30168a7c125dd6..cf68cc03ec4a478c3778885200fc48690fd003c1 100644 (file)
@@ -92,7 +92,7 @@ public class ExcelComparator {
     
     List<String> listOfDifferences = new ArrayList<>();
 
-    public static void main(String args[]) throws Exception {
+    public static void main(String[] args) throws Exception {
         if (args.length != 2 || !(new File(args[0]).exists()) || !(new File(args[1]).exists())) {
             System.err.println("java -cp <classpath> "+ExcelComparator.class.getCanonicalName()+" <workbook1.xls/x> <workbook2.xls/x");
             System.exit(-1);
index 82e5705f7d8df8dc181200d950a5cd7e0da2c685..aa0ab21ef4a323bd66d994641ad5d2bd0aa30e3e 100644 (file)
@@ -33,7 +33,7 @@ import org.apache.poi.openxml4j.opc.PackagePart;
  */
 public final class DataExtraction {
 
-    public static void main(String args[]) throws IOException, OpenXML4JException {
+    public static void main(String[] args) throws IOException, OpenXML4JException {
 
         PrintStream out = System.out;
 
index 2eb9ffff65e2c46081fe9cb5590815c3edae0d4d..75617f672e0982fa4ff4137b46e7aae35e5a72c4 100644 (file)
@@ -27,7 +27,7 @@ import java.io.FileOutputStream;
  */
 public final class MergePresentations {
 
-    public static void main(String args[]) throws Exception {
+    public static void main(String[] args) throws Exception {
         try (XMLSlideShow ppt = new XMLSlideShow()) {
             for (String arg : args) {
                 try (FileInputStream is = new FileInputStream(arg);
index 825a4b390600215b2c8c5f77a5f3dfcf26d439fc..05ad9ae66fe5193243925486f56513161b6b1c62 100644 (file)
@@ -53,7 +53,7 @@ public class EscherBitmapBlip extends EscherBlipRecord {
 
         System.arraycopy( field_1_UID, 0, data, pos, 16 );
         data[pos + 16] = field_2_marker;
-        byte pd[] = getPicturedata();
+        byte[] pd = getPicturedata();
         System.arraycopy( pd, 0, data, pos + 17, pd.length );
 
         listener.afterRecordSerialize(offset + getRecordSize(), getRecordId(), getRecordSize(), this);
index c25d91902d0529242810bdcce9b1b42d90b3d7e3..45fce3642734d0b60cef9dcecb837f0d70260a5a 100644 (file)
@@ -93,7 +93,7 @@ public abstract class EscherRecord implements Cloneable {
      * @param offset    the offset to start reading from
      * @return          value of instance part of options field
      */
-    protected static short readInstance( byte data[], int offset ) {
+    protected static short readInstance(byte[] data, int offset ) {
         final short options = LittleEndian.getShort( data, offset );
         return fInstance.getShortValue( options );
     }
index 1411d0490f13f10aaf98f27737068059d745335f..0c1bcf263d93406ae5886d14722c92c582ef954b 100644 (file)
@@ -831,7 +831,7 @@ public class Section {
             }
 
             try {
-                byte buf[] = IOUtils.safelyAllocate(nrBytes, MAX_RECORD_LENGTH);
+                byte[] buf = IOUtils.safelyAllocate(nrBytes, MAX_RECORD_LENGTH);
                 leis.readFully(buf, 0, nrBytes);
                 final String str = CodePageUtil.getStringFromCodePage(buf, 0, nrBytes, cp);
 
@@ -862,7 +862,7 @@ public class Section {
      */
     private void writeDictionary(final OutputStream out, final int codepage)
     throws IOException {
-        final byte padding[] = new byte[4];
+        final byte[] padding = new byte[4];
         final Map<Long,String> dic = getDictionary();
 
         LittleEndian.putUInt(dic.size(), out);
@@ -873,7 +873,7 @@ public class Section {
             length += LittleEndianConsts.INT_SIZE;
 
             final String value = ls.getValue()+"\0";
-            final byte bytes[] = CodePageUtil.getBytesInCodePage(value, codepage);
+            final byte[] bytes = CodePageUtil.getBytesInCodePage(value, codepage);
             final int len = (codepage == CodePageUtil.CP_UNICODE) ? value.length() : bytes.length;
 
             LittleEndian.putUInt( len, out );
index 87acdc066a47862bb8cdfd384f235fea2cedc672..f7b541b101c77fefdeb6b3cf714e89c50cbf3dd8 100644 (file)
@@ -342,47 +342,47 @@ public class Variant
      */
     public static final Integer LENGTH_8 = 8;
 
-    private static final Object NUMBER_TO_NAME_LIST[][] = {
-        {  0L, "VT_EMPTY",           LENGTH_0 },
-        {  1L, "VT_NULL",            LENGTH_UNKNOWN },
-        {  2L, "VT_I2",              LENGTH_2 },
-        {  3L, "VT_I4",              LENGTH_4 },
-        {  4L, "VT_R4",              LENGTH_4 },
-        {  5L, "VT_R8",              LENGTH_8 },
-        {  6L, "VT_CY",              LENGTH_UNKNOWN },
-        {  7L, "VT_DATE",            LENGTH_UNKNOWN },
-        {  8L, "VT_BSTR",            LENGTH_UNKNOWN },
-        {  9L, "VT_DISPATCH",        LENGTH_UNKNOWN },
-        { 10L, "VT_ERROR",           LENGTH_UNKNOWN },
-        { 11L, "VT_BOOL",            LENGTH_UNKNOWN },
-        { 12L, "VT_VARIANT",         LENGTH_UNKNOWN },
-        { 13L, "VT_UNKNOWN",         LENGTH_UNKNOWN },
-        { 14L, "VT_DECIMAL",         LENGTH_UNKNOWN },
-        { 16L, "VT_I1",              LENGTH_UNKNOWN },
-        { 17L, "VT_UI1",             LENGTH_UNKNOWN },
-        { 18L, "VT_UI2",             LENGTH_UNKNOWN },
-        { 19L, "VT_UI4",             LENGTH_UNKNOWN },
-        { 20L, "VT_I8",              LENGTH_UNKNOWN },
-        { 21L, "VT_UI8",             LENGTH_UNKNOWN },
-        { 22L, "VT_INT",             LENGTH_UNKNOWN },
-        { 23L, "VT_UINT",            LENGTH_UNKNOWN },
-        { 24L, "VT_VOID",            LENGTH_UNKNOWN },
-        { 25L, "VT_HRESULT",         LENGTH_UNKNOWN },
-        { 26L, "VT_PTR",             LENGTH_UNKNOWN },
-        { 27L, "VT_SAFEARRAY",       LENGTH_UNKNOWN },
-        { 28L, "VT_CARRAY",          LENGTH_UNKNOWN },
-        { 29L, "VT_USERDEFINED",     LENGTH_UNKNOWN },
-        { 30L, "VT_LPSTR",           LENGTH_VARIABLE },
-        { 31L, "VT_LPWSTR",          LENGTH_UNKNOWN },
-        { 64L, "VT_FILETIME",        LENGTH_8 },
-        { 65L, "VT_BLOB",            LENGTH_UNKNOWN },
-        { 66L, "VT_STREAM",          LENGTH_UNKNOWN },
-        { 67L, "VT_STORAGE",         LENGTH_UNKNOWN },
-        { 68L, "VT_STREAMED_OBJECT", LENGTH_UNKNOWN },
-        { 69L, "VT_STORED_OBJECT",   LENGTH_UNKNOWN },
-        { 70L, "VT_BLOB_OBJECT",     LENGTH_UNKNOWN },
-        { 71L, "VT_CF",              LENGTH_UNKNOWN },
-        { 72L, "VT_CLSID",           LENGTH_UNKNOWN }
+    private static final Object[][] NUMBER_TO_NAME_LIST = {
+            {0L, "VT_EMPTY", LENGTH_0},
+            {1L, "VT_NULL", LENGTH_UNKNOWN},
+            {2L, "VT_I2", LENGTH_2},
+            {3L, "VT_I4", LENGTH_4},
+            {4L, "VT_R4", LENGTH_4},
+            {5L, "VT_R8", LENGTH_8},
+            {6L, "VT_CY", LENGTH_UNKNOWN},
+            {7L, "VT_DATE", LENGTH_UNKNOWN},
+            {8L, "VT_BSTR", LENGTH_UNKNOWN},
+            {9L, "VT_DISPATCH", LENGTH_UNKNOWN},
+            {10L, "VT_ERROR", LENGTH_UNKNOWN},
+            {11L, "VT_BOOL", LENGTH_UNKNOWN},
+            {12L, "VT_VARIANT", LENGTH_UNKNOWN},
+            {13L, "VT_UNKNOWN", LENGTH_UNKNOWN},
+            {14L, "VT_DECIMAL", LENGTH_UNKNOWN},
+            {16L, "VT_I1", LENGTH_UNKNOWN},
+            {17L, "VT_UI1", LENGTH_UNKNOWN},
+            {18L, "VT_UI2", LENGTH_UNKNOWN},
+            {19L, "VT_UI4", LENGTH_UNKNOWN},
+            {20L, "VT_I8", LENGTH_UNKNOWN},
+            {21L, "VT_UI8", LENGTH_UNKNOWN},
+            {22L, "VT_INT", LENGTH_UNKNOWN},
+            {23L, "VT_UINT", LENGTH_UNKNOWN},
+            {24L, "VT_VOID", LENGTH_UNKNOWN},
+            {25L, "VT_HRESULT", LENGTH_UNKNOWN},
+            {26L, "VT_PTR", LENGTH_UNKNOWN},
+            {27L, "VT_SAFEARRAY", LENGTH_UNKNOWN},
+            {28L, "VT_CARRAY", LENGTH_UNKNOWN},
+            {29L, "VT_USERDEFINED", LENGTH_UNKNOWN},
+            {30L, "VT_LPSTR", LENGTH_VARIABLE},
+            {31L, "VT_LPWSTR", LENGTH_UNKNOWN},
+            {64L, "VT_FILETIME", LENGTH_8},
+            {65L, "VT_BLOB", LENGTH_UNKNOWN},
+            {66L, "VT_STREAM", LENGTH_UNKNOWN},
+            {67L, "VT_STORAGE", LENGTH_UNKNOWN},
+            {68L, "VT_STREAMED_OBJECT", LENGTH_UNKNOWN},
+            {69L, "VT_STORED_OBJECT", LENGTH_UNKNOWN},
+            {70L, "VT_BLOB_OBJECT", LENGTH_UNKNOWN},
+            {71L, "VT_CF", LENGTH_UNKNOWN},
+            {72L, "VT_CLSID", LENGTH_UNKNOWN}
     };
 
     /* Initialize the number-to-name and number-to-length map: */
index 631be8fd2d2ad57616d63bbf5a5ee7560d204ed9..7234cde5f6b9dc66e399e3ea5b2d84e421b7235d 100644 (file)
@@ -699,7 +699,7 @@ public final class BiffViewer {
                return ib;
        }
 
-       private static void writeHex(char buf[], int startInBuf, int value, int nDigits) {
+       private static void writeHex(char[] buf, int startInBuf, int value, int nDigits) {
                int acc = value;
                for(int i=nDigits-1; i>=0; i--) {
                        int digit = acc & 0x0F;
index c2d79341959b1d7cdb63ee01ef82c0679e0847da..b5f0d3f5f02e1f964cfb08037fdd5f386bbf1864 100644 (file)
@@ -210,7 +210,7 @@ public class FormulaViewer
      * @param args pass one argument with the filename or --help
      * @throws IOException if the file can't be read or contained errors
      */
-    public static void main(String args[]) throws IOException
+    public static void main(String[] args) throws IOException
     {
         if ((args == null) || (args.length >2 )
                 || args[ 0 ].equals("--help"))
index 4ff370125ca8c658ad792fe3d9d09ccd328e9fc6..da9ecab3375f98be563b0699a84cc178ec60a501 100644 (file)
@@ -1338,7 +1338,7 @@ public final class InternalWorkbook {
      */
     private static FormatRecord createFormat(int id) {
         // we'll need multiple editions for the different formats
-        final int mappings[] = { 5, 6, 7, 8, 0x2a, 0x29, 0x2c, 0x2b };
+        final int[] mappings = {5, 6, 7, 8, 0x2a, 0x29, 0x2c, 0x2b};
         if (id < 0 || id >= mappings.length) {
             throw new  IllegalArgumentException("Unexpected id " + id);
         }
@@ -1433,8 +1433,8 @@ public final class InternalWorkbook {
      */
     private static StyleRecord createStyle(int id) {
         // we'll need multiple editions
-        final int mappings[][] = {
-            { 0x010, 3 }, { 0x011, 6 }, { 0x012, 4 }, { 0x013, 7 }, { 0x000, 0 }, { 0x014, 5 }  
+        final int[][] mappings = {
+                {0x010, 3}, {0x011, 6}, {0x012, 4}, {0x013, 7}, {0x000, 0}, {0x014, 5}
         };
         if (id < 0 || id >= mappings.length) {
             throw new  IllegalArgumentException("Unexpected style id " + id);
index 61b92831c909429c6d08460ff28ea5ec019caf26..af6853eb2e3c14def9e81a654696f88233dfc1b9 100644 (file)
@@ -62,7 +62,7 @@ public final class BoundSheetRecord extends StandardRecord {
         * @param in the record stream to read from
         */
        public BoundSheetRecord(RecordInputStream in) {
-           byte buf[] = new byte[LittleEndianConsts.INT_SIZE];
+        byte[] buf = new byte[LittleEndianConsts.INT_SIZE];
            in.readPlain(buf, 0, buf.length);
                field_1_position_of_BOF = LittleEndian.getInt(buf);
                field_2_option_flags = in.readUShort();
index 5955e6d1355f91446d2bbd877a050f0a0c681246..3b54d058d28b81b539b8908b38a074f5032643f6 100644 (file)
@@ -88,7 +88,7 @@ public final class FilePassRecord extends StandardRecord implements Cloneable {
     public void serialize(LittleEndianOutput out) {
         out.writeShort(encryptionType);
 
-        byte data[] = new byte[1024];
+        byte[] data = new byte[1024];
         LittleEndianByteArrayOutputStream bos = new LittleEndianByteArrayOutputStream(data, 0); // NOSONAR
 
         switch (encryptionInfo.getEncryptionMode()) {
index b3659db994feb7c9d10f2a97e5e43c9eb9abc20b..07afe958364f7e0c9860521ddafbf16b60b03def 100644 (file)
@@ -55,7 +55,7 @@ public final class WSBoolRecord extends StandardRecord {
 
     public WSBoolRecord(RecordInputStream in)
     {
-       byte data[] = in.readRemainder();
+        byte[] data = in.readRemainder();
         field_1_wsbool =
             data[ 1 ];   // backwards because theoretically this is one short field
         field_2_wsbool =
index 99c5d46dc9d5155aefad4e84c337761dfc44f4a4..b9a7638789c243a6196629f6d9f0c29f12415879 100644 (file)
@@ -41,12 +41,12 @@ public final class Biff8DecryptingStream implements BiffHeaderInput, LittleEndia
     private static final int MAX_RECORD_LENGTH = 100_000;
 
     private ChunkedCipherInputStream ccis;
-    private final byte buffer[] = new byte[LittleEndianConsts.LONG_SIZE];
+    private final byte[] buffer = new byte[LittleEndianConsts.LONG_SIZE];
     private boolean shouldSkipEncryptionOnCurrentRecord;
 
        public Biff8DecryptingStream(InputStream in, int initialOffset, EncryptionInfo info) throws RecordFormatException {
         try {
-           byte initialBuf[] = IOUtils.safelyAllocate(initialOffset, MAX_RECORD_LENGTH);
+            byte[] initialBuf = IOUtils.safelyAllocate(initialOffset, MAX_RECORD_LENGTH);
            InputStream stream;
            if (initialOffset == 0) {
                stream = in;
@@ -207,7 +207,7 @@ public final class Biff8DecryptingStream implements BiffHeaderInput, LittleEndia
     }
 
     @Override
-    public void readPlain(byte b[], int off, int len) {
+    public void readPlain(byte[] b, int off, int len) {
         ccis.readPlain(b, off, len);
     }
 
index ede62933ab4041c795d37b3466e1054ca97cf102..aedfcdaa22c4ef20ab84f0865d23877f6e1c16a3 100644 (file)
@@ -244,8 +244,8 @@ public class EscherGraphics extends Graphics
     }
 
     @Override
-    public void drawPolygon(int xPoints[], int yPoints[],
-                                    int nPoints)
+    public void drawPolygon(int[] xPoints, int[] yPoints,
+                            int nPoints)
     {
         int right  = findBiggest(xPoints);
         int bottom = findBiggest(yPoints);
@@ -269,8 +269,8 @@ public class EscherGraphics extends Graphics
 
     @Override
     @NotImplemented
-    public void drawPolyline(int xPoints[], int yPoints[],
-                                     int nPoints)
+    public void drawPolyline(int[] xPoints, int[] yPoints,
+                             int nPoints)
     {
         if (logger.check( POILogger.WARN ))
             logger.log(POILogger.WARN,"drawPolyline not supported");
@@ -401,8 +401,8 @@ public class EscherGraphics extends Graphics
      * @see   java.awt.Graphics#drawPolygon(int[], int[], int)
      */
     @Override
-    public void fillPolygon(int xPoints[], int yPoints[],
-                                    int nPoints)
+    public void fillPolygon(int[] xPoints, int[] yPoints,
+                            int nPoints)
     {
         int right  = findBiggest(xPoints);
         int bottom = findBiggest(yPoints);
index 5235a70221f6b7885ebe00c30f922d80d178bd34..fe6770c4f106b6a417cc03a81c801a250d2b98ef 100644 (file)
@@ -243,13 +243,13 @@ public final class EscherGraphics2d extends Graphics2D {
 //        draw(new java.awt.geom.Ellipse2D.Float(x, y, width, height));
     }
 
-    public void drawPolygon(int xPoints[], int yPoints[],
-                                    int nPoints)
+    public void drawPolygon(int[] xPoints, int[] yPoints,
+                            int nPoints)
     {
         getEscherGraphics().drawPolygon(xPoints, yPoints, nPoints);
     }
 
-    public void drawPolyline(int xPoints[], int yPoints[], int nPoints)
+    public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
     {
         if(nPoints > 0)
         {
@@ -343,7 +343,7 @@ public final class EscherGraphics2d extends Graphics2D {
      * @param nPoints the total number of points in the polygon.
      * @see   java.awt.Graphics#drawPolygon(int[], int[], int)
      */
-    public void fillPolygon(int xPoints[], int yPoints[], int nPoints)
+    public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
     {
         _escherGraphics.fillPolygon(xPoints, yPoints, nPoints);
     }
index dd049d2933b317f6afb2ced22218c76f3416bb5a..d40ec07fcd7c1eefb567503f65e5024221ae9be4 100644 (file)
@@ -151,7 +151,7 @@ public class FontDetails
         int listSize = tok.countTokens();
         if(max != -1 && listSize > max)
             listSize = max;
-        String list[] = new String[listSize];
+        String[] list = new String[listSize];
         for(int i = 0; tok.hasMoreTokens(); i++)
         {
             if(max != -1 && i == listSize - 1)
index c3d9fdafe27c577c903b1ca6d934fa92be4d54fe..e10a3e973a656127b3a11033deaf9011f9f0d732 100644 (file)
@@ -256,7 +256,7 @@ public class HSSFPicture extends HSSFSimpleShape implements Picture {
     
     public void setFileName(String data){
         // TODO: add trailing \u0000? 
-        byte bytes[] = StringUtil.getToUnicodeLE(data);
+        byte[] bytes = StringUtil.getToUnicodeLE(data);
         EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME, true, bytes);
         setPropertyValue(prop);
     }
index f889d2704dca59ed6ec36c9a63b8409fc3a4b6d5..c7019cfe38affdb02843f704b76ca1fb502f70ce 100644 (file)
@@ -1508,7 +1508,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
     }
 
     @SuppressWarnings("resource")
-    void encryptBytes(byte buf[]) {
+    void encryptBytes(byte[] buf) {
         EncryptionInfo ei = getEncryptionInfo();
         if (ei == null) {
             return;
@@ -1518,7 +1518,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
         LittleEndianByteArrayInputStream plain = new LittleEndianByteArrayInputStream(buf, 0); // NOSONAR
         LittleEndianByteArrayOutputStream leos = new LittleEndianByteArrayOutputStream(buf, 0); // NOSONAR
         enc.setChunkSize(Biff8DecryptingStream.RC4_REKEYING_INTERVAL);
-        byte tmp[] = new byte[1024];
+        byte[] tmp = new byte[1024];
         try {
             ChunkedCipherOutputStream os = enc.getDataStream(leos, initialOffset);
             int totalBytes = 0;
@@ -1532,7 +1532,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
                 if (sid == BoundSheetRecord.sid) {
                     // special case for the field_1_position_of_BOF (=lbPlyPos) field of
                     // the BoundSheet8 record which must be unencrypted
-                    byte bsrBuf[] = IOUtils.safelyAllocate(len, MAX_RECORD_LENGTH);
+                    byte[] bsrBuf = IOUtils.safelyAllocate(len, MAX_RECORD_LENGTH);
                     plain.readFully(bsrBuf);
                     os.writePlain(bsrBuf, 0, 4);
                     os.write(bsrBuf, 4, len-4);
@@ -1877,7 +1877,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
                 // remove first 22 bytes if file starts with magic bytes D7-CD-C6-9A
                 // see also http://de.wikipedia.org/wiki/Windows_Metafile#Hinweise_zur_WMF-Spezifikation
                 if (LittleEndian.getInt(pictureData) == 0x9AC6CDD7) {
-                    byte picDataNoHeader[] = new byte[pictureData.length-22];
+                    byte[] picDataNoHeader = new byte[pictureData.length - 22];
                     System.arraycopy(pictureData, 22, picDataNoHeader, 0, pictureData.length-22);
                     pictureData = picDataNoHeader;
                 }
@@ -2260,15 +2260,15 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
             // check if the password has been changed
             EncryptionInfo ei = fpr.getEncryptionInfo();
             EncryptionVerifier ver = ei.getVerifier();
-            byte encVer[] = ver.getEncryptedVerifier();
+            byte[] encVer = ver.getEncryptedVerifier();
             Decryptor dec = ei.getDecryptor();
             Encryptor enc = ei.getEncryptor();
             try {
                 if (encVer == null || !dec.verifyPassword(password)) {
                     enc.confirmPassword(password);
                 } else {
-                    byte verifier[] = dec.getVerifier();
-                    byte salt[] = ver.getSalt();
+                    byte[] verifier = dec.getVerifier();
+                    byte[] salt = ver.getSalt();
                     enc.confirmPassword(password, null, null, verifier, salt, null);
                 }
             } catch (GeneralSecurityException e) {
index 0b84362670d58340db1fc0fc26b73a6f3f92675b..40b0e28ddbfa37b20880ab8db8909a6405b37172 100644 (file)
@@ -226,7 +226,7 @@ public abstract class ChunkedCipherInputStream extends LittleEndianInputStream {
      * 
      */
     @Override
-    public void readPlain(byte b[], int off, int len) {
+    public void readPlain(byte[] b, int off, int len) {
         if (len <= 0) {
             return;
         }
index 0aa73fd670a3fca74104069d739b4948217e9074..b98e229d8ee71abbebbed6eaffc0119859d7d2a7 100644 (file)
@@ -220,7 +220,7 @@ public abstract class ChunkedCipherOutputStream extends FilterOutputStream {
      * @throws ShortBufferException
      */
     protected int invokeCipher(int posInChunk, boolean doFinal) throws GeneralSecurityException, IOException {
-        byte plain[] = (plainByteFlags.isEmpty()) ? null : chunk.clone();
+        byte[] plain = (plainByteFlags.isEmpty()) ? null : chunk.clone();
 
         int ciLen = (doFinal)
             ? cipher.doFinal(chunk, 0, posInChunk, chunk)
@@ -316,7 +316,7 @@ public abstract class ChunkedCipherOutputStream extends FilterOutputStream {
                     // encrypted within the EncryptedData field, not including the size of the StreamSize field.
                     // Note that the actual size of the \EncryptedPackage stream (1) can be larger than this
                     // value, depending on the block size of the chosen encryption algorithm
-                    byte buf[] = new byte[LittleEndianConsts.LONG_SIZE];
+                    byte[] buf = new byte[LittleEndianConsts.LONG_SIZE];
                     LittleEndian.putLong(buf, 0, pos);
                     os.write(buf);
 
index 6da96d85242f7470b450f14f5b868acb5d10f0f3..5ec778617c1ac158ca10b476a79d68341901f10a 100644 (file)
@@ -41,13 +41,13 @@ public enum CipherAlgorithm {
     public final String jceId;
     public final int ecmaId;
     public final int defaultKeySize;
-    public final int allowedKeySize[];
+    public final int[] allowedKeySize;
     public final int blockSize;
     public final int encryptedVerifierHashLength;
     public final String xmlId;
     public final boolean needsBouncyCastle;
     
-    CipherAlgorithm(CipherProvider provider, String jceId, int ecmaId, int defaultKeySize, int allowedKeySize[], int blockSize, int encryptedVerifierHashLength, String xmlId, boolean needsBouncyCastle) {
+    CipherAlgorithm(CipherProvider provider, String jceId, int ecmaId, int defaultKeySize, int[] allowedKeySize, int blockSize, int encryptedVerifierHashLength, String xmlId, boolean needsBouncyCastle) {
         this.provider = provider;
         this.jceId = jceId;
         this.ecmaId = ecmaId;
index 4a984929b6bc5e9cce18dc25dffc3c849dd0e281..d4908fcae5489e6c60e36dec81d5388b76cea7a5 100644 (file)
@@ -84,7 +84,7 @@ public class CryptoFunctions {
      * @param spinCount
      * @return the hashed password
      */
-    public static byte[] hashPassword(String password, HashAlgorithm hashAlgorithm, byte salt[], int spinCount) {
+    public static byte[] hashPassword(String password, HashAlgorithm hashAlgorithm, byte[] salt, int spinCount) {
         return hashPassword(password, hashAlgorithm, salt, spinCount, true);
     }
         
@@ -101,7 +101,7 @@ public class CryptoFunctions {
      *        if false the n-1 hash value is applied first
      * @return the hashed password
      */
-    public static byte[] hashPassword(String password, HashAlgorithm hashAlgorithm, byte salt[], int spinCount, boolean iteratorFirst) {
+    public static byte[] hashPassword(String password, HashAlgorithm hashAlgorithm, byte[] salt, int spinCount, boolean iteratorFirst) {
         // If no password was given, use the default
         if (password == null) {
             password = Decryptor.DEFAULT_PASSWORD;
@@ -149,7 +149,7 @@ public class CryptoFunctions {
      * </ul> 
      **/
     public static byte[] generateIv(HashAlgorithm hashAlgorithm, byte[] salt, byte[] blockKey, int blockSize) {
-        byte iv[] = salt;
+        byte[] iv = salt;
         if (blockKey != null) {
             MessageDigest hashAlgo = getMessageDigest(hashAlgorithm);
             hashAlgo.update(salt);
@@ -333,34 +333,34 @@ public class CryptoFunctions {
         }
     }
 
-    private static final int INITIAL_CODE_ARRAY[] = { 
-        0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE, 
-        0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A, 
-        0x4EC3
+    private static final int[] INITIAL_CODE_ARRAY = {
+            0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE,
+            0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A,
+            0x4EC3
     };
 
-    private static final byte PAD_ARRAY[] = {
-        (byte)0xBB, (byte)0xFF, (byte)0xFF, (byte)0xBA, (byte)0xFF,
-        (byte)0xFF, (byte)0xB9, (byte)0x80, (byte)0x00, (byte)0xBE,
-        (byte)0x0F, (byte)0x00, (byte)0xBF, (byte)0x0F, (byte)0x00
+    private static final byte[] PAD_ARRAY = {
+            (byte) 0xBB, (byte) 0xFF, (byte) 0xFF, (byte) 0xBA, (byte) 0xFF,
+            (byte) 0xFF, (byte) 0xB9, (byte) 0x80, (byte) 0x00, (byte) 0xBE,
+            (byte) 0x0F, (byte) 0x00, (byte) 0xBF, (byte) 0x0F, (byte) 0x00
     };
-    
-    private static final int ENCRYPTION_MATRIX[][] = {
-        /* char 1  */ {0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09},
-        /* char 2  */ {0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF},
-        /* char 3  */ {0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0},
-        /* char 4  */ {0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40},
-        /* char 5  */ {0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5},
-        /* char 6  */ {0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A},
-        /* char 7  */ {0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9},
-        /* char 8  */ {0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0},
-        /* char 9  */ {0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC},
-        /* char 10 */ {0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10},
-        /* char 11 */ {0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168},
-        /* char 12 */ {0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C},
-        /* char 13 */ {0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD},
-        /* char 14 */ {0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC},
-        /* char 15 */ {0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4}
+
+    private static final int[][] ENCRYPTION_MATRIX = {
+            /* char 1  */ {0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09},
+            /* char 2  */ {0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF},
+            /* char 3  */ {0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0},
+            /* char 4  */ {0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40},
+            /* char 5  */ {0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5},
+            /* char 6  */ {0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A},
+            /* char 7  */ {0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9},
+            /* char 8  */ {0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0},
+            /* char 9  */ {0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC},
+            /* char 10 */ {0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10},
+            /* char 11 */ {0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168},
+            /* char 12 */ {0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C},
+            /* char 13 */ {0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD},
+            /* char 14 */ {0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC},
+            /* char 15 */ {0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4}
     };
 
     /**
@@ -514,11 +514,11 @@ public class CryptoFunctions {
         if (password.length() > 15) {
             password = password.substring(0, 15);
         }
-        byte passBytes[] = password.getBytes(Charset.forName("ASCII"));
+        byte[] passBytes = password.getBytes(Charset.forName("ASCII"));
         
         // this code is based on the libre office implementation.
         // The MS-OFFCRYPTO misses some infos about the various rotation sizes 
-        byte obfuscationArray[] = new byte[16];
+        byte[] obfuscationArray = new byte[16];
         System.arraycopy(passBytes, 0, obfuscationArray, 0, passBytes.length);
         System.arraycopy(PAD_ARRAY, 0, obfuscationArray, passBytes.length, PAD_ARRAY.length-passBytes.length+1);
         
@@ -526,8 +526,8 @@ public class CryptoFunctions {
         
         // rotation of key values is application dependent - Excel = 2 / Word = 7 
         int nRotateSize = 2;
-        
-        byte baseKeyLE[] = { (byte)(xorKey & 0xFF), (byte)((xorKey >>> 8) & 0xFF) };
+
+        byte[] baseKeyLE = {(byte) (xorKey & 0xFF), (byte) ((xorKey >>> 8) & 0xFF)};
         for (int i=0; i<obfuscationArray.length; i++) {
             obfuscationArray[i] ^= baseKeyLE[i&1];
             obfuscationArray[i] = rotateLeft(obfuscationArray[i], nRotateSize);
index 5f21b52b909acb192f3ad8ec1cc469427c8396f6..09a56e2e81004611c4265afb5e25d560504d4425 100644 (file)
@@ -64,14 +64,14 @@ public class DataSpaceMapUtils {
     }
     
     public static DocumentEntry createEncryptionEntry(DirectoryEntry dir, String path, EncryptionRecord out) throws IOException {
-        String parts[] = path.split("/");
+        String[] parts = path.split("/");
         for (int i=0; i<parts.length-1; i++) {
             dir = dir.hasEntry(parts[i])
                 ? (DirectoryEntry)dir.getEntry(parts[i])
                 : dir.createDirectory(parts[i]);
         }
-        
-        final byte buf[] = new byte[5000];        
+
+        final byte[] buf = new byte[5000];
         LittleEndianByteArrayOutputStream bos = new LittleEndianByteArrayOutputStream(buf, 0);
         out.write(bos);
         
@@ -93,9 +93,9 @@ public class DataSpaceMapUtils {
     }   
     
     public static class DataSpaceMap implements EncryptionRecord {
-        DataSpaceMapEntry entries[];
+        DataSpaceMapEntry[] entries;
         
-        public DataSpaceMap(DataSpaceMapEntry entries[]) {
+        public DataSpaceMap(DataSpaceMapEntry[] entries) {
             this.entries = entries.clone();
         }
         
@@ -118,11 +118,11 @@ public class DataSpaceMapUtils {
     }
     
     public static class DataSpaceMapEntry implements EncryptionRecord {
-        final int referenceComponentType[];
-        final String referenceComponent[];
+        final int[] referenceComponentType;
+        final String[] referenceComponent;
         final String dataSpaceName;
         
-        public DataSpaceMapEntry(int referenceComponentType[], String referenceComponent[], String dataSpaceName) {
+        public DataSpaceMapEntry(int[] referenceComponentType, String[] referenceComponent, String dataSpaceName) {
             this.referenceComponentType = referenceComponentType.clone();
             this.referenceComponent = referenceComponent.clone();
             this.dataSpaceName = dataSpaceName;
@@ -154,9 +154,9 @@ public class DataSpaceMapUtils {
     }
     
     public static class DataSpaceDefinition implements EncryptionRecord {
-        String transformer[];
+        String[] transformer;
         
-        public DataSpaceDefinition(String transformer[]) {
+        public DataSpaceDefinition(String[] transformer) {
             this.transformer = transformer.clone();
         }
         
@@ -322,7 +322,7 @@ public class DataSpaceMapUtils {
     }
     
     public static void writeUnicodeLPP4(LittleEndianOutput os, String string) {
-        byte buf[] = StringUtil.getToUnicodeLE(string);
+        byte[] buf = StringUtil.getToUnicodeLE(string);
         os.writeInt(buf.length);
         os.write(buf);
         if (buf.length%4==2) {
@@ -336,8 +336,8 @@ public class DataSpaceMapUtils {
             /* int skip = */ is.readInt();
             return length == 0 ? null : "";
         }
-        
-        byte data[] = IOUtils.safelyAllocate(length, MAX_RECORD_LENGTH);
+
+        byte[] data = IOUtils.safelyAllocate(length, MAX_RECORD_LENGTH);
         is.readFully(data);
 
         // Padding (variable): A set of bytes that MUST be of correct size such that the size of the UTF-8-LP-P4
@@ -360,7 +360,7 @@ public class DataSpaceMapUtils {
             os.writeInt(str == null ? 0 : 4);
             os.writeInt(0);
         } else {
-            byte buf[] = str.getBytes(StandardCharsets.UTF_8);
+            byte[] buf = str.getBytes(StandardCharsets.UTF_8);
             os.writeInt(buf.length);
             os.write(buf);
             int scratchBytes = buf.length%4;
index 616dbcf19e07e622e20590be89d345a577958022..a00ac44c826b8993ae37196928a1a1a5eec79945 100644 (file)
@@ -130,7 +130,7 @@ public abstract class EncryptionHeader implements Cloneable {
         return keySalt;
     }
     
-    protected void setKeySalt(byte salt[]) {
+    protected void setKeySalt(byte[] salt) {
         this.keySalt = (salt == null) ? null : salt.clone();
     }
 
index b86fef1edcb3401f80f0e2c32003e38cf93c39b7..b62ad862fe2981a93ee8916edb7424aca76a6052 100644 (file)
@@ -42,7 +42,7 @@ public abstract class Encryptor implements Cloneable {
         throws IOException, GeneralSecurityException;
 
     // for tests
-    public abstract void confirmPassword(String password, byte keySpec[], byte keySalt[], byte verifier[], byte verifierSalt[], byte integritySalt[]);
+    public abstract void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt);
     
     public abstract void confirmPassword(String password);
        
index 4e1964b28ce1778e604eddee997fa4ace596e541..176e779b31bb9235a395e7a5d55f2b695875d76e 100644 (file)
@@ -66,15 +66,15 @@ public class BinaryRC4Decryptor extends Decryptor implements Cloneable {
         SecretKey skey = generateSecretKey(password, ver);
         try {
             Cipher cipher = initCipherForBlock(null, 0, getEncryptionInfo(), skey, Cipher.DECRYPT_MODE);
-            byte encryptedVerifier[] = ver.getEncryptedVerifier();
-            byte verifier[] = new byte[encryptedVerifier.length];
+            byte[] encryptedVerifier = ver.getEncryptedVerifier();
+            byte[] verifier = new byte[encryptedVerifier.length];
             cipher.update(encryptedVerifier, 0, encryptedVerifier.length, verifier);
             setVerifier(verifier);
-            byte encryptedVerifierHash[] = ver.getEncryptedVerifierHash();
-            byte verifierHash[] = cipher.doFinal(encryptedVerifierHash);
+            byte[] encryptedVerifierHash = ver.getEncryptedVerifierHash();
+            byte[] verifierHash = cipher.doFinal(encryptedVerifierHash);
             HashAlgorithm hashAlgo = ver.getHashAlgorithm();
             MessageDigest hashAlg = CryptoFunctions.getMessageDigest(hashAlgo);
-            byte calcVerifierHash[] = hashAlg.digest(verifier);
+            byte[] calcVerifierHash = hashAlg.digest(verifier);
             if (Arrays.equals(calcVerifierHash, verifierHash)) {
                 setSecretKey(skey);
                 return true;
@@ -96,9 +96,9 @@ public class BinaryRC4Decryptor extends Decryptor implements Cloneable {
     throws GeneralSecurityException {
         EncryptionVerifier ver = encryptionInfo.getVerifier();
         HashAlgorithm hashAlgo = ver.getHashAlgorithm();
-        byte blockKey[] = new byte[4];
+        byte[] blockKey = new byte[4];
         LittleEndian.putUInt(blockKey, 0, block);
-        byte encKey[] = CryptoFunctions.generateKey(skey.getEncoded(), hashAlgo, blockKey, 16);
+        byte[] encKey = CryptoFunctions.generateKey(skey.getEncoded(), hashAlgo, blockKey, 16);
         SecretKey key = new SecretKeySpec(encKey, skey.getAlgorithm());
         if (cipher == null) {
             EncryptionHeader em = encryptionInfo.getHeader();
@@ -115,8 +115,8 @@ public class BinaryRC4Decryptor extends Decryptor implements Cloneable {
         }
         HashAlgorithm hashAlgo = ver.getHashAlgorithm();
         MessageDigest hashAlg = CryptoFunctions.getMessageDigest(hashAlgo);
-        byte hash[] = hashAlg.digest(StringUtil.getToUnicodeLE(password));
-        byte salt[] = ver.getSalt();
+        byte[] hash = hashAlg.digest(StringUtil.getToUnicodeLE(password));
+        byte[] salt = ver.getSalt();
         hashAlg.reset();
         for (int i = 0; i < 16; i++) {
             hashAlg.update(hash, 0, 5);
index b20ed0ce7626a193e7ef7e831a63f033f01989fe..098a69452ac6e894c5cd6c4a0670a08b369e639a 100644 (file)
@@ -34,13 +34,13 @@ public class BinaryRC4EncryptionVerifier extends EncryptionVerifier implements E
     }
 
     protected BinaryRC4EncryptionVerifier(LittleEndianInput is) {
-        byte salt[] = new byte[16];
+        byte[] salt = new byte[16];
         is.readFully(salt);
         setSalt(salt);
-        byte encryptedVerifier[] = new byte[16];
+        byte[] encryptedVerifier = new byte[16];
         is.readFully(encryptedVerifier);
         setEncryptedVerifier(encryptedVerifier);
-        byte encryptedVerifierHash[] = new byte[16];
+        byte[] encryptedVerifierHash = new byte[16];
         is.readFully(encryptedVerifierHash);
         setEncryptedVerifierHash(encryptedVerifierHash);
         setSpinCount(-1);
@@ -51,7 +51,7 @@ public class BinaryRC4EncryptionVerifier extends EncryptionVerifier implements E
     }
 
     @Override
-    protected void setSalt(byte salt[]) {
+    protected void setSalt(byte[] salt) {
         if (salt == null || salt.length != 16) {
             throw new EncryptedDocumentException("invalid verifier salt");
         }
@@ -60,24 +60,24 @@ public class BinaryRC4EncryptionVerifier extends EncryptionVerifier implements E
     }
 
     @Override
-    protected void setEncryptedVerifier(byte encryptedVerifier[]) {
+    protected void setEncryptedVerifier(byte[] encryptedVerifier) {
         super.setEncryptedVerifier(encryptedVerifier);
     }
 
     @Override
-    protected void setEncryptedVerifierHash(byte encryptedVerifierHash[]) {
+    protected void setEncryptedVerifierHash(byte[] encryptedVerifierHash) {
         super.setEncryptedVerifierHash(encryptedVerifierHash);
     }
 
     @Override
     public void write(LittleEndianByteArrayOutputStream bos) {
-        byte salt[] = getSalt();
+        byte[] salt = getSalt();
         assert (salt.length == 16);
         bos.write(salt);
-        byte encryptedVerifier[] = getEncryptedVerifier();
+        byte[] encryptedVerifier = getEncryptedVerifier();
         assert (encryptedVerifier.length == 16);
         bos.write(encryptedVerifier);
-        byte encryptedVerifierHash[] = getEncryptedVerifierHash();
+        byte[] encryptedVerifierHash = getEncryptedVerifierHash();
         assert (encryptedVerifierHash.length == 16);
         bos.write(encryptedVerifierHash);
     }
index 6b40516ef307b2fe6925285ed5433ff6b10292c3..6c67f32015dd32159c97b30a639529df15d38ffb 100644 (file)
@@ -49,30 +49,30 @@ public class BinaryRC4Encryptor extends Encryptor implements Cloneable {
     @Override
     public void confirmPassword(String password) {
         Random r = new SecureRandom();
-        byte salt[] = new byte[16];
-        byte verifier[] = new byte[16];
+        byte[] salt = new byte[16];
+        byte[] verifier = new byte[16];
         r.nextBytes(salt);
         r.nextBytes(verifier);
         confirmPassword(password, null, null, verifier, salt, null);
     }
 
     @Override
-    public void confirmPassword(String password, byte keySpec[],
-            byte keySalt[], byte verifier[], byte verifierSalt[],
-            byte integritySalt[]) {
+    public void confirmPassword(String password, byte[] keySpec,
+                                byte[] keySalt, byte[] verifier, byte[] verifierSalt,
+                                byte[] integritySalt) {
         BinaryRC4EncryptionVerifier ver = (BinaryRC4EncryptionVerifier)getEncryptionInfo().getVerifier();
         ver.setSalt(verifierSalt);
         SecretKey skey = BinaryRC4Decryptor.generateSecretKey(password, ver);
         setSecretKey(skey);
         try {
             Cipher cipher = BinaryRC4Decryptor.initCipherForBlock(null, 0, getEncryptionInfo(), skey, Cipher.ENCRYPT_MODE);
-            byte encryptedVerifier[] = new byte[16];
+            byte[] encryptedVerifier = new byte[16];
             cipher.update(verifier, 0, 16, encryptedVerifier);
             ver.setEncryptedVerifier(encryptedVerifier);
             HashAlgorithm hashAlgo = ver.getHashAlgorithm();
             MessageDigest hashAlg = CryptoFunctions.getMessageDigest(hashAlgo);
-            byte calcVerifierHash[] = hashAlg.digest(verifier);
-            byte encryptedVerifierHash[] = cipher.doFinal(calcVerifierHash);
+            byte[] calcVerifierHash = hashAlg.digest(verifier);
+            byte[] encryptedVerifierHash = cipher.doFinal(calcVerifierHash);
             ver.setEncryptedVerifierHash(encryptedVerifierHash);
         } catch (GeneralSecurityException e) {
             throw new EncryptedDocumentException("Password confirmation failed", e);
index d383ae4eab5a22829563a774aa47ba72e0b877e7..550dcde2ee7e793316b900aa3de2457df9bbd6d9 100644 (file)
@@ -74,15 +74,15 @@ public class CryptoAPIDecryptor extends Decryptor implements Cloneable {
         SecretKey skey = generateSecretKey(password, ver);
         try {
             Cipher cipher = initCipherForBlock(null, 0, getEncryptionInfo(), skey, Cipher.DECRYPT_MODE);
-            byte encryptedVerifier[] = ver.getEncryptedVerifier();
-            byte verifier[] = new byte[encryptedVerifier.length];
+            byte[] encryptedVerifier = ver.getEncryptedVerifier();
+            byte[] verifier = new byte[encryptedVerifier.length];
             cipher.update(encryptedVerifier, 0, encryptedVerifier.length, verifier);
             setVerifier(verifier);
-            byte encryptedVerifierHash[] = ver.getEncryptedVerifierHash();
-            byte verifierHash[] = cipher.doFinal(encryptedVerifierHash);
+            byte[] encryptedVerifierHash = ver.getEncryptedVerifierHash();
+            byte[] verifierHash = cipher.doFinal(encryptedVerifierHash);
             HashAlgorithm hashAlgo = ver.getHashAlgorithm();
             MessageDigest hashAlg = CryptoFunctions.getMessageDigest(hashAlgo);
-            byte calcVerifierHash[] = hashAlg.digest(verifier);
+            byte[] calcVerifierHash = hashAlg.digest(verifier);
             if (Arrays.equals(calcVerifierHash, verifierHash)) {
                 setSecretKey(skey);
                 return true;
@@ -106,11 +106,11 @@ public class CryptoAPIDecryptor extends Decryptor implements Cloneable {
     throws GeneralSecurityException {
         EncryptionVerifier ver = encryptionInfo.getVerifier();
         HashAlgorithm hashAlgo = ver.getHashAlgorithm();
-        byte blockKey[] = new byte[4];
+        byte[] blockKey = new byte[4];
         LittleEndian.putUInt(blockKey, 0, block);
         MessageDigest hashAlg = CryptoFunctions.getMessageDigest(hashAlgo);
         hashAlg.update(skey.getEncoded());
-        byte encKey[] = hashAlg.digest(blockKey);
+        byte[] encKey = hashAlg.digest(blockKey);
         EncryptionHeader header = encryptionInfo.getHeader();
         int keyBits = header.getKeySize();
         encKey = CryptoFunctions.getBlock0(encKey, keyBits / 8);
@@ -133,7 +133,7 @@ public class CryptoAPIDecryptor extends Decryptor implements Cloneable {
         HashAlgorithm hashAlgo = ver.getHashAlgorithm();
         MessageDigest hashAlg = CryptoFunctions.getMessageDigest(hashAlgo);
         hashAlg.update(ver.getSalt());
-        byte hash[] = hashAlg.digest(StringUtil.getToUnicodeLE(password));
+        byte[] hash = hashAlg.digest(StringUtil.getToUnicodeLE(password));
         return new SecretKeySpec(hash, ver.getCipherAlgorithm().jceId);
     }
 
@@ -182,7 +182,7 @@ public class CryptoAPIDecryptor extends Decryptor implements Cloneable {
             }
             sbis.setBlock(0);
             int encryptedStreamDescriptorCount = (int) leis.readUInt();
-            StreamDescriptorEntry entries[] = new StreamDescriptorEntry[encryptedStreamDescriptorCount];
+            StreamDescriptorEntry[] entries = new StreamDescriptorEntry[encryptedStreamDescriptorCount];
             for (int i = 0; i < encryptedStreamDescriptorCount; i++) {
                 StreamDescriptorEntry entry = new StreamDescriptorEntry();
                 entries[i] = entry;
index 57366493210c33fcb4509f2bc90067fce4c8c05a..361578e967fcd4242aead7a1c49653bb9d932acd 100644 (file)
@@ -33,7 +33,7 @@ import org.apache.poi.util.Internal;
 /* package */ class CryptoAPIDocumentInputStream extends ByteArrayInputStream {
     private Cipher cipher;
     private final CryptoAPIDecryptor decryptor;
-    private byte oneByte[] = { 0 };
+    private byte[] oneByte = {0};
     
     public void seek(int newpos) {
         if (newpos > count) {
@@ -64,7 +64,7 @@ import org.apache.poi.util.Internal;
     }
 
     @Override
-    public synchronized int read(byte b[], int off, int len) {
+    public synchronized int read(byte[] b, int off, int len) {
         int readLen = super.read(b, off, len);
         if (readLen ==-1) {
             return -1;
@@ -77,7 +77,7 @@ import org.apache.poi.util.Internal;
         return readLen;
     }
 
-    public CryptoAPIDocumentInputStream(CryptoAPIDecryptor decryptor, byte buf[])
+    public CryptoAPIDocumentInputStream(CryptoAPIDecryptor decryptor, byte[] buf)
     throws GeneralSecurityException {
         super(buf);
         this.decryptor = decryptor;
index 5fa9564a41cb5a3dad77e1a98174c0796dbed6ba..fb6fb93e1881fc71a2dfa04ade21f1a4d62163b3 100644 (file)
@@ -31,7 +31,7 @@ import org.apache.poi.util.Internal;
 /* package */ class CryptoAPIDocumentOutputStream extends ByteArrayOutputStream {
     private final Cipher cipher;
     private final CryptoAPIEncryptor encryptor;
-    private final byte oneByte[] = { 0 };
+    private final byte[] oneByte = {0};
 
     public CryptoAPIDocumentOutputStream(CryptoAPIEncryptor encryptor) throws GeneralSecurityException {
         this.encryptor = encryptor;
index f5482c58e77d1bab2a73ca1bbffeba1c67f30175..9c43626f2d39363249ca3c9eaff7d7770b48a219 100644 (file)
@@ -37,17 +37,17 @@ public class CryptoAPIEncryptionVerifier extends StandardEncryptionVerifier impl
     }
 
     @Override
-    protected void setSalt(byte salt[]) {
+    protected void setSalt(byte[] salt) {
         super.setSalt(salt);
     }
 
     @Override
-    protected void setEncryptedVerifier(byte encryptedVerifier[]) {
+    protected void setEncryptedVerifier(byte[] encryptedVerifier) {
         super.setEncryptedVerifier(encryptedVerifier);
     }
 
     @Override
-    protected void setEncryptedVerifierHash(byte encryptedVerifierHash[]) {
+    protected void setEncryptedVerifierHash(byte[] encryptedVerifierHash) {
         super.setEncryptedVerifierHash(encryptedVerifierHash);
     }
 
index 9221d4a3900446d49b3c9f7d18a0f69fdbf23e45..60b1be28418b0c858b613c7672108eafbd7177c5 100644 (file)
@@ -56,17 +56,17 @@ public class CryptoAPIEncryptor extends Encryptor implements Cloneable {
     @Override
     public void confirmPassword(String password) {
         Random r = new SecureRandom();
-        byte salt[] = new byte[16];
-        byte verifier[] = new byte[16];
+        byte[] salt = new byte[16];
+        byte[] verifier = new byte[16];
         r.nextBytes(salt);
         r.nextBytes(verifier);
         confirmPassword(password, null, null, verifier, salt, null);
     }
 
     @Override
-    public void confirmPassword(String password, byte keySpec[],
-            byte keySalt[], byte verifier[], byte verifierSalt[],
-            byte integritySalt[]) {
+    public void confirmPassword(String password, byte[] keySpec,
+                                byte[] keySalt, byte[] verifier, byte[] verifierSalt,
+                                byte[] integritySalt) {
         assert(verifier != null && verifierSalt != null);
         CryptoAPIEncryptionVerifier ver = (CryptoAPIEncryptionVerifier)getEncryptionInfo().getVerifier();
         ver.setSalt(verifierSalt);
@@ -74,13 +74,13 @@ public class CryptoAPIEncryptor extends Encryptor implements Cloneable {
         setSecretKey(skey);
         try {
             Cipher cipher = initCipherForBlock(null, 0);
-            byte encryptedVerifier[] = new byte[verifier.length];
+            byte[] encryptedVerifier = new byte[verifier.length];
             cipher.update(verifier, 0, verifier.length, encryptedVerifier);
             ver.setEncryptedVerifier(encryptedVerifier);
             HashAlgorithm hashAlgo = ver.getHashAlgorithm();
             MessageDigest hashAlg = CryptoFunctions.getMessageDigest(hashAlgo);
-            byte calcVerifierHash[] = hashAlg.digest(verifier);
-            byte encryptedVerifierHash[] = cipher.doFinal(calcVerifierHash);
+            byte[] calcVerifierHash = hashAlg.digest(verifier);
+            byte[] encryptedVerifierHash = cipher.doFinal(calcVerifierHash);
             ver.setEncryptedVerifierHash(encryptedVerifierHash);
         } catch (GeneralSecurityException e) {
             throw new EncryptedDocumentException("Password confirmation failed", e);
@@ -121,7 +121,7 @@ public class CryptoAPIEncryptor extends Encryptor implements Cloneable {
     public void setSummaryEntries(DirectoryNode dir, String encryptedStream, POIFSFileSystem entries)
     throws IOException, GeneralSecurityException {
         CryptoAPIDocumentOutputStream bos = new CryptoAPIDocumentOutputStream(this); // NOSONAR
-        byte buf[] = new byte[8];
+        byte[] buf = new byte[8];
         
         bos.write(buf, 0, 8); // skip header
         List<StreamDescriptorEntry> descList = new ArrayList<>();
@@ -168,7 +168,7 @@ public class CryptoAPIEncryptor extends Encryptor implements Cloneable {
             bos.write(buf, 0, 1);
             LittleEndian.putUInt(buf, 0, sde.reserved2);
             bos.write(buf, 0, 4);
-            byte nameBytes[] = StringUtil.getToUnicodeLE(sde.streamName);
+            byte[] nameBytes = StringUtil.getToUnicodeLE(sde.streamName);
             bos.write(nameBytes, 0, nameBytes.length);
             LittleEndian.putShort(buf, 0, (short)0); // null-termination
             bos.write(buf, 0, 2);
index 682d77190b2695ef8cfd2fd7b5ad597d7e3a75a6..67da57129ae20cfc32fad753db5707b4bb8f5d2b 100644 (file)
@@ -56,13 +56,13 @@ public class StandardDecryptor extends Decryptor implements Cloneable {
         Cipher cipher = getCipher(skey);
 
         try {
-            byte encryptedVerifier[] = ver.getEncryptedVerifier();
-            byte verifier[] = cipher.doFinal(encryptedVerifier);
+            byte[] encryptedVerifier = ver.getEncryptedVerifier();
+            byte[] verifier = cipher.doFinal(encryptedVerifier);
             setVerifier(verifier);
             MessageDigest sha1 = CryptoFunctions.getMessageDigest(ver.getHashAlgorithm());
             byte[] calcVerifierHash = sha1.digest(verifier);
-            byte encryptedVerifierHash[] = ver.getEncryptedVerifierHash();
-            byte decryptedVerifierHash[] = cipher.doFinal(encryptedVerifierHash);
+            byte[] encryptedVerifierHash = ver.getEncryptedVerifierHash();
+            byte[] decryptedVerifierHash = cipher.doFinal(encryptedVerifierHash);
 
             // see 2.3.4.9 Password Verification (Standard Encryption)
             // ... The number of bytes used by the encrypted Verifier hash MUST be 32 ...
@@ -83,14 +83,14 @@ public class StandardDecryptor extends Decryptor implements Cloneable {
     protected static SecretKey generateSecretKey(String password, EncryptionVerifier ver, int keySize) {
         HashAlgorithm hashAlgo = ver.getHashAlgorithm();
 
-        byte pwHash[] = hashPassword(password, hashAlgo, ver.getSalt(), ver.getSpinCount());
+        byte[] pwHash = hashPassword(password, hashAlgo, ver.getSalt(), ver.getSpinCount());
 
         byte[] blockKey = new byte[4];
         LittleEndian.putInt(blockKey, 0, 0);
 
         byte[] finalHash = CryptoFunctions.generateKey(pwHash, hashAlgo, blockKey, hashAlgo.hashSize);
-        byte x1[] = fillAndXor(finalHash, (byte) 0x36);
-        byte x2[] = fillAndXor(finalHash, (byte) 0x5c);
+        byte[] x1 = fillAndXor(finalHash, (byte) 0x36);
+        byte[] x2 = fillAndXor(finalHash, (byte) 0x5c);
 
         byte[] x3 = new byte[x1.length + x2.length];
         System.arraycopy(x1, 0, x3, 0, x1.length);
@@ -101,7 +101,7 @@ public class StandardDecryptor extends Decryptor implements Cloneable {
         return new SecretKeySpec(key, ver.getCipherAlgorithm().jceId);
     }
 
-    protected static byte[] fillAndXor(byte hash[], byte fillByte) {
+    protected static byte[] fillAndXor(byte[] hash, byte fillByte) {
         byte[] buff = new byte[64];
         Arrays.fill(buff, fillByte);
 
index 4fd284a86c286dd24312c817c5b5f501548693d2..a60feae30a9dd23f87a9a0d6829af65c366a1356 100644 (file)
@@ -38,17 +38,17 @@ public class StandardEncryptionVerifier extends EncryptionVerifier implements En
             throw new RuntimeException("Salt size != 16 !?");
         }
 
-        byte salt[] = new byte[16];
+        byte[] salt = new byte[16];
         is.readFully(salt);
         setSalt(salt);
-        
-        byte encryptedVerifier[] = new byte[16];
+
+        byte[] encryptedVerifier = new byte[16];
         is.readFully(encryptedVerifier);
         setEncryptedVerifier(encryptedVerifier);
 
         verifierHashSize = is.readInt();
 
-        byte encryptedVerifierHash[] = new byte[header.getCipherAlgorithm().encryptedVerifierHashLength];
+        byte[] encryptedVerifierHash = new byte[header.getCipherAlgorithm().encryptedVerifierHashLength];
         is.readFully(encryptedVerifierHash);
         setEncryptedVerifierHash(encryptedVerifierHash);
 
@@ -69,7 +69,7 @@ public class StandardEncryptionVerifier extends EncryptionVerifier implements En
 
     // make method visible for this package
     @Override
-    protected void setSalt(byte salt[]) {
+    protected void setSalt(byte[] salt) {
         if (salt == null || salt.length != 16) {
             throw new EncryptedDocumentException("invalid verifier salt");
         }
@@ -78,26 +78,26 @@ public class StandardEncryptionVerifier extends EncryptionVerifier implements En
     
     // make method visible for this package
     @Override
-    protected void setEncryptedVerifier(byte encryptedVerifier[]) {
+    protected void setEncryptedVerifier(byte[] encryptedVerifier) {
         super.setEncryptedVerifier(encryptedVerifier);
     }
 
     // make method visible for this package
     @Override
-    protected void setEncryptedVerifierHash(byte encryptedVerifierHash[]) {
+    protected void setEncryptedVerifierHash(byte[] encryptedVerifierHash) {
         super.setEncryptedVerifierHash(encryptedVerifierHash);
     }
     
     @Override
     public void write(LittleEndianByteArrayOutputStream bos) {
         // see [MS-OFFCRYPTO] - 2.3.4.9
-        byte salt[] = getSalt();
+        byte[] salt = getSalt();
         assert(salt.length == 16);
         bos.writeInt(salt.length); // salt size
         bos.write(salt);
         
         // The resulting Verifier value MUST be an array of 16 bytes.
-        byte encryptedVerifier[] = getEncryptedVerifier(); 
+        byte[] encryptedVerifier = getEncryptedVerifier();
         assert(encryptedVerifier.length == 16);
         bos.write(encryptedVerifier);
 
@@ -111,7 +111,7 @@ public class StandardEncryptionVerifier extends EncryptionVerifier implements En
         // Verifier. If the encryption algorithm is RC4, the length MUST be 20 bytes. If the encryption
         // algorithm is AES, the length MUST be 32 bytes. After decrypting the EncryptedVerifierHash
         // field, only the first VerifierHashSize bytes MUST be used.
-        byte encryptedVerifierHash[] = getEncryptedVerifierHash(); 
+        byte[] encryptedVerifierHash = getEncryptedVerifierHash();
         assert(encryptedVerifierHash.length == getCipherAlgorithm().encryptedVerifierHashLength);
         bos.write(encryptedVerifierHash);
     }
index 274a778cca8f2942d2c7d360769482eaf57ea261..7de19b9a7bbd34edc28a847bccf28de7d7ccc1a3 100644 (file)
@@ -78,7 +78,7 @@ public class StandardEncryptor extends Encryptor implements Cloneable {
      * see [MS-OFFCRYPTO] - 2.3.4.7 ECMA-376 Document Encryption Key Generation
      */
     @Override
-    public void confirmPassword(String password, byte keySpec[], byte keySalt[], byte verifier[], byte verifierSalt[], byte integritySalt[]) {
+    public void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) {
         StandardEncryptionVerifier ver = (StandardEncryptionVerifier)getEncryptionInfo().getVerifier();
 
         ver.setSalt(verifierSalt);
@@ -87,9 +87,9 @@ public class StandardEncryptor extends Encryptor implements Cloneable {
         Cipher cipher = getCipher(secretKey, null);
         
         try {
-            byte encryptedVerifier[] = cipher.doFinal(verifier); 
+            byte[] encryptedVerifier = cipher.doFinal(verifier);
             MessageDigest hashAlgo = CryptoFunctions.getMessageDigest(ver.getHashAlgorithm());
-            byte calcVerifierHash[] = hashAlgo.digest(verifier);
+            byte[] calcVerifierHash = hashAlgo.digest(verifier);
             
             // 2.3.3 EncryptionVerifier ...
             // An array of bytes that contains the encrypted form of the 
@@ -98,8 +98,8 @@ public class StandardEncryptor extends Encryptor implements Cloneable {
             // Verifier. If the encryption algorithm is RC4, the length MUST be 20 bytes. If the encryption 
             // algorithm is AES, the length MUST be 32 bytes. After decrypting the EncryptedVerifierHash
             // field, only the first VerifierHashSize bytes MUST be used.
-            int encVerHashSize = ver.getCipherAlgorithm().encryptedVerifierHashLength; 
-            byte encryptedVerifierHash[] = cipher.doFinal(Arrays.copyOf(calcVerifierHash, encVerHashSize));
+            int encVerHashSize = ver.getCipherAlgorithm().encryptedVerifierHashLength;
+            byte[] encryptedVerifierHash = cipher.doFinal(Arrays.copyOf(calcVerifierHash, encVerHashSize));
     
             ver.setEncryptedVerifier(encryptedVerifier);
             ver.setEncryptedVerifierHash(encryptedVerifierHash);
index 26fc78d8b7ba0ed2993edb9007f0745d15c0caa0..66664b9d4af03d7b7b44d566b37546efb748931a 100644 (file)
@@ -48,7 +48,7 @@ public class XORDecryptor extends Decryptor implements Cloneable {
         int keyComp      = CryptoFunctions.createXorKey1(password);
         int verifierComp = CryptoFunctions.createXorVerifier1(password);
         if (keyVer == keyComp && verifierVer == verifierComp) {
-            byte xorArray[] = CryptoFunctions.createXorArray1(password);
+            byte[] xorArray = CryptoFunctions.createXorArray1(password);
             setSecretKey(new SecretKeySpec(xorArray, "XOR"));
             return true;
         } else {
@@ -119,9 +119,9 @@ public class XORDecryptor extends Decryptor implements Cloneable {
         @Override
         protected int invokeCipher(int totalBytes, boolean doFinal) {
             final int pos = (int)getPos();
-            final byte xorArray[] = getEncryptionInfo().getDecryptor().getSecretKey().getEncoded();
-            final byte chunk[] = getChunk();
-            final byte plain[] = getPlain();
+            final byte[] xorArray = getEncryptionInfo().getDecryptor().getSecretKey().getEncoded();
+            final byte[] chunk = getChunk();
+            final byte[] plain = getPlain();
             final int posInChunk = pos & getChunkMask();
             
             /*
@@ -164,7 +164,7 @@ public class XORDecryptor extends Decryptor implements Cloneable {
         @Override
         public void setNextRecordSize(int recordSize) {
             final int pos = (int)getPos();
-            final byte chunk[] = getChunk();
+            final byte[] chunk = getChunk();
             final int chunkMask = getChunkMask();
             recordStart = pos;
             recordEnd = recordStart+recordSize;
index ba0645cb775b009010cbc60e564797c58bb0de5c..d3a18e1398d37095c49a670b77bbcabe27635111 100644 (file)
@@ -35,7 +35,7 @@ public class XOREncryptionVerifier extends EncryptionVerifier implements Encrypt
          * See [MS-OFFCRYPTO], 2.3.6.2 section, the first step of initializing XOR
          * array where it describes the generation of 16-bit XorKey value.
          */
-        byte key[] = new byte[2];
+        byte[] key = new byte[2];
         is.readFully(key);
         setEncryptedKey(key);
         
@@ -43,7 +43,7 @@ public class XOREncryptionVerifier extends EncryptionVerifier implements Encrypt
          * verificationBytes (2 bytes): An unsigned integer that specifies
          * the password verification identifier.
          */
-        byte verifier[] = new byte[2];
+        byte[] verifier = new byte[2];
         is.readFully(verifier);
         setEncryptedVerifier(verifier);
     }
index 754d9df118acb5b51f5a0a917b81400304bcbcc5..04cd5a8543c38e739453035f042e041512184e50 100644 (file)
@@ -41,9 +41,9 @@ public class XOREncryptor extends Encryptor implements Cloneable {
     public void confirmPassword(String password) {
         int keyComp      = CryptoFunctions.createXorKey1(password);
         int verifierComp = CryptoFunctions.createXorVerifier1(password);
-        byte xorArray[]  = CryptoFunctions.createXorArray1(password);
-        
-        byte shortBuf[] = new byte[2];
+        byte[] xorArray = CryptoFunctions.createXorArray1(password);
+
+        byte[] shortBuf = new byte[2];
         XOREncryptionVerifier ver = (XOREncryptionVerifier)getEncryptionInfo().getVerifier();
         LittleEndian.putUShort(shortBuf, 0, keyComp);
         ver.setEncryptedKey(shortBuf);
@@ -53,9 +53,9 @@ public class XOREncryptor extends Encryptor implements Cloneable {
     }
 
     @Override
-    public void confirmPassword(String password, byte keySpec[],
-            byte keySalt[], byte verifier[], byte verifierSalt[],
-            byte integritySalt[]) {
+    public void confirmPassword(String password, byte[] keySpec,
+                                byte[] keySalt, byte[] verifier, byte[] verifierSalt,
+                                byte[] integritySalt) {
         confirmPassword(password);
     }
 
@@ -137,9 +137,9 @@ public class XOREncryptor extends Encryptor implements Cloneable {
             final int start = Math.max(posInChunk-(recordEnd-recordStart), 0);
 
             final BitSet plainBytes = getPlainByteFlags();
-            final byte xorArray[] = getEncryptionInfo().getEncryptor().getSecretKey().getEncoded();
-            final byte chunk[] = getChunk();
-            final byte plain[] = (plainBytes.isEmpty()) ? null : chunk.clone();
+            final byte[] xorArray = getEncryptionInfo().getEncryptor().getSecretKey().getEncoded();
+            final byte[] chunk = getChunk();
+            final byte[] plain = (plainBytes.isEmpty()) ? null : chunk.clone();
 
             /*
              * From: http://social.msdn.microsoft.com/Forums/en-US/3dadbed3-0e68-4f11-8b43-3a2328d9ebd5
index 65c1e2c9baf2917b0621e356eef07d959bd68965..345d3c6a2c4efabc3b77d2583daf5ed30daa90a0 100644 (file)
@@ -38,7 +38,7 @@ public class POIFSLister {
     *
     * @param args the names of the files to be displayed
     */
-   public static void main(final String args[]) throws IOException {
+   public static void main(final String[] args) throws IOException {
       if (args.length == 0) {
          System.err.println("Must specify at least one file to view");
          System.exit(1);
index ee53fb19eb3190d7c8419a2d745869b0f56f30ee..18095397f68d6880bae90d5c75ab0b04e3354b20 100644 (file)
@@ -41,7 +41,7 @@ public final class POIFSViewer {
      * @param args the names of the files to be displayed
      */
 
-    public static void main(final String args[]) {
+    public static void main(final String[] args) {
         if (args.length == 0) {
             System.err.println("Must specify at least one file to view");
             System.exit(1);
index 90779546cfb51e0b94b710c66d5214a9023ae105..718709f51fa09dd65377f8d554ec418eb57f31e3 100644 (file)
@@ -179,7 +179,7 @@ public class POIFSReader
      * @exception IOException if the files can't be read or have invalid content
      */
 
-    public static void main(String args[]) throws IOException {
+    public static void main(String[] args) throws IOException {
         if (args.length == 0) {
             System.err.println("at least one argument required: input filename(s)");
             System.exit(1);
index 2e6cfcd55e530d0843be6509173a32d2e7ca5f02..57084e6391cbf7f4852d245a5e3c2732fc59749a 100644 (file)
@@ -428,7 +428,7 @@ public class Ole10Native {
         this.unknown1 = unknown1;
     }
 
-    public void setDataBuffer(byte dataBuffer[]) {
+    public void setDataBuffer(byte[] dataBuffer) {
         this.dataBuffer = dataBuffer.clone();
     }
 }
index 2f7eb77a2bf38105dd3821072837d4ce701cfa77..36c7648377dce28bcc222cebd2fee2bb19e50f84 100644 (file)
@@ -787,7 +787,7 @@ public class POIFSFileSystem extends BlockStore
      * @param args names of the files; arg[ 0 ] is the input file,
      *             arg[ 1 ] is the output file
      */
-    public static void main(String args[]) throws IOException {
+    public static void main(String[] args) throws IOException {
         if (args.length != 2) {
             System.err.println(
                 "two arguments required: input filename and output filename");
index 7af205accfe09b8b0339badd0e405dec50ad0d2a..f5bbf5bd4bd5718946371bdaeb038ced268133a1 100644 (file)
@@ -177,7 +177,7 @@ public class POIFSStream implements Iterable<ByteBuffer>
    }
    
    protected class StreamBlockByteBuffer extends OutputStream {
-       byte oneByte[] = new byte[1];
+       byte[] oneByte = new byte[1];
        ByteBuffer buffer;
        // Make sure we don't encounter a loop whilst overwriting
        // the existing blocks
index 665ccf5bdc3cbc376e38711d6262a29898f83f4b..e5ffbb3ada98ded1ca2d096cfa1e400908f86841 100644 (file)
@@ -34,7 +34,7 @@ import org.apache.poi.util.StringUtil;
  * @since 3.15-beta2
  */
 public class VBAMacroExtractor {
-    public static void main(String args[]) throws IOException {
+    public static void main(String[] args) throws IOException {
         if (args.length == 0) {
             System.err.println("Use:");
             System.err.println("   VBAMacroExtractor <office.doc> [output]");
index c37ce006a0f17cd9c90b6992da6f0afef73ec33b..145791f401362a82c278d454bccfcc478b702927 100644 (file)
@@ -72,7 +72,7 @@ public class BitmapImageRenderer implements ImageRenderer {
     }
 
     @Override
-    public void loadImage(byte data[], String contentType) throws IOException {
+    public void loadImage(byte[] data, String contentType) throws IOException {
         img = readImage(new ByteArrayInputStream(data), contentType);
     }
     
index 99c9942b67c1dcd5aa0acbd031e1771e81ad2c39..6a032d6c6e9dd38b3fad9c9d8db512e1fcd2c553 100644 (file)
@@ -211,7 +211,7 @@ public class DrawFactory {
         }
     }
     
-    
+
     /**
      * Return a FontManager, either registered beforehand or a default implementation
      *
index a4289436998c16d0629c9f5b51c17f08c4fbbd0e..7dcd704c4eec4e9adfc149048021da17c8ad6774 100644 (file)
@@ -76,7 +76,7 @@ public class DrawFontManagerDefault implements DrawFontManager {
     public static String mapSymbolChars(String text) {
         // wingdings doesn't contain high-surrogates, so chars are ok
         boolean changed = false;
-        char chrs[] = text.toCharArray();
+        char[] chrs = text.toCharArray();
         for (int i=0; i<chrs.length; i++) {
             // only change valid chars
             if ((0x20 <= chrs[i] && chrs[i] <= 0x7f) ||
index 0c6054c8a99642551a946649fe655892cae4458f..67162ac4a8884b9257d712d4b71aab9a982c8d8f 100644 (file)
@@ -65,7 +65,7 @@ public class DrawShape implements Drawable {
 
         final Rectangle2D anchor = getAnchor(graphics, ps);
 
-        char cmds[] = isHSLF ? new char[]{ 'h','v','r' } : new char[]{ 'r','h','v' };
+        char[] cmds = isHSLF ? new char[]{'h', 'v', 'r'} : new char[]{'r', 'h', 'v'};
         for (char ch : cmds) {
             switch (ch) {
             case 'h':
@@ -232,7 +232,7 @@ public class DrawShape implements Drawable {
             lineDash = LineDash.SOLID;
         }
 
-        int dashPatI[] = lineDash.pattern;
+        int[] dashPatI = lineDash.pattern;
         final float dash_phase = 0;
         float[] dashPatF = null;
         if (dashPatI != null) {
index 703fb04d829b667dfa82e93460e2de1a85cbbf4e..1974f0d9a7026ae621fc0f54eefc1a3f6725c1a3 100644 (file)
@@ -165,7 +165,7 @@ public class DrawTableShape extends DrawShape {
         final int rows = table.getNumberOfRows();
         final int cols = table.getNumberOfColumns();
 
-        BorderEdge edges[] = { BorderEdge.top, BorderEdge.left, null, null };
+        BorderEdge[] edges = {BorderEdge.top, BorderEdge.left, null, null};
         for (int row = 0; row < rows; row++) {
             for (int col = 0; col < cols; col++) {
                 edges[2] = (col == cols - 1) ? BorderEdge.right : null;
@@ -189,7 +189,7 @@ public class DrawTableShape extends DrawShape {
         final int rows = table.getNumberOfRows();
         final int cols = table.getNumberOfColumns();
 
-        BorderEdge edges[] = new BorderEdge[4];
+        BorderEdge[] edges = new BorderEdge[4];
         for (int row = 0; row < rows; row++) {
             for (int col = 0; col < cols; col++) {
                 edges[0] = (col == 0) ? BorderEdge.left : null;
@@ -215,7 +215,7 @@ public class DrawTableShape extends DrawShape {
         final int rows = table.getNumberOfRows();
         final int cols = table.getNumberOfColumns();
 
-        BorderEdge edges[] = new BorderEdge[2];
+        BorderEdge[] edges = new BorderEdge[2];
         for (int row = 0; row < rows; row++) {
             for (int col = 0; col < cols; col++) {
                 edges[0] = (col > 0 && col < cols - 1) ? BorderEdge.right : null;
@@ -232,7 +232,7 @@ public class DrawTableShape extends DrawShape {
      * @param edges the border edges
      * @param args the border attributes
      */
-    private static void setEdges(TableCell<?,?> cell, BorderEdge edges[], Object... args) {
+    private static void setEdges(TableCell<?,?> cell, BorderEdge[] edges, Object... args) {
         if (cell == null) {
             return;
         }
index b2355b30128ee347405cd287c4375e99978064b0..330c02ab0112220803cd000e89d049d34852c87f 100644 (file)
@@ -96,7 +96,7 @@ public interface ImageRenderer {
      * @param data the raw image bytes
      * @param contentType the content type
      */
-    void loadImage(byte data[], String contentType) throws IOException;
+    void loadImage(byte[] data, String contentType) throws IOException;
 
     /**
      * @return the dimension of the buffered image
index 3ecc6e55c707bf730da83002b3ab1c702a444081..c6283b6759ad6482b7351b66603c6fa52ab72fb4 100644 (file)
@@ -35,7 +35,7 @@ public class ImageHeaderBitmap {
     
     private final Dimension size;
     
-    public ImageHeaderBitmap(byte data[], int offset) {
+    public ImageHeaderBitmap(byte[] data, int offset) {
         BufferedImage img = null;
         try {
             img = ImageIO.read(new ByteArrayInputStream(data, offset, data.length-offset));
index fc7be14fed4321be827759589450364ed40481d5..48bf45564bb5ad8ad64ccc4cf901108bb918d025 100644 (file)
@@ -36,7 +36,7 @@ public class ImageHeaderEMF {
     // rectangle that can be drawn around the image stored in the metafile.
     private final Rectangle deviceBounds;
 
-    public ImageHeaderEMF(final byte data[], final int off) {
+    public ImageHeaderEMF(final byte[] data, final int off) {
         int offset = off;
         int type = (int)LittleEndian.getUInt(data, offset); offset += 4;
         if (type != 1) {
index ff121e3e7c2d8945ff375967ed2497fad953ba6e..bf9cacefaf7ca828a3bc9452ac9aaf9b1ac5264e 100644 (file)
@@ -32,17 +32,17 @@ public class ImageHeaderPICT {
 
     public static final double DEFAULT_RESOLUTION = Units.POINT_DPI;
 
-    private static final byte V2_HEADER[] = {
-        0x00, 0x11,       // v2 version opcode
-        0x02, (byte)0xFF, // version number of new picture
-        0x0C, 0x00,        // header opcode
-        (byte)0xFF, (byte)0xFE, 0x00, 0x00 // pic size dummy
+    private static final byte[] V2_HEADER = {
+            0x00, 0x11,       // v2 version opcode
+            0x02, (byte) 0xFF, // version number of new picture
+            0x0C, 0x00,        // header opcode
+            (byte) 0xFF, (byte) 0xFE, 0x00, 0x00 // pic size dummy
     };
 
     private final Rectangle bounds;
     private final double hRes, vRes;
 
-    public ImageHeaderPICT(byte data[], final int off) {
+    public ImageHeaderPICT(byte[] data, final int off) {
         // http://mirrors.apple2.org.za/apple.cabi.net/Graphics/PICT.and_QT.INFO/PICT.file.format.TI.txt
         int offset = off;
         // low order 16 bits of picture size - can be ignored
@@ -86,13 +86,13 @@ public class ImageHeaderPICT {
         return bounds;
     }
 
-    private static int readUnsignedShort(byte data[], int offset) {
+    private static int readUnsignedShort(byte[] data, int offset) {
         int b0 = data[offset] & 0xFF;
         int b1 = data[offset+1] & 0xFF;
         return b0 << 8 | b1;
     }
 
-    private static double readFixedPoint(byte data[], int offset) {
+    private static double readFixedPoint(byte[] data, int offset) {
         int b0 = data[offset] & 0xFF;
         int b1 = data[offset+1] & 0xFF;
         int b2 = data[offset+2] & 0xFF;
index 0abd5d62a5c29012f14c991e397740016e8672a5..939add734feaf4f6635f3f5c46a6067dce84095e 100644 (file)
@@ -245,31 +245,31 @@ public enum AutoNumberingScheme {
         //M (1000), CM (900), D (500), CD (400), C (100), XC (90), L (50), XL (40), X (10), IX (9), V (5), IV (4) and I (1).
         final int[] VALUES = new int[]{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
         final String[] ROMAN = new String[]{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
-        final String conciseList[][] = {
-            {"XLV", "VL"}, //45
-            {"XCV", "VC"}, //95
-            {"CDL", "LD"}, //450
-            {"CML", "LM"}, //950
-            {"CMVC", "LMVL"}, //995
-            {"CDXC", "LDXL"}, //490
-            {"CDVC", "LDVL"}, //495
-            {"CMXC", "LMXL"}, //990
-            {"XCIX", "VCIV"}, //99
-            {"XLIX", "VLIV"}, //49
-            {"XLIX", "IL"}, //49
-            {"XCIX", "IC"}, //99
-            {"CDXC", "XD"}, //490
-            {"CDVC", "XDV"}, //495
-            {"CDIC", "XDIX"}, //499
-            {"LMVL", "XMV"}, //995
-            {"CMIC", "XMIX"}, //999
-            {"CMXC", "XM"}, // 990
-            {"XDV", "VD"},  //495
-            {"XDIX", "VDIV"}, //499
-            {"XMV", "VM"}, // 995
-            {"XMIX", "VMIV"}, //999
-            {"VDIV", "ID"}, //499
-            {"VMIV", "IM"} //999
+        final String[][] conciseList = {
+                {"XLV", "VL"}, //45
+                {"XCV", "VC"}, //95
+                {"CDL", "LD"}, //450
+                {"CML", "LM"}, //950
+                {"CMVC", "LMVL"}, //995
+                {"CDXC", "LDXL"}, //490
+                {"CDVC", "LDVL"}, //495
+                {"CMXC", "LMXL"}, //990
+                {"XCIX", "VCIV"}, //99
+                {"XLIX", "VLIV"}, //49
+                {"XLIX", "IL"}, //49
+                {"XCIX", "IC"}, //99
+                {"CDXC", "XD"}, //490
+                {"CDVC", "XDV"}, //495
+                {"CDIC", "XDIX"}, //499
+                {"LMVL", "XMV"}, //995
+                {"CMIC", "XMIX"}, //999
+                {"CMXC", "XM"}, // 990
+                {"XDV", "VD"},  //495
+                {"XDIX", "VDIV"}, //499
+                {"XMV", "VM"}, // 995
+                {"XMIX", "VMIV"}, //999
+                {"VDIV", "ID"}, //499
+                {"VMIV", "IM"} //999
         };
 
         StringBuilder sb = new StringBuilder();
@@ -280,7 +280,7 @@ public enum AutoNumberingScheme {
             }
         }
         String result = sb.toString();
-        for (String cc[] : conciseList) {
+        for (String[] cc : conciseList) {
             result = result.replace(cc[0], cc[1]);
         }
         return result;
index 9c4df2f9f688dc1b8c217edc36173e19e606ce78..2538d1b828600b406f5374af066cf32d719d98be 100644 (file)
@@ -273,7 +273,7 @@ public enum PresetColor {
     }
     
     public static PresetColor valueOfNativeId(int nativeId) {
-        PresetColor vals[] = values();
+        PresetColor[] vals = values();
         return (0 < nativeId && nativeId <= vals.length) ? vals[nativeId-1] : null;
     }
 }
index 81f297e2cca48e3d0b22c8185dde8b0e264fff68..460e93bb23c275e108c7c3239b9dcd6e05bbe928 100644 (file)
@@ -294,10 +294,10 @@ public class SlideShowFactory {
     private static <
         S extends Shape<S,P>,
         P extends TextParagraph<S,P,? extends TextRun>
-    > SlideShow<S,P> createSlideShow(String factoryClass, Object args[]) throws IOException, EncryptedDocumentException {
+    > SlideShow<S,P> createSlideShow(String factoryClass, Object[] args) throws IOException, EncryptedDocumentException {
         try {
             Class<?> clazz = SlideShowFactory.class.getClassLoader().loadClass(factoryClass);
-            Class<?> argsClz[] = new Class<?>[args.length];
+            Class<?>[] argsClz = new Class<?>[args.length];
             int i=0;
             for (Object o : args) {
                 Class<?> c = o.getClass();
index b26658fe8b4995c945297a14604681d8d38d0337..500dffde4eeda5124534ad95f0fcdee8271ffb4f 100644 (file)
@@ -81,7 +81,7 @@ public interface StrokeStyle {
         /** PS_DASHDOTDOT system dash style / native 5 */
         SYS_DASH_DOT_DOT(5, 11, 2,2,1,1,1,1);
 
-        public final int pattern[];
+        public final int[] pattern;
         public final int nativeId;
         public final int ooxmlId;
 
index 965a4d1a9e4473a02d0585b3ece0d04b6a7e947d..adba13d520b02ef0b07ad043a845b0fa50dce555 100644 (file)
@@ -234,7 +234,7 @@ public class EmbeddedExtractor implements Iterable<EmbeddedExtractor> {
             }
 
             // TODO: investigate if this is just an EMF-hack or if other formats are also embedded in EMF
-            byte pictureBytes[] = pd.getData();
+            byte[] pictureBytes = pd.getData();
             int idxStart = indexOf(pictureBytes, 0, "%PDF-".getBytes(LocaleUtil.CHARSET_1252));
             if (idxStart == -1) {
                 return null;
@@ -283,7 +283,7 @@ public class EmbeddedExtractor implements Iterable<EmbeddedExtractor> {
             }
 
             DocumentInputStream dis = dn.createDocumentInputStream("package");
-            byte data[] = IOUtils.toByteArray(dis);
+            byte[] data = IOUtils.toByteArray(dis);
             dis.close();
             
             return new EmbeddedData(dn.getName()+ext, data, contentType);
index 764456a369d249062258bd89814370d0862c6024..2511917e252e8a0452be28fa643be393832f99b1 100644 (file)
@@ -185,8 +185,8 @@ public class CellNumberFormatter extends CellFormatter {
         } else {
             afterFractional = null;
         }
-        
-        double scaleByRef[] = { ph.getScale() };
+
+        double[] scaleByRef = {ph.getScale()};
         showGroupingSeparator = interpretIntegerCommas(descBuf, specials, decimalPoint, integerEnd(), fractionalEnd(), scaleByRef);
         if (exponent == null) {
             scale = scaleByRef[0];
index 50a5e06b0c6f64a97c23579abe9a02b966535125..2716e2408484c6f05e1e3f7533523ffbef8f7da6 100644 (file)
@@ -63,8 +63,8 @@ public final class CacheAreaEval extends AreaEvalBase {
         
         int height = area.getLastRow() - area.getFirstRow() + 1;
         int width = area.getLastColumn() - area.getFirstColumn() + 1;
-        
-        ValueEval newVals[] = new ValueEval[height * width];
+
+        ValueEval[] newVals = new ValueEval[height * width];
         
         int startRow = area.getFirstRow() - getFirstRow();
         int startCol = area.getFirstColumn() - getFirstColumn();
index 2fd24fe5c93617d45245721bc5717e03681a7df7..5be4108d1239b85ef192a902186585131a54a600 100644 (file)
@@ -347,8 +347,8 @@ public final class OperationEvaluationContext {
 
     public ValueEval getAreaValueEval(int firstRowIndex, int firstColumnIndex,
             int lastRowIndex, int lastColumnIndex, Object[][] tokens) {
-        
-        ValueEval values[] = new ValueEval[tokens.length * tokens[0].length];
+
+        ValueEval[] values = new ValueEval[tokens.length * tokens[0].length];
         
         int index = 0;
         for (int jdx = 0; jdx < tokens.length; jdx++) {
index e5e13158323c1f67c6ab14c003d79ca50563d2d3..7bec3599b66d2d68b36d78fabf02cefb68326046 100644 (file)
@@ -33,7 +33,7 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple
                return OperandResolver.coerceValueToDouble(ve);
        }
        
-       public ValueEval evaluateArray(ValueEval args[], int srcRowIndex, int srcColumnIndex) {
+       public ValueEval evaluateArray(ValueEval[] args, int srcRowIndex, int srcColumnIndex) {
            if (args.length != 2) {
                return ErrorEval.VALUE_INVALID;
            }
@@ -73,8 +73,8 @@ public abstract class TwoOperandNumericOperation extends Fixed2ArgFunction imple
            protected double[][] evaluate(double[][] d1, double[][] d2) throws IllegalArgumentException, EvaluationException {
                int width = (d1[0].length < d2[0].length) ? d1[0].length : d2[0].length;
                int height = (d1.length < d2.length) ? d1.length : d2.length;
-               
-               double result[][] = new double[height][width];
+
+            double[][] result = new double[height][width];
                
                for (int j = 0; j < height; j++) {
                    for (int i = 0; i < width; i++) {
index 025c28bcdb4526ad5a55129dfb0ed170dd90537e..6a5dabcf490d5688496cba9b0e34fcf21eb6bacb 100644 (file)
@@ -92,8 +92,8 @@ public class Days360 extends Var2or3ArgFunction {
     private static double evaluate(double d0, double d1, boolean method) {
         Calendar realStart = getDate(d0);
         Calendar realEnd = getDate(d1);
-        int startingDate[] = getStartingDate(realStart, method);
-        int endingDate[] = getEndingDate(realEnd, startingDate, method);
+        int[] startingDate = getStartingDate(realStart, method);
+        int[] endingDate = getEndingDate(realEnd, startingDate, method);
         return
             (endingDate[0]*360+endingDate[1]*30+endingDate[2])-
             (startingDate[0]*360+startingDate[1]*30+startingDate[2]);
@@ -115,7 +115,7 @@ public class Days360 extends Var2or3ArgFunction {
         return new int[]{yyyy,mm,dd};
     }
 
-    private static int[] getEndingDate(Calendar realEnd, int startingDate[], boolean method) {
+    private static int[] getEndingDate(Calendar realEnd, int[] startingDate, boolean method) {
         int yyyy = realEnd.get(Calendar.YEAR);
         int mm = realEnd.get(Calendar.MONTH);
         int dd = Math.min(30, realEnd.get(Calendar.DAY_OF_MONTH));
index b6c8aba976824c0c47a6ab02eb1b82fca6ddf857..4159ddcd989b07ca03964163b2d704a315ff34e7 100644 (file)
@@ -96,12 +96,13 @@ public abstract class MatrixFunction implements Function{
         @Override
         public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0) {
             if (arg0 instanceof AreaEval) {
-                double result[], resultArray[][];
+                double[] result;
+                double[][] resultArray;
                 int width, height;
                 
                 try {
-                    double values[] = collectValues(arg0);
-                    double array[][] = fillDoubleArray(values,((AreaEval) arg0).getHeight(),((AreaEval) arg0).getWidth());
+                    double[] values = collectValues(arg0);
+                    double[][] array = fillDoubleArray(values, ((AreaEval) arg0).getHeight(), ((AreaEval) arg0).getWidth());
                     resultArray = evaluate(array);
                     width = resultArray[0].length;
                     height = resultArray.length;
@@ -112,8 +113,8 @@ public abstract class MatrixFunction implements Function{
                 catch(EvaluationException e){
                     return e.getErrorEval();
                 }
-                
-                ValueEval vals[] = new ValueEval[result.length];
+
+                ValueEval[] vals = new ValueEval[result.length];
                 
                 for (int idx = 0; idx < result.length; idx++) {
                     vals[idx] = new NumberEval(result[idx]);
@@ -130,10 +131,10 @@ public abstract class MatrixFunction implements Function{
                 }
             }
             else {
-                double result[][];
+                double[][] result;
                 try {
                     double value = NumericFunction.singleOperandEvaluate(arg0, srcRowIndex, srcColumnIndex);
-                    double temp[][] = {{value}};
+                    double[][] temp = {{value}};
                     result = evaluate(temp);
                     NumericFunction.checkValue(result[0][0]);
                 }
@@ -156,15 +157,17 @@ public abstract class MatrixFunction implements Function{
         
         @Override
         public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1) {
-            double result[];
+            double[] result;
             int width, height;
 
             try {
-                double array0[][], array1[][], resultArray[][];
-                
+                double[][] array0;
+                double[][] array1;
+                double[][] resultArray;
+
                 if (arg0 instanceof AreaEval) {
                     try {
-                        double values[] = collectValues(arg0);
+                        double[] values = collectValues(arg0);
                         array0 = fillDoubleArray(values, ((AreaEval) arg0).getHeight(), ((AreaEval) arg0).getWidth());
                     }
                     catch(EvaluationException e) {
@@ -183,7 +186,7 @@ public abstract class MatrixFunction implements Function{
                     
                 if (arg1 instanceof AreaEval) {
                    try {
-                      double values[] = collectValues(arg1);
+                       double[] values = collectValues(arg1);
                       array1 = fillDoubleArray(values, ((AreaEval) arg1).getHeight(),((AreaEval) arg1).getWidth());
                    }
                    catch (EvaluationException e) {
@@ -212,9 +215,9 @@ public abstract class MatrixFunction implements Function{
             catch (IllegalArgumentException e) {
                 return ErrorEval.VALUE_INVALID;
             }
-                
-                
-            ValueEval vals[] = new ValueEval[result.length];
+
+
+            ValueEval[] vals = new ValueEval[result.length];
             
             for (int idx = 0; idx < result.length; idx++) {
                 vals[idx] = new NumberEval(result[idx]);
@@ -308,8 +311,8 @@ public abstract class MatrixFunction implements Function{
             if (d1.length != d1[0].length) {
                 throw new EvaluationException(ErrorEval.VALUE_INVALID);
             }
-            
-            double result[][] = new double[1][1];
+
+            double[][] result = new double[1][1];
             Array2DRowRealMatrix temp = new Array2DRowRealMatrix(d1);
             result[0][0] = (new LUDecomposition(temp)).getDeterminant();
             return result;
@@ -320,7 +323,7 @@ public abstract class MatrixFunction implements Function{
         private final MutableValueCollector instance = new MutableValueCollector(false, false);
         
         protected double[] collectValues(ValueEval arg) throws EvaluationException {
-            double values[] = instance.collectValues(arg);
+            double[] values = instance.collectValues(arg);
             
             /* handle case where MMULT is operating on an array that is not completely filled*/
             if (arg instanceof AreaEval && values.length == 1)
index 832795a07f8cfac0aace6cdaff1c66631c1f0c95..45fa47d3ed9eac1764d4889bba96420961b69e3d 100644 (file)
@@ -319,10 +319,10 @@ public class WorkbookFactory {
      * Uses reflection, so that this class can be in the Core non-OOXML
      *  POI jar without errors / broken references to the OOXML / XSSF code.
      */
-    private static Workbook createWorkbook(String factoryClass, Object args[]) throws IOException, EncryptedDocumentException {
+    private static Workbook createWorkbook(String factoryClass, Object[] args) throws IOException, EncryptedDocumentException {
         try {
             Class<?> clazz = WorkbookFactory.class.getClassLoader().loadClass(factoryClass);
-            Class<?> argsClz[] = new Class<?>[args.length];
+            Class<?>[] argsClz = new Class<?>[args.length];
             int i=0;
             for (Object o : args) {
                 Class<?> c = o.getClass();
index 3bcef4beb477e6cf708ce52a55f83a3359e81628..9dabd2b631f8b194f67a507fa42bdfe08ccd96d9 100644 (file)
@@ -100,10 +100,9 @@ public final class CellUtil {
                     BORDER_RIGHT,
                     BORDER_TOP
             )));
-    
 
 
-    private static UnicodeMapping unicodeMappings[];
+    private static UnicodeMapping[] unicodeMappings;
 
     private static final class UnicodeMapping {
 
index 3dd4cb0d57b6d96c1b47bc7afb318342297c7b2c..5372d5bc9ce278756224814b8aa134b52f362e61 100644 (file)
@@ -86,7 +86,7 @@ public final class IOUtils {
         if (readBytes < limit) {
             bos.write(new byte[limit-readBytes]);
         }
-        byte peekedBytes[] = bos.toByteArray();
+        byte[] peekedBytes = bos.toByteArray();
         if(stream instanceof PushbackInputStream) {
             PushbackInputStream pin = (PushbackInputStream)stream;
             pin.unread(peekedBytes, 0, readBytes);
index 6199c4dd123201a8e257ccc97b3cba4ac3e66913..9a9652eb3227f669f0f663fc17400c889bc9772c 100644 (file)
@@ -57,7 +57,7 @@ public class LittleEndianInputStream extends FilterInputStream implements Little
        
        @Override
        public int readUByte() {
-               byte buf[] = new byte[1];
+        byte[] buf = new byte[1];
                try {
                        checkEOF(read(buf), 1);
                } catch (IOException e) {
@@ -84,7 +84,7 @@ public class LittleEndianInputStream extends FilterInputStream implements Little
        
        @Override
        public int readInt() {
-               byte buf[] = new byte[LittleEndianConsts.INT_SIZE];
+        byte[] buf = new byte[LittleEndianConsts.INT_SIZE];
                try {
                        checkEOF(read(buf), buf.length);
                } catch (IOException e) {
@@ -108,7 +108,7 @@ public class LittleEndianInputStream extends FilterInputStream implements Little
        
        @Override
        public long readLong() {
-               byte buf[] = new byte[LittleEndianConsts.LONG_SIZE];
+        byte[] buf = new byte[LittleEndianConsts.LONG_SIZE];
                try {
                    checkEOF(read(buf), LittleEndianConsts.LONG_SIZE);
                } catch (IOException e) {
@@ -124,7 +124,7 @@ public class LittleEndianInputStream extends FilterInputStream implements Little
        
        @Override
        public int readUShort() {
-               byte buf[] = new byte[LittleEndianConsts.SHORT_SIZE];
+        byte[] buf = new byte[LittleEndianConsts.SHORT_SIZE];
                try {
                    checkEOF(read(buf), LittleEndianConsts.SHORT_SIZE);
                } catch (IOException e) {
index c54c7542552e4951551720ebe6f335d466a7f71b..5603b2d07447617ee362f95829f9fbb301ef9373 100644 (file)
@@ -32,10 +32,14 @@ public abstract class POILogger {
     public static final int ERROR = 7;
     public static final int FATAL = 9;
 
-    /** Short strings for numeric log level. Use level as array index. */
-    protected static final String LEVEL_STRINGS_SHORT[] = {"?", "D", "?", "I", "?", "W", "?", "E", "?", "F", "?"};
-    /** Long strings for numeric log level. Use level as array index. */
-    protected static final String LEVEL_STRINGS[] = {"?0?", "DEBUG", "?2?", "INFO", "?4?", "WARN", "?6?", "ERROR", "?8?", "FATAL", "?10+?"};
+    /**
+     * Short strings for numeric log level. Use level as array index.
+     */
+    protected static final String[] LEVEL_STRINGS_SHORT = {"?", "D", "?", "I", "?", "W", "?", "E", "?", "F", "?"};
+    /**
+     * Long strings for numeric log level. Use level as array index.
+     */
+    protected static final String[] LEVEL_STRINGS = {"?0?", "DEBUG", "?2?", "INFO", "?4?", "WARN", "?6?", "ERROR", "?8?", "FATAL", "?10+?"};
 
 
     /**
index 2017abf125d3ab90e92cbead22dc2755740016d5..8e23e80eea29932438fd37eab09064f272906def 100644 (file)
@@ -407,7 +407,7 @@ public class StringUtil {
         }
     }
 
-    private static final int symbolMap_f020[] = {
+    private static final int[] symbolMap_f020 = {
             ' ', // 0xf020 space
             '!', // 0xf021 exclam
             8704, // 0xf022 universal
@@ -506,7 +506,7 @@ public class StringUtil {
             ' ', // 0xf07f not defined
     };
 
-    private static final int symbolMap_f0a0[] = {
+    private static final int[] symbolMap_f0a0 = {
             8364, // 0xf0a0 not defined / euro symbol
             978, // 0xf0a1 upsilon1 (upper)
             8242, // 0xf0a2 minute
index 735408b41593b32f6200ce8d3c45a2097991416e..78861db115050a4c4c2b92f0a983c3d34347669c 100644 (file)
@@ -64,7 +64,7 @@ public final class StreamHelper {
             Result outputTarget = new StreamResult(new FilterOutputStream(
                     outStream) {
                 @Override
-                public void write(byte b[], int off, int len)
+                public void write(byte[] b, int off, int len)
                         throws IOException {
                     out.write(b, off, len);
                 }
index 728bf9849a0bfaa27c0583b90738204ce67c54b2..af76ffcd9edb6b125f3f53ad8563db768155ac24 100644 (file)
@@ -75,7 +75,7 @@ public class ZipArchiveThresholdInputStream extends FilterInputStream {
     }
 
     @Override
-    public int read(byte b[], int off, int len) throws IOException {
+    public int read(byte[] b, int off, int len) throws IOException {
         int cnt = super.read(b, off, len);
         if (cnt > -1) {
             checkThreshold();
index 0263790df644ab449f1415545332ab4de439c575..ed6851a1c6d5f7487cf04cefdad4cb3e4317e16b 100644 (file)
@@ -111,7 +111,7 @@ public class AgileDecryptor extends Decryptor implements Cloneable {
          *    blockSize bytes.
          * 4. Use base64 to encode the result of step 3.
          */
-        byte verfierInputEnc[] = hashInput(ver, pwHash, kVerifierInputBlock, ver.getEncryptedVerifier(), Cipher.DECRYPT_MODE);
+        byte[] verfierInputEnc = hashInput(ver, pwHash, kVerifierInputBlock, ver.getEncryptedVerifier(), Cipher.DECRYPT_MODE);
         setVerifier(verfierInputEnc);
         MessageDigest hashMD = getMessageDigest(ver.getHashAlgorithm());
         byte[] verifierHash = hashMD.digest(verfierInputEnc);
@@ -128,7 +128,7 @@ public class AgileDecryptor extends Decryptor implements Cloneable {
          *    blockSize bytes, pad the hash value with 0x00 to an integral multiple of blockSize bytes.
          * 4. Use base64 to encode the result of step 3.
          */
-        byte verifierHashDec[] = hashInput(ver, pwHash, kHashedVerifierBlock, ver.getEncryptedVerifierHash(), Cipher.DECRYPT_MODE);
+        byte[] verifierHashDec = hashInput(ver, pwHash, kHashedVerifierBlock, ver.getEncryptedVerifierHash(), Cipher.DECRYPT_MODE);
         verifierHashDec = getBlock0(verifierHashDec, ver.getHashAlgorithm().hashSize);
         
         /**
@@ -144,7 +144,7 @@ public class AgileDecryptor extends Decryptor implements Cloneable {
          *    blockSize bytes.
          * 4. Use base64 to encode the result of step 3.
          */
-        byte keyspec[] = hashInput(ver, pwHash, kCryptoKeyBlock, ver.getEncryptedKey(), Cipher.DECRYPT_MODE);
+        byte[] keyspec = hashInput(ver, pwHash, kCryptoKeyBlock, ver.getEncryptedKey(), Cipher.DECRYPT_MODE);
         keyspec = getBlock0(keyspec, header.getKeySize()/8);
         SecretKeySpec secretKey = new SecretKeySpec(keyspec, header.getCipherAlgorithm().jceId);
 
@@ -161,10 +161,10 @@ public class AgileDecryptor extends Decryptor implements Cloneable {
          *    array with 0x00 to the next integral multiple of blockSize bytes.
          * 4. Assign the encryptedHmacKey attribute to the base64-encoded form of the result of step 3.
          */
-        byte vec[] = CryptoFunctions.generateIv(header.getHashAlgorithm(), header.getKeySalt(), kIntegrityKeyBlock, blockSize);
+        byte[] vec = CryptoFunctions.generateIv(header.getHashAlgorithm(), header.getKeySalt(), kIntegrityKeyBlock, blockSize);
         CipherAlgorithm cipherAlgo = header.getCipherAlgorithm();
         Cipher cipher = getCipher(secretKey, cipherAlgo, header.getChainingMode(), vec, Cipher.DECRYPT_MODE);
-        byte hmacKey[] = cipher.doFinal(header.getEncryptedHmacKey());
+        byte[] hmacKey = cipher.doFinal(header.getEncryptedHmacKey());
         hmacKey = getBlock0(hmacKey, header.getHashAlgorithm().hashSize);
 
         /**
@@ -178,7 +178,7 @@ public class AgileDecryptor extends Decryptor implements Cloneable {
          */
         vec = CryptoFunctions.generateIv(header.getHashAlgorithm(), header.getKeySalt(), kIntegrityValueBlock, blockSize);
         cipher = getCipher(secretKey, cipherAlgo, ver.getChainingMode(), vec, Cipher.DECRYPT_MODE);
-        byte hmacValue[] = cipher.doFinal(header.getEncryptedHmacValue());
+        byte[] hmacValue = cipher.doFinal(header.getEncryptedHmacValue());
         hmacValue = getBlock0(hmacValue, header.getHashAlgorithm().hashSize);
         
         if (Arrays.equals(verifierHashDec, verifierHash)) {
@@ -222,21 +222,21 @@ public class AgileDecryptor extends Decryptor implements Cloneable {
         
         Cipher cipher = Cipher.getInstance("RSA");
         cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate());
-        byte keyspec[] = cipher.doFinal(ace.encryptedKey);
+        byte[] keyspec = cipher.doFinal(ace.encryptedKey);
         SecretKeySpec secretKey = new SecretKeySpec(keyspec, ver.getCipherAlgorithm().jceId);
         
         Mac x509Hmac = CryptoFunctions.getMac(hashAlgo);
         x509Hmac.init(secretKey);
-        byte certVerifier[] = x509Hmac.doFinal(ace.x509.getEncoded());
+        byte[] certVerifier = x509Hmac.doFinal(ace.x509.getEncoded());
 
-        byte vec[] = CryptoFunctions.generateIv(hashAlgo, header.getKeySalt(), kIntegrityKeyBlock, blockSize); 
+        byte[] vec = CryptoFunctions.generateIv(hashAlgo, header.getKeySalt(), kIntegrityKeyBlock, blockSize);
         cipher = getCipher(secretKey, cipherAlgo, header.getChainingMode(), vec, Cipher.DECRYPT_MODE);
-        byte hmacKey[] = cipher.doFinal(header.getEncryptedHmacKey());
+        byte[] hmacKey = cipher.doFinal(header.getEncryptedHmacKey());
         hmacKey = getBlock0(hmacKey, hashAlgo.hashSize);
 
         vec = CryptoFunctions.generateIv(hashAlgo, header.getKeySalt(), kIntegrityValueBlock, blockSize);
         cipher = getCipher(secretKey, cipherAlgo, header.getChainingMode(), vec, Cipher.DECRYPT_MODE);
-        byte hmacValue[] = cipher.doFinal(header.getEncryptedHmacValue());
+        byte[] hmacValue = cipher.doFinal(header.getEncryptedHmacValue());
         hmacValue = getBlock0(hmacValue, hashAlgo.hashSize);
         
         
@@ -256,14 +256,14 @@ public class AgileDecryptor extends Decryptor implements Cloneable {
         return fillSize;
     }
 
-    /* package */ static byte[] hashInput(AgileEncryptionVerifier ver, byte pwHash[], byte blockKey[], byte inputKey[], int cipherMode) {
+    /* package */ static byte[] hashInput(AgileEncryptionVerifier ver, byte[] pwHash, byte[] blockKey, byte[] inputKey, int cipherMode) {
         CipherAlgorithm cipherAlgo = ver.getCipherAlgorithm();
         ChainingMode chainMode = ver.getChainingMode();
         int keySize = ver.getKeySize()/8;
         int blockSize = ver.getBlockSize();
         HashAlgorithm hashAlgo = ver.getHashAlgorithm();
-        
-        byte intermedKey[] = generateKey(pwHash, hashAlgo, blockKey, keySize);
+
+        byte[] intermedKey = generateKey(pwHash, hashAlgo, blockKey, keySize);
         SecretKey skey = new SecretKeySpec(intermedKey, cipherAlgo.jceId);
         byte[] iv = generateIv(hashAlgo, ver.getSalt(), null, blockSize);
         Cipher cipher = getCipher(skey, cipherAlgo, chainMode, iv, cipherMode);
index 9b8c56ad83f1655dfdbd6c81c32199b027968421..ed058d1df0371b320865f0b06c75a926d4359cdf 100644 (file)
@@ -28,7 +28,8 @@ import com.microsoft.schemas.office.x2006.encryption.EncryptionDocument;
 import com.microsoft.schemas.office.x2006.encryption.STCipherChaining;
 
 public class AgileEncryptionHeader extends EncryptionHeader implements Cloneable {
-    private byte encryptedHmacKey[], encryptedHmacValue[];
+    private byte[] encryptedHmacKey;
+    private byte[] encryptedHmacValue;
     
     public AgileEncryptionHeader(String descriptor) {
         this(AgileEncryptionInfoBuilder.parseDescriptor(descriptor));
@@ -100,7 +101,7 @@ public class AgileEncryptionHeader extends EncryptionHeader implements Cloneable
 
     // make method visible for this package
     @Override
-    protected void setKeySalt(byte salt[]) {
+    protected void setKeySalt(byte[] salt) {
         if (salt == null || salt.length != getBlockSize()) {
             throw new EncryptedDocumentException("invalid verifier salt");
         }
index 82eb13817135eeba15ae6a88fe4cd154b40bc05c..2e8ba701662c74c1f798fec80abccd002735f6c0 100644 (file)
@@ -43,8 +43,8 @@ public class AgileEncryptionVerifier extends EncryptionVerifier implements Clone
 
     public static class AgileCertificateEntry {
         X509Certificate x509;
-        byte encryptedKey[];
-        byte certVerifier[];
+        byte[] encryptedKey;
+        byte[] certVerifier;
     }
     
     private List<AgileCertificateEntry> certList = new ArrayList<>();
@@ -137,7 +137,7 @@ public class AgileEncryptionVerifier extends EncryptionVerifier implements Clone
     }
     
     @Override
-    protected void setSalt(byte salt[]) {
+    protected void setSalt(byte[] salt) {
         if (salt == null || salt.length != getCipherAlgorithm().blockSize) {
             throw new EncryptedDocumentException("invalid verifier salt");
         }
@@ -146,13 +146,13 @@ public class AgileEncryptionVerifier extends EncryptionVerifier implements Clone
     
     // make method visible for this package
     @Override
-    protected void setEncryptedVerifier(byte encryptedVerifier[]) {
+    protected void setEncryptedVerifier(byte[] encryptedVerifier) {
         super.setEncryptedVerifier(encryptedVerifier);
     }
 
     // make method visible for this package
     @Override
-    protected void setEncryptedVerifierHash(byte encryptedVerifierHash[]) {
+    protected void setEncryptedVerifierHash(byte[] encryptedVerifierHash) {
         super.setEncryptedVerifierHash(encryptedVerifierHash);
     }
 
index 3ff47e3e8a13bd6325c1a78d31c94ce68d217f24..dbdd5c0a14a2b269c8ef0cca78217801f6424038 100644 (file)
@@ -81,8 +81,8 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
     //arbitrarily selected; may need to increase
     private static final int MAX_RECORD_LENGTH = 1_000_000;
 
-    private byte integritySalt[];
-       private byte pwHash[];
+    private byte[] integritySalt;
+    private byte[] pwHash;
     
        protected AgileEncryptor() {
        }
@@ -111,7 +111,7 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
     }
        
        @Override
-    public void confirmPassword(String password, byte keySpec[], byte keySalt[], byte verifier[], byte verifierSalt[], byte integritySalt[]) {
+    public void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt) {
         AgileEncryptionVerifier ver = (AgileEncryptionVerifier)getEncryptionInfo().getVerifier();
         AgileEncryptionHeader header = (AgileEncryptionHeader)getEncryptionInfo().getHeader();
 
@@ -135,7 +135,7 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
          *    blockSize bytes.
          * 4. Use base64 to encode the result of step 3.
          */
-        byte encryptedVerifier[] = hashInput(ver, pwHash, kVerifierInputBlock, verifier, Cipher.ENCRYPT_MODE);
+        byte[] encryptedVerifier = hashInput(ver, pwHash, kVerifierInputBlock, verifier, Cipher.ENCRYPT_MODE);
         ver.setEncryptedVerifier(encryptedVerifier);
            
 
@@ -153,7 +153,7 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
          */
         MessageDigest hashMD = getMessageDigest(ver.getHashAlgorithm());
         byte[] hashedVerifier = hashMD.digest(verifier);
-        byte encryptedVerifierHash[] = hashInput(ver, pwHash, kHashedVerifierBlock, hashedVerifier, Cipher.ENCRYPT_MODE);
+        byte[] encryptedVerifierHash = hashInput(ver, pwHash, kHashedVerifierBlock, hashedVerifier, Cipher.ENCRYPT_MODE);
         ver.setEncryptedVerifierHash(encryptedVerifierHash);
         
         /**
@@ -169,7 +169,7 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
          *    blockSize bytes.
          * 4. Use base64 to encode the result of step 3.
          */
-        byte encryptedKey[] = hashInput(ver, pwHash, kCryptoKeyBlock, keySpec, Cipher.ENCRYPT_MODE);
+        byte[] encryptedKey = hashInput(ver, pwHash, kCryptoKeyBlock, keySpec, Cipher.ENCRYPT_MODE);
         ver.setEncryptedKey(encryptedKey);
         
         SecretKey secretKey = new SecretKeySpec(keySpec, header.getCipherAlgorithm().jceId);
@@ -202,10 +202,10 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
         this.integritySalt = integritySalt.clone();
 
         try {
-            byte vec[] = CryptoFunctions.generateIv(header.getHashAlgorithm(), header.getKeySalt(), kIntegrityKeyBlock, header.getBlockSize());
+            byte[] vec = CryptoFunctions.generateIv(header.getHashAlgorithm(), header.getKeySalt(), kIntegrityKeyBlock, header.getBlockSize());
             Cipher cipher = getCipher(secretKey, header.getCipherAlgorithm(), header.getChainingMode(), vec, Cipher.ENCRYPT_MODE);
-            byte hmacKey[] = getBlock0(this.integritySalt, getNextBlockSize(this.integritySalt.length, blockSize));
-            byte encryptedHmacKey[] = cipher.doFinal(hmacKey);
+            byte[] hmacKey = getBlock0(this.integritySalt, getNextBlockSize(this.integritySalt.length, blockSize));
+            byte[] encryptedHmacKey = cipher.doFinal(hmacKey);
             header.setEncryptedHmacKey(encryptedHmacKey);
 
             cipher = Cipher.getInstance("RSA");
@@ -245,10 +245,10 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
         int blockSize = header.getBlockSize();
         HashAlgorithm hashAlgo = header.getHashAlgorithm();
         Mac integrityMD = CryptoFunctions.getMac(hashAlgo);
-        byte hmacKey[] = getBlock0(this.integritySalt, getNextBlockSize(this.integritySalt.length, blockSize));
+        byte[] hmacKey = getBlock0(this.integritySalt, getNextBlockSize(this.integritySalt.length, blockSize));
         integrityMD.init(new SecretKeySpec(hmacKey, hashAlgo.jceHmacId));
 
-        byte buf[] = new byte[1024];
+        byte[] buf = new byte[1024];
         LittleEndian.putLong(buf, 0, oleStreamSize);
         integrityMD.update(buf, 0, LittleEndianConsts.LONG_SIZE);
         
@@ -261,13 +261,13 @@ public class AgileEncryptor extends Encryptor implements Cloneable {
         } finally {
                fis.close();
         }
-        
-        byte hmacValue[] = integrityMD.doFinal();
-        byte hmacValueFilled[] = getBlock0(hmacValue, getNextBlockSize(hmacValue.length, blockSize));
-        
-        byte iv[] = CryptoFunctions.generateIv(header.getHashAlgorithm(), header.getKeySalt(), kIntegrityValueBlock, blockSize);
+
+        byte[] hmacValue = integrityMD.doFinal();
+        byte[] hmacValueFilled = getBlock0(hmacValue, getNextBlockSize(hmacValue.length, blockSize));
+
+        byte[] iv = CryptoFunctions.generateIv(header.getHashAlgorithm(), header.getKeySalt(), kIntegrityValueBlock, blockSize);
         Cipher cipher = CryptoFunctions.getCipher(getSecretKey(), header.getCipherAlgorithm(), header.getChainingMode(), iv, Cipher.ENCRYPT_MODE);
-        byte encryptedHmacValue[] = cipher.doFinal(hmacValueFilled);
+        byte[] encryptedHmacValue = cipher.doFinal(hmacValueFilled);
         
         header.setEncryptedHmacValue(encryptedHmacValue);
     }
index 0977a403a123f07e36b68788a9552e8c0f853338..0fcacaf376b32a9d50a8c6f76fc169831e641657 100644 (file)
@@ -950,12 +950,12 @@ public class SignatureConfig {
     public Provider getProvider() {
         Provider prov = provider.get();
         if (prov == null) {
-            String dsigProviderNames[] = {
-                System.getProperty("jsr105Provider"),
-                // Santuario xmlsec
-                "org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI",
-                // JDK xmlsec
-                "org.jcp.xml.dsig.internal.dom.XMLDSigRI"
+            String[] dsigProviderNames = {
+                    System.getProperty("jsr105Provider"),
+                    // Santuario xmlsec
+                    "org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI",
+                    // JDK xmlsec
+                    "org.jcp.xml.dsig.internal.dom.XMLDSigRI"
             };
             for (String pn : dsigProviderNames) {
                 if (pn == null) {
index a6ce4226aeb6f30628fb3d951aa907bf873d9690..29852f0044efcde8dbb2eaf9ef2b9e6807568cbd 100644 (file)
@@ -113,18 +113,18 @@ public abstract class SignatureFacet implements SignatureConfigurable {
         }
     }
     
-    protected Reference newReference(String uri, List<Transform> transforms, String type, String id, byte digestValue[])
+    protected Reference newReference(String uri, List<Transform> transforms, String type, String id, byte[] digestValue)
     throws XMLSignatureException {
         return newReference(uri, transforms, type, id, digestValue, signatureConfig);
     }
 
     public static Reference newReference(
-          String uri
+            String uri
         , List<Transform> transforms
         , String type
         , String id
-        , byte digestValue[]
-        , SignatureConfig signatureConfig)
+        , byte[] digestValue
+            , SignatureConfig signatureConfig)
     throws XMLSignatureException {
         // the references appear in the package signature or the package object
         // so we can use the default digest algorithm
index af6fa199b2f491a202500c59bbbb43cf5cdc0811..e00de87b7c5c9e36dde0f21ea3a06ed76906a2f9 100644 (file)
@@ -233,7 +233,7 @@ public class XAdESXLSignatureFacet extends SignatureFacet {
                     DERTaggedObject derTaggedObject = (DERTaggedObject)ocspResponderId.toASN1Primitive();
                     if (2 == derTaggedObject.getTagNo()) {
                         ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject();
-                        byte key[] = keyHashOctetString.getOctets();
+                        byte[] key = keyHashOctetString.getOctets();
                         responderId.setByKey(key);
                     } else {
                         X500Name name = X500Name.getInstance(derTaggedObject.getObject());
index 45f9b4b7301966ab2e9e879d3490e39dc0118c4d..fefae87a894c2197c29a6c2695e579432f3d84c9 100644 (file)
@@ -139,7 +139,7 @@ public class RelationshipTransformService extends TransformService {
         
         try {
             TransformDocument transDoc = TransformDocument.Factory.parse(parentNode, DEFAULT_XML_OPTIONS);
-            XmlObject xoList[] = transDoc.getTransform().selectChildren(RelationshipReferenceDocument.type.getDocumentElementName());
+            XmlObject[] xoList = transDoc.getTransform().selectChildren(RelationshipReferenceDocument.type.getDocumentElementName());
             if (xoList.length == 0) {
                 LOG.log(POILogger.WARN, "no RelationshipReference/@SourceId parameters present");
             }
index 8c8523d42753d3283c2b9436ce6544d0668260c7..699fbe1fb8525fd4fc91c22ef68ec8d31f7dae6c 100644 (file)
@@ -116,7 +116,7 @@ public final class AesZipFileZipEntrySource implements ZipEntrySource {
         return fileToSource(tmpFile, keyBytes, ivBytes);
     }
 
-    private static void copyToFile(InputStream is, File tmpFile, byte keyBytes[], byte ivBytes[]) throws IOException {
+    private static void copyToFile(InputStream is, File tmpFile, byte[] keyBytes, byte[] ivBytes) throws IOException {
         SecretKeySpec skeySpec = new SecretKeySpec(keyBytes, CipherAlgorithm.aes128.jceId);
         Cipher ciEnc = CryptoFunctions.getCipher(skeySpec, CipherAlgorithm.aes128, ChainingMode.cbc, ivBytes, Cipher.ENCRYPT_MODE, PADDING);
         
@@ -150,7 +150,7 @@ public final class AesZipFileZipEntrySource implements ZipEntrySource {
         zis.close();
     }
 
-    private static AesZipFileZipEntrySource fileToSource(File tmpFile, byte keyBytes[], byte ivBytes[]) throws IOException {
+    private static AesZipFileZipEntrySource fileToSource(File tmpFile, byte[] keyBytes, byte[] ivBytes) throws IOException {
         SecretKeySpec skeySpec = new SecretKeySpec(keyBytes, CipherAlgorithm.aes128.jceId);
         Cipher ciDec = CryptoFunctions.getCipher(skeySpec, CipherAlgorithm.aes128, ChainingMode.cbc, ivBytes, Cipher.DECRYPT_MODE, PADDING);
         return new AesZipFileZipEntrySource(tmpFile, ciDec);
index c5e47415df2f81fea28da5470b77904faa752155..d596993fe88d84bd2c0d5e9026c36bced97ffb0f 100644 (file)
@@ -288,7 +288,7 @@ public class XMLSlideShow extends POIXMLDocument
         XSLFSlideLayout layout = sm.getLayout(SlideLayout.BLANK);
         if (layout == null) {
             LOG.log(POILogger.WARN, "Blank layout was not found - defaulting to first slide layout in master");
-            XSLFSlideLayout sl[] = sm.getSlideLayouts();
+            XSLFSlideLayout[] sl = sm.getSlideLayouts();
             if (sl.length == 0) {
                 throw new POIXMLException("SlideMaster must contain a SlideLayout.");
             }
@@ -580,7 +580,7 @@ public class XMLSlideShow extends POIXMLDocument
     @Override
     public XSLFPictureData findPictureData(byte[] pictureData) {
         long checksum = IOUtils.calculateChecksum(pictureData);
-        byte cs[] = new byte[LittleEndianConsts.LONG_SIZE];
+        byte[] cs = new byte[LittleEndianConsts.LONG_SIZE];
         LittleEndian.putLong(cs, 0, checksum);
 
         for (XSLFPictureData pic : getPictureData()) {
index 50b82df3b09516f441467d6425846705316ba583..95fc4a138665525d505f474bd5c5bd0497319455 100644 (file)
@@ -233,7 +233,7 @@ public class XSLFColor {
             // sRGB has a gamma of 2.2
             CTSRgbColor rgb = fill.addNewSrgbClr();
 
-            byte rgbBytes[] = { (byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue() };
+            byte[] rgbBytes = {(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()};
             rgb.setVal(rgbBytes);
             alphaPct = (addAlpha) ? rgb.addNewAlpha() : null;
         } else {
index 56195584e413ac97c8bc448b0c7c8a45c291eb09..e807ab2f0c5f61f0a5e6d9c168e250f819e66017 100644 (file)
@@ -43,7 +43,7 @@ public class XSLFMetroShape {
     /*
      * parses the metro bytes to a XSLF shape
      */
-    public static Shape<?,?> parseShape(byte metroBytes[])
+    public static Shape<?,?> parseShape(byte[] metroBytes)
     throws InvalidFormatException, IOException, XmlException {
         PackagePartName shapePN = PackagingURIHelper.createPartName("/drs/shapexml.xml");
         OPCPackage pkg = null;
index b95b8ed356b6ee751b515c681c06e57d880544a9..11f94477f33b70f0b82bdacab22250aea117b061 100644 (file)
@@ -114,7 +114,7 @@ public final class XSLFPictureData extends POIXMLDocumentPart implements Picture
     @Override
     public byte[] getChecksum() {
         cacheProperties();
-        byte cs[] = new byte[LittleEndianConsts.LONG_SIZE];
+        byte[] cs = new byte[LittleEndianConsts.LONG_SIZE];
         LittleEndian.putLong(cs,0,checksum);
         return cs;
     }
@@ -139,7 +139,7 @@ public final class XSLFPictureData extends POIXMLDocumentPart implements Picture
      */
     protected void cacheProperties() {
         if (origSize == null || checksum == null) {
-            byte data[] = getData();
+            byte[] data = getData();
             checksum = IOUtils.calculateChecksum(data);
             
             PictureType pt = getType();
index aded851db5c9fe205572102257c9ad9c26de8f8f..a11b62abb3b9e7ea0719b5fb4b6daaaa43e239dc 100644 (file)
@@ -439,8 +439,8 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> {
             return Integer.compare(pos1, pos2);
         });
 
-        final ColorStyle cs[] = new ColorStyle[gs.length];
-        final float fractions[] = new float[gs.length];
+        final ColorStyle[] cs = new ColorStyle[gs.length];
+        final float[] fractions = new float[gs.length];
 
         int i=0;
         for (CTGradientStop cgs : gs) {
index 52d878098901244dacef171aaeb78799b9de8d80..1de2b1bea82cafa5cc65fe719077b5f9557984fc 100644 (file)
@@ -179,7 +179,7 @@ public class PPTX2PNG {
             }
         } else {
             for (String subrange : range.split(",")) {
-                String idx[] = subrange.split("-");
+                String[] idx = subrange.split("-");
                 switch (idx.length) {
                 default:
                 case 0: break;
index dccc9c552b9dc761c89a45c559650ac02d012747..1e305b4b85a12c24e1e2c222781ace5b5cdfd75f 100644 (file)
@@ -66,8 +66,8 @@ public final class XSSFPasswordHelper {
             cur.insertAttributeWithValue(getAttrName(prefix, "password"),
                                          String.format(Locale.ROOT, "%04X", hash).toUpperCase(Locale.ROOT));
         } else {
-            SecureRandom random = new SecureRandom(); 
-            byte salt[] = random.generateSeed(16);
+            SecureRandom random = new SecureRandom();
+            byte[] salt = random.generateSeed(16);
     
             // Iterations specifies the number of times the hashing function shall be iteratively run (using each
             // iteration's result as the input for the next iteration).
@@ -76,7 +76,7 @@ public final class XSSFPasswordHelper {
             // Implementation Notes List:
             // --> In this third stage, the reversed byte order legacy hash from the second stage shall
             //     be converted to Unicode hex string representation
-            byte hash[] = CryptoFunctions.hashPassword(password, hashAlgo, salt, spinCount, false);
+            byte[] hash = CryptoFunctions.hashPassword(password, hashAlgo, salt, spinCount, false);
             
             cur.insertAttributeWithValue(getAttrName(prefix, "algorithmName"), hashAlgo.jceId); 
             cur.insertAttributeWithValue(getAttrName(prefix, "hashValue"), DatatypeConverter.printBase64Binary(hash));
@@ -117,12 +117,12 @@ public final class XSSFPasswordHelper {
             if (hashVal == null || algoName == null || saltVal == null || spinCount == null) {
                 return false;
             }
-            
-            byte hash1[] = DatatypeConverter.parseBase64Binary(hashVal);
+
+            byte[] hash1 = DatatypeConverter.parseBase64Binary(hashVal);
             HashAlgorithm hashAlgo = HashAlgorithm.fromString(algoName);
-            byte salt[] = DatatypeConverter.parseBase64Binary(saltVal);
+            byte[] salt = DatatypeConverter.parseBase64Binary(saltVal);
             int spinCnt = Integer.parseInt(spinCount);
-            byte hash2[] = CryptoFunctions.hashPassword(password, hashAlgo, salt, spinCnt, false);
+            byte[] hash2 = CryptoFunctions.hashPassword(password, hashAlgo, salt, spinCnt, false);
             return Arrays.equals(hash1, hash2);
         }
     }
index f40e283968a5dbb900b169d6e2d6ccbf6d1218ae..39a8444b8be582639ff34a04dd976efc4c251814 100644 (file)
@@ -270,7 +270,7 @@ public class XWPFSettings extends POIXMLDocumentPart {
 
 
             SecureRandom random = new SecureRandom();
-            byte salt[] = random.generateSeed(16);
+            byte[] salt = random.generateSeed(16);
 
             // Iterations specifies the number of times the hashing function shall be iteratively run (using each
             // iteration's result as the input for the next iteration).
@@ -280,7 +280,7 @@ public class XWPFSettings extends POIXMLDocumentPart {
             // Implementation Notes List:
             // --> In this third stage, the reversed byte order legacy hash from the second stage shall
             //     be converted to Unicode hex string representation
-            byte hash[] = CryptoFunctions.hashPassword(legacyHash, hashAlgo, salt, spinCount, false);
+            byte[] hash = CryptoFunctions.hashPassword(legacyHash, hashAlgo, salt, spinCount, false);
 
             safeGetDocumentProtection().setSalt(salt);
             safeGetDocumentProtection().setHash(hash);
@@ -300,8 +300,8 @@ public class XWPFSettings extends POIXMLDocumentPart {
      */
     public boolean validateProtectionPassword(String password) {
         BigInteger sid = safeGetDocumentProtection().getCryptAlgorithmSid();
-        byte hash[] = safeGetDocumentProtection().getHash();
-        byte salt[] = safeGetDocumentProtection().getSalt();
+        byte[] hash = safeGetDocumentProtection().getHash();
+        byte[] salt = safeGetDocumentProtection().getSalt();
         BigInteger spinCount = safeGetDocumentProtection().getCryptSpinCount();
 
         if (sid == null || hash == null || salt == null || spinCount == null) return false;
@@ -337,7 +337,7 @@ public class XWPFSettings extends POIXMLDocumentPart {
         // Implementation Notes List:
         // --> In this third stage, the reversed byte order legacy hash from the second stage shall
         //     be converted to Unicode hex string representation
-        byte hash2[] = CryptoFunctions.hashPassword(legacyHash, hashAlgo, salt, spinCount.intValue(), false);
+        byte[] hash2 = CryptoFunctions.hashPassword(legacyHash, hashAlgo, salt, spinCount.intValue(), false);
 
         return Arrays.equals(hash, hash2);
     }
index 89f80532529760ef6181956ee5c76524b6a88751..5a5ac39ffaa6fb68f17a17a319b3a35cc70faf8a 100644 (file)
@@ -45,13 +45,13 @@ public class TestDetectAsOOXML {
        
     @Test
        public void testDetectAsPOIFS() throws IOException {
-           Object fileAndMagic[][] = {
-            { "SampleSS.xlsx", FileMagic.OOXML },
-            { "SampleSS.xls", FileMagic.OLE2 },
-            { "SampleSS.txt", FileMagic.UNKNOWN }
-           };
+        Object[][] fileAndMagic = {
+                {"SampleSS.xlsx", FileMagic.OOXML},
+                {"SampleSS.xls", FileMagic.OLE2},
+                {"SampleSS.txt", FileMagic.UNKNOWN}
+        };
 
-           for (Object fm[] : fileAndMagic) {
+           for (Object[] fm : fileAndMagic) {
                InputStream is = HSSFTestDataSamples.openSampleFileStream((String)fm[0]);
                is = FileMagic.prepareToCheckMagic(is);
                FileMagic act = FileMagic.valueOf(is);
index 393e474468fa5d6c7eea4a56d39782b4c1fbc852..446b33ec0ca5fa11b1f4c2bfc9f122916afbb7a2 100644 (file)
@@ -360,7 +360,7 @@ public final class TestPOIXMLDocument {
         UncaughtHandler uh = new UncaughtHandler();
         
         // check schema type loading and check if we could run in an OOM
-        Thread ta[] = new Thread[30];
+        Thread[] ta = new Thread[30];
         for (int j=0; j<10; j++) {
             for (int i=0; i<ta.length; i++) {
                 ta[i] = new Thread(run);
index 48c9240e981c9b9dd3b506041611b27801eebd95..1c7d5d6e35488d7576139ef395005bf37726487e 100644 (file)
@@ -43,7 +43,7 @@ public class OOXMLLiteAgent {
         final Set<Integer> fileHashes = new HashSet<>();
 
         public LoggingTransformer(String agentArgs) {
-            String args[] = (agentArgs == null ? "" : agentArgs).split("\\|",2);
+            String[] args = (agentArgs == null ? "" : agentArgs).split("\\|", 2);
             path = Paths.get(args.length >= 1 ? args[0] : "ooxml-lite.out");
             includes = Pattern.compile(args.length >= 2 ? args[1] : ".*/schemas/.*");
 
index 66a76305183f06f69f0bde9cd719565cafb41280..3305a7e2dca63af07ace619cdc3aa2caa19ca0f6 100644 (file)
@@ -804,7 +804,7 @@ public final class TestPackage {
                                                        IOUtils.copy(is, bos2);
                                                        long size = bos2.size() - "</Types>".length();
                                                        append.write(bos2.toByteArray(), 0, (int) size);
-                                                       byte spam[] = new byte[0x7FFF];
+                            byte[] spam = new byte[0x7FFF];
                                                        Arrays.fill(spam, (byte) ' ');
                                                        // 0x7FFF0000 is the maximum for 32-bit zips, but less still works
                                                        while (size < 0x7FFF00) {
@@ -979,12 +979,12 @@ public final class TestPackage {
     public void testTooShortFilterStreams() throws IOException {
         File xssf = OpenXML4JTestDataSamples.getSampleFile("sample.xlsx");
         File hssf = POIDataSamples.getSpreadSheetInstance().getFile("SampleSS.xls");
-        
-        InputStream isList[] = {
-            new PushbackInputStream(new FileInputStream(xssf), 2),
-            new BufferedInputStream(new FileInputStream(xssf), 2),
-            new PushbackInputStream(new FileInputStream(hssf), 2),
-            new BufferedInputStream(new FileInputStream(hssf), 2),
+
+        InputStream[] isList = {
+                new PushbackInputStream(new FileInputStream(xssf), 2),
+                new BufferedInputStream(new FileInputStream(xssf), 2),
+                new PushbackInputStream(new FileInputStream(hssf), 2),
+                new BufferedInputStream(new FileInputStream(hssf), 2),
         };
         
         try {
index 691f0b1b98d605d9a820df3cb651c3e1002f7628..40b703c93b8bf7854c677703f97490af4408b7a1 100644 (file)
@@ -56,7 +56,7 @@ public class TestRelationships extends TestCase {
         PackageRelationshipCollection rels = pkg.getRelationshipsByType(PackageRelationshipTypes.CORE_DOCUMENT);
         PackageRelationship coreDocRelationship = rels.getRelationship(0);
         PackagePart corePart = pkg.getPart(coreDocRelationship);
-        String relIds[] = { "rId1", "rId2", "rId3" };
+        String[] relIds = {"rId1", "rId2", "rId3"};
         for (String relId : relIds) {
             PackageRelationship rel = corePart.getRelationship(relId);
             assertNotNull(rel);
index 28abec4a2eb469163ce7347056c2e9f77b31be6b..6c8cc16686d3cc6902562ab68a99e3622153ae8d 100644 (file)
@@ -43,7 +43,7 @@ import org.junit.runners.Parameterized.Parameters;
 @RunWith(Parameterized.class)
 public class TestAgileEncryptionParameters {
 
-    static byte testData[];
+    static byte[] testData;
     
     @Parameter(value = 0)
     public CipherAlgorithm ca;
@@ -54,9 +54,9 @@ public class TestAgileEncryptionParameters {
 
     @Parameters(name="{0} {1} {2}")
     public static Collection<Object[]> data() {
-        CipherAlgorithm caList[] = { CipherAlgorithm.aes128, CipherAlgorithm.aes192, CipherAlgorithm.aes256, CipherAlgorithm.rc2, CipherAlgorithm.des, CipherAlgorithm.des3 };
-        HashAlgorithm haList[] = { HashAlgorithm.sha1, HashAlgorithm.sha256, HashAlgorithm.sha384, HashAlgorithm.sha512, HashAlgorithm.md5 };
-        ChainingMode cmList[] = { ChainingMode.cbc, ChainingMode.cfb };
+        CipherAlgorithm[] caList = {CipherAlgorithm.aes128, CipherAlgorithm.aes192, CipherAlgorithm.aes256, CipherAlgorithm.rc2, CipherAlgorithm.des, CipherAlgorithm.des3};
+        HashAlgorithm[] haList = {HashAlgorithm.sha1, HashAlgorithm.sha256, HashAlgorithm.sha384, HashAlgorithm.sha512, HashAlgorithm.md5};
+        ChainingMode[] cmList = {ChainingMode.cbc, ChainingMode.cfb};
 
         List<Object[]> data = new ArrayList<>();
         for (CipherAlgorithm ca : caList) {
@@ -101,7 +101,7 @@ public class TestAgileEncryptionParameters {
         boolean passed = dec.verifyPassword("foobaa");
         assertTrue(passed);
         InputStream is = dec.getDataStream(fsDec);
-        byte actualData[] = IOUtils.toByteArray(is);
+        byte[] actualData = IOUtils.toByteArray(is);
         is.close();
         fsDec.close();
         assertArrayEquals("Failed roundtrip - "+ca+"-"+ha+"-"+cm, testData, actualData);
index 5495d7a80a85d3a9db1fa1fc9d0444e7194b7775..f556513ed0163935e35bf7259d4fca19d2faa841 100644 (file)
@@ -80,7 +80,7 @@ public class TestCertificateEncryption {
      */
     static final String certDN = "CN=poitest";
     // static final File pfxFile = TempFile.createTempFile("poitest", ".pfx");
-    static byte pfxFileBytes[];
+    static byte[] pfxFileBytes;
     
     static class CertData {
         KeyPair keypair;
@@ -171,7 +171,7 @@ public class TestCertificateEncryption {
         
         File file = POIDataSamples.getDocumentInstance().getFile("VariousPictures.docx");
         InputStream fis = new FileInputStream(file);
-        byte byteExpected[] = IOUtils.toByteArray(fis);
+        byte[] byteExpected = IOUtils.toByteArray(fis);
         fis.close();
         
         OutputStream os = enc.getDataStream(fs);
@@ -189,7 +189,7 @@ public class TestCertificateEncryption {
         assertTrue("certificate verification failed", passed);
         
         fis = agDec.getDataStream(fs);
-        byte byteActual[] = IOUtils.toByteArray(fis);
+        byte[] byteActual = IOUtils.toByteArray(fis);
         fis.close();
         
         assertThat(byteExpected, equalTo(byteActual));
index 242c83c98d5350a7a48863b5f8a163c120755522..3979518e0525c0dce17b0f7a597fa9b430ef9dff 100644 (file)
@@ -89,7 +89,7 @@ public class TestDecryptor {
                     continue;
                 }
                 assertEquals(entry.getSize() - 1, zin.skip(entry.getSize() - 1));
-                byte buf[] = new byte[10];
+                byte[] buf = new byte[10];
                 int readBytes = zin.read(buf);
                 // zin.available() doesn't work for entries
                 assertEquals("size failed for " + entry.getName(), 1, readBytes);
index eb50408f1ea855e6589fb4a41b098adb55939234..f9176187daafd8beeeea7702b504ddbdf3cbb7bd 100644 (file)
@@ -126,11 +126,11 @@ public class TestEncryptor {
         }
 
         // check that same verifier/salt lead to same hashes
-        final byte verifierSaltExpected[] = infoExpected.getVerifier().getSalt();
-        final byte verifierExpected[] = decExpected.getVerifier();
-        final byte keySalt[] = infoExpected.getHeader().getKeySalt();
-        final byte keySpec[] = decExpected.getSecretKey().getEncoded();
-        final byte integritySalt[] = decExpected.getIntegrityHmacKey();
+        final byte[] verifierSaltExpected = infoExpected.getVerifier().getSalt();
+        final byte[] verifierExpected = decExpected.getVerifier();
+        final byte[] keySalt = infoExpected.getHeader().getKeySalt();
+        final byte[] keySpec = decExpected.getSecretKey().getEncoded();
+        final byte[] integritySalt = decExpected.getIntegrityHmacKey();
         // the hmacs of the file always differ, as we use PKCS5-padding to pad the bytes
         // whereas office just uses random bytes
         // byte integrityHash[] = d.getIntegrityHmacValue();
@@ -210,10 +210,10 @@ public class TestEncryptor {
         }
 
         // check that same verifier/salt lead to same hashes
-        final byte verifierSaltExpected[] = infoExpected.getVerifier().getSalt();
-        final byte verifierExpected[] = d.getVerifier();
-        final byte keySpec[] = d.getSecretKey().getEncoded();
-        final byte keySalt[] = infoExpected.getHeader().getKeySalt();
+        final byte[] verifierSaltExpected = infoExpected.getVerifier().getSalt();
+        final byte[] verifierExpected = d.getVerifier();
+        final byte[] keySpec = d.getSecretKey().getEncoded();
+        final byte[] keySalt = infoExpected.getHeader().getKeySalt();
         
         
         final EncryptionInfo infoActual = new EncryptionInfo(
index 0b3525ee1b11315c6b7fce35fde39520aa751dd4..8a3fa772a9b792a0827924f0becbc046053eaf6b 100644 (file)
@@ -302,11 +302,11 @@ public class TestSignatureInfo {
     
     @Test
     public void getSignerUnsigned() throws Exception {
-        String testFiles[] = { 
-            "hello-world-unsigned.docx",
-            "hello-world-unsigned.pptx",
-            "hello-world-unsigned.xlsx",
-            "hello-world-office-2010-technical-preview-unsigned.docx"
+        String[] testFiles = {
+                "hello-world-unsigned.docx",
+                "hello-world-unsigned.pptx",
+                "hello-world-unsigned.xlsx",
+                "hello-world-office-2010-technical-preview-unsigned.docx"
         };
         
         for (String testFile : testFiles) {
@@ -330,17 +330,17 @@ public class TestSignatureInfo {
     
     @Test
     public void getSigner() throws Exception {
-        String testFiles[] = { 
-            "hyperlink-example-signed.docx",
-            "hello-world-signed.docx",
-            "hello-world-signed.pptx",
-            "hello-world-signed.xlsx",
-            "hello-world-office-2010-technical-preview.docx",
-            "ms-office-2010-signed.docx",
-            "ms-office-2010-signed.pptx",
-            "ms-office-2010-signed.xlsx",
-            "Office2010-SP1-XAdES-X-L.docx",
-            "signed.docx",
+        String[] testFiles = {
+                "hyperlink-example-signed.docx",
+                "hello-world-signed.docx",
+                "hello-world-signed.pptx",
+                "hello-world-signed.xlsx",
+                "hello-world-office-2010-technical-preview.docx",
+                "ms-office-2010-signed.docx",
+                "ms-office-2010-signed.pptx",
+                "ms-office-2010-signed.xlsx",
+                "Office2010-SP1-XAdES-X-L.docx",
+                "signed.docx",
         };
         
         for (String testFile : testFiles) {
@@ -594,7 +594,7 @@ public class TestSignatureInfo {
 
             String certDigestXQuery = declareNS +
                     "$this//xades:SigningCertificate/xades:Cert/xades:CertDigest";
-            XmlObject xoList[] = sigDoc.selectPath(certDigestXQuery);
+            XmlObject[] xoList = sigDoc.selectPath(certDigestXQuery);
             assertEquals(xoList.length, 1);
             DigestAlgAndValueType certDigest = (DigestAlgAndValueType) xoList[0];
             assertNotNull(certDigest.getDigestValue());
@@ -682,7 +682,7 @@ public class TestSignatureInfo {
         is.close();
 
         Key key = keystore.getKey("poitest", password.toCharArray());
-        Certificate chainList[] = keystore.getCertificateChain("poitest");
+        Certificate[] chainList = keystore.getCertificateChain("poitest");
         List<X509Certificate> certChain = new ArrayList<>();
         for (Certificate c : chainList) {
             certChain.add((X509Certificate)c);
@@ -726,8 +726,8 @@ public class TestSignatureInfo {
         signatureConfig.setKey(keyPair.getPrivate());
         signatureConfig.setSigningCertificateChain(Collections.singletonList(x509));
 
-        HashAlgorithm testAlgo[] = { HashAlgorithm.sha224, HashAlgorithm.sha256
-            , HashAlgorithm.sha384, HashAlgorithm.sha512, HashAlgorithm.ripemd160 }; 
+        HashAlgorithm[] testAlgo = {HashAlgorithm.sha224, HashAlgorithm.sha256
+                , HashAlgorithm.sha384, HashAlgorithm.sha512, HashAlgorithm.ripemd160};
         
         for (HashAlgorithm ha : testAlgo) {
             OPCPackage pkg = null;
@@ -932,7 +932,7 @@ public class TestSignatureInfo {
     }
     
     private void initKeyPair(String alias, String subjectDN, String pfxInput) throws Exception {
-        final char password[] = "test".toCharArray();
+        final char[] password = "test".toCharArray();
         File file = new File("build/test.pfx");
 
         KeyStore keystore = KeyStore.getInstance("PKCS12");
index 39de26a073e9139c95ed799b2b227f66be8e418c..91751e96d086dd769f2ee7c0a1e4414b46c371e8 100644 (file)
@@ -68,7 +68,7 @@ public class TestFonts {
         "\u304C\u597D\u304D\u3067\u3001\u5C0F\u3055\u3044\u9803\u3001\u53E4\u4EE3\u751F\u7269\u306E\u56F3" +
         "\u9451\u3092\u4E00\u7DD2\u306B\u898B\u3066\u305F\u306E\u601D\u3044\u51FA\u3059\u301C\u3068\u3044";
 
-    private static final String INIT_FONTS[] = { "mona.ttf" };
+    private static final String[] INIT_FONTS = {"mona.ttf"};
 
     // currently linux and mac return quite different values
     private static final int[] expected_sizes = {
index 4b2a1b191e38ecba8bff87bd780ca3dbdc2dfa94..7c040475fd33bbdf4f93c370badd2d3ffe0efc7d 100644 (file)
@@ -110,12 +110,12 @@ public class TestTable {
     }
     
     private void testTextDirection(SlideShow<?,?> ppt1) throws IOException {
-        
-        TextDirection tds[] = {
-            TextDirection.HORIZONTAL,
-            TextDirection.VERTICAL,
-            TextDirection.VERTICAL_270,
-            // TextDirection.STACKED is not supported on HSLF
+
+        TextDirection[] tds = {
+                TextDirection.HORIZONTAL,
+                TextDirection.VERTICAL,
+                TextDirection.VERTICAL_270,
+                // TextDirection.STACKED is not supported on HSLF
         };
         
         TableShape<?,?> tbl1 = ppt1.createSlide().createTable(1, 3);
@@ -148,7 +148,7 @@ public class TestTable {
     
     @Test
     public void tableSpan() throws IOException {
-        String files[] = (xslfOnly()) ? new String[]{ "bug60993.pptx" } : new String[]{ "bug60993.pptx", "bug60993.ppt" };
+        String[] files = (xslfOnly()) ? new String[]{"bug60993.pptx"} : new String[]{"bug60993.pptx", "bug60993.ppt"};
         for (String f : files) {
             SlideShow<?,?> ppt = openSampleSlideshow(f);
             Slide<?,?> slide = ppt.getSlides().get(0);
index 377e770e2ebd41d57aa00d306b461203ae0ee0fa..3f5a1c0a29f341310bed2c340fd7a40cd82b8eed 100644 (file)
@@ -108,7 +108,7 @@ public class TestEmbeddedExtractor {
     public static String md5hash(byte[] input) {
         try {
             MessageDigest md = MessageDigest.getInstance("MD5");
-            byte hash[] = md.digest(input);
+            byte[] hash = md.digest(input);
             return DatatypeConverter.printBase64Binary(hash);
         } catch (NoSuchAlgorithmException e) {
             // doesn't happen
index 16d0b0b8c471cc7f588c66416df06d83efb66ee6..ec5166812a2ffb56a32767e285e0727a9b10ce97 100644 (file)
@@ -82,7 +82,7 @@ public class TestEmbedOLEPackage {
 
     static void validateEmbeddedObjects(Workbook wb) throws IOException {
         boolean ooxml = wb.getClass().getName().toLowerCase(Locale.ROOT).contains("xssf");
-        byte data[] = (ooxml) ? samplePPTX : samplePPT;
+        byte[] data = (ooxml) ? samplePPTX : samplePPT;
         Iterator<Integer> shapeIds = Arrays.asList(1025,1026,2049).iterator();
         EmbeddedExtractor ee = new EmbeddedExtractor();
         for (Sheet sheet : wb) {
@@ -101,7 +101,7 @@ public class TestEmbedOLEPackage {
     static void addEmbeddedObjects(Workbook wb) throws IOException {
         boolean ooxml = wb.getClass().getName().toLowerCase(Locale.ROOT).contains("xssf");
         int picIdx = wb.addPicture(samplePNG, Workbook.PICTURE_TYPE_PNG);
-        byte data[] = (ooxml) ? samplePPTX : samplePPT;
+        byte[] data = (ooxml) ? samplePPTX : samplePPT;
         String ext = (ooxml) ? ".pptx" : ".ppt";
         
         int oleIdx1a = wb.addOlePackage(data, "dummy1a"+ext, "dummy1a"+ext, "dummy1a"+ext);
index e154adcdc561b0193f9f7f60fb06bd09e9bc9f4a..5b6e18ce4dfc5b7f4f1de3982e191d173f30f3f8 100644 (file)
@@ -43,7 +43,7 @@ public class TestTempFileThreaded {
     private static final int NUMBER_OF_TESTS = 200;
 
     private volatile Throwable exception;
-    private int executions[];
+    private int[] executions;
 
     // the actual thread-safe temp-file strategy
     private static TempFileCreationStrategy createTempFileCreationStrategy(File poiTempFileDirectory) {
index 8dbc8ca23e187667d75b9c4fd9488459eff7f8c8..8867d694038eff63870b932b5307fedac46222d2 100644 (file)
@@ -290,7 +290,7 @@ public class TestXSLFBugs {
     @Test
     public void bug60499() throws IOException, InvalidFormatException {
         InputStream is = slTests.openResourceAsStream("bug60499.pptx");
-        byte buf[] = IOUtils.toByteArray(is);
+        byte[] buf = IOUtils.toByteArray(is);
         is.close();
 
         PackagePartName ppn = PackagingURIHelper.createPartName("/ppt/media/image1.png");
@@ -775,8 +775,8 @@ public class TestXSLFBugs {
         assertTrue(actualStyle instanceof SolidPaint);
         SolidPaint ps = (SolidPaint)actualStyle;
         Color actual = DrawPaint.applyColorTransform(ps.getSolidColor());
-        float expRGB[] = expected.getRGBComponents(null);
-        float actRGB[] = actual.getRGBComponents(null);
+        float[] expRGB = expected.getRGBComponents(null);
+        float[] actRGB = actual.getRGBComponents(null);
         assertArrayEquals(expRGB, actRGB, 0.0001f);
     }
 
index 226368d149abc34265d175213bf9ce0e7132f111..949e1951cbc6087c487fac40dc0a0cb4762d0bb7 100644 (file)
@@ -109,7 +109,7 @@ public class TestXSLFFreeformShape {
     }
 
     private void comparePoint(PathIterator pi, int type, double x0, double y0) {
-        double points[] = new double[6];
+        double[] points = new double[6];
         int piType = pi.currentSegment(points);
         assertEquals(type, piType);
         assertEquals(x0, points[0], 0);
index f599a219c94b9125c42dda61636cd9d7fc5bb6eb..247f8d8799c2bc76c67692d386f7f454af53deb9 100644 (file)
@@ -126,20 +126,20 @@ public class TestXSLFSlideShow {
 
     @Test
     public void testSlideLayoutNames() throws IOException {
-        final String names[] = {
-              "Blank", "Title Only", "Section Header", "Picture with Caption", "Title and Content"
-            , "Title Slide", "Title and Vertical Text", "Vertical Title and Text", "Comparison"
-            , "Two Content", "Content with Caption"                
+        final String[] names = {
+                "Blank", "Title Only", "Section Header", "Picture with Caption", "Title and Content"
+                , "Title Slide", "Title and Vertical Text", "Vertical Title and Text", "Comparison"
+                , "Two Content", "Content with Caption"
         };
         XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("layouts.pptx");
         for (String name : names) {
             assertNotNull(ppt.findLayout(name));
         }
-        final SlideLayout layTypes[] = {
-              SlideLayout.BLANK, SlideLayout.TITLE_ONLY, SlideLayout.SECTION_HEADER
-            , SlideLayout.PIC_TX, SlideLayout.TITLE_AND_CONTENT, SlideLayout.TITLE
-            , SlideLayout.VERT_TX, SlideLayout.VERT_TITLE_AND_TX, SlideLayout.TWO_TX_TWO_OBJ
-            , SlideLayout.TWO_OBJ, SlideLayout.OBJ_TX                
+        final SlideLayout[] layTypes = {
+                SlideLayout.BLANK, SlideLayout.TITLE_ONLY, SlideLayout.SECTION_HEADER
+                , SlideLayout.PIC_TX, SlideLayout.TITLE_AND_CONTENT, SlideLayout.TITLE
+                , SlideLayout.VERT_TX, SlideLayout.VERT_TITLE_AND_TX, SlideLayout.TWO_TX_TWO_OBJ
+                , SlideLayout.TWO_OBJ, SlideLayout.OBJ_TX
         };
         for (SlideLayout sl : layTypes){
             assertNotNull(ppt.getSlideMasters().get(0).getLayout(sl));
index 5b48b34584aa17d6c593fc8135281a58f6a5e946..2f0ece24204a317c8b96941e361746bbd1f97584 100644 (file)
@@ -44,9 +44,9 @@ public class TestThemesTable {
     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
-    private static String rgbExpected[] = {
+    private static String[] rgbExpected = {
             "ffffff", // Lt1
             "000000", // Dk1
             "eeece1", // Lt2
index de4348c9d5af08dfd724c14e623d1c341add5168..aa0045f809bceb1e4976f92870c61f59f294dccd 100644 (file)
@@ -470,13 +470,13 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
     public void testZipBombNotTriggeredOnUselessContent() throws IOException {
         SXSSFWorkbook swb = new SXSSFWorkbook(null, 1, true, true);
         SXSSFSheet s = swb.createSheet();
-        char useless[] = new char[32767];
+        char[] useless = new char[32767];
         Arrays.fill(useless, ' ');
         
         for (int row=0; row<1; row++) {
             Row r = s.createRow(row);
             for (int col=0; col<10; col++) {
-                char prefix[] = Integer.toHexString(row*1000+col).toCharArray();
+                char[] prefix = Integer.toHexString(row * 1000 + col).toCharArray();
                 Arrays.fill(useless, 0, 10, ' ');
                 System.arraycopy(prefix, 0, useless, 0, prefix.length);
                 String ul = new String(useless);
index bfbd21fe0a31db36ccf6ee6c1fbbc508464967dc..bc058c8f20b5cf8b6a4c4c89566b09ba81d54ecd 100644 (file)
@@ -82,7 +82,7 @@ public final class TestUnfixedBugs {
 
     private void verifyBug54084Unicode(Workbook wb) {
         // expected data is stored in UTF-8 in a text-file
-        byte data[] = HSSFTestDataSamples.getTestDataFileContent("54084 - Greek - beyond BMP.txt");
+        byte[] data = HSSFTestDataSamples.getTestDataFileContent("54084 - Greek - beyond BMP.txt");
         String testData = new String(data, StandardCharsets.UTF_8).trim();
 
         Sheet sheet = wb.getSheetAt(0);
index 9a3d700fcecde16268cbaeb1afc1281b9ad4036f..60a8f12ef05bf0f3a901e416baac607ad5647b33 100644 (file)
@@ -1581,10 +1581,10 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
 
         ByteArrayOutputStream bos = new ByteArrayOutputStream(8096);
         wb.write(bos);
-        byte firstSave[] = bos.toByteArray();
+        byte[] firstSave = bos.toByteArray();
         bos.reset();
         wb.write(bos);
-        byte secondSave[] = bos.toByteArray();
+        byte[] secondSave = bos.toByteArray();
 
         /*OutputStream stream = new FileOutputStream("C:\\temp\\poi.xlsx");
         try {
index b8dbd36a712f94e9f25f10cb7b3d0b0ca160dfca..b3025e54a5a53c2bac37c9745359828d03a811b1 100644 (file)
@@ -177,7 +177,7 @@ public class TestXSSFVMLDrawing {
         Pattern p = Pattern.compile("<br/>");
         int count = 0;
         for (XmlObject xo : vml.getItems()) {
-            String split[] = p.split(xo.toString());
+            String[] split = p.split(xo.toString());
             count += split.length-1;
         }
         assertEquals(16, count);
index a77eedc99993a8953309c554ac8cc2e6267439de..3e293a6268ca6a394292f2da35e39b4c19744319 100644 (file)
@@ -126,7 +126,7 @@ public class TestXWPFBugs {
     
     @Test
     public void bug59058() throws IOException, XmlException {
-        String files[] = { "bug57031.docx", "bug59058.docx" };
+        String[] files = {"bug57031.docx", "bug59058.docx"};
         for (String f : files) {
             ZipFile zf = new ZipFile(samples.getFile(f));
             ZipArchiveEntry entry = zf.getEntry("word/document.xml");
index 5c34886fb65e6e108f0d20f5d3be06519e08da11..f7f7570e4cb4badb3b98dd5620d147922e3fabdb 100644 (file)
@@ -87,7 +87,7 @@ public final class VSDDumper {
                dumpVal("First few bytes are", ds, indent+1);
 
                if (stream instanceof PointerContainingStream) {
-                   Stream streams[] = ((PointerContainingStream)stream).getPointedToStreams();
+            Stream[] streams = ((PointerContainingStream) stream).getPointedToStreams();
                        dumpVal("Nbr of children", streams.length, indent+1);
 
                        for(Stream s : streams) {
@@ -95,7 +95,7 @@ public final class VSDDumper {
                        }
                }
                if(stream instanceof ChunkStream) {
-                   Chunk chunks[] = ((ChunkStream)stream).getChunks();
+            Chunk[] chunks = ((ChunkStream) stream).getChunks();
                        dumpVal("Nbr of chunks", chunks.length, indent+1);
 
                        for(Chunk chunk : chunks) {
@@ -109,7 +109,7 @@ public final class VSDDumper {
         dumpVal("Length is", chunk._getContents().length, indent);
         dumpVal("OD Size is", chunk.getOnDiskSize(), indent);
         dumpVal("T / S is", chunk.getTrailer() + " / " + chunk.getSeparator(), indent);
-        Command commands[] = chunk.getCommands();
+        Command[] commands = chunk.getCommands();
         dumpVal("Nbr of commands", commands.length, indent);
         for(Command command : commands) {
             dumpVal(command.getDefinition().getName(), ""+command.getValue(), indent+1);
index 327e1be57f72650b6b9dc1538f2d16afc6cc7e6f..111f9e5e308d66397d27a415f3531e8a9f192d0c 100644 (file)
@@ -136,7 +136,7 @@ public class HemfDraw {
              * The cubic Bezier curves SHOULD be drawn using the current pen.
              */
 
-            Point2D pnt[] = { new Point2D.Double(), new Point2D.Double(), new Point2D.Double() };
+            Point2D[] pnt = {new Point2D.Double(), new Point2D.Double(), new Point2D.Double()};
 
             int i=0;
             if (hasStartPoint()) {
@@ -754,7 +754,7 @@ public class HemfDraw {
             long size = readRectL(leis, bounds);
             int count = (int)leis.readUInt();
             size += LittleEndianConsts.INT_SIZE;
-            Point2D points[] = new Point2D[count];
+            Point2D[] points = new Point2D[count];
             for (int i=0; i<count; i++) {
                 points[i] = new Point2D.Double();
                 size += readPoint(leis, points[i]);
index a7eb4c8b1c6184094cc122880557c7940428c2cb..256a7618e599f853f58b412dcd55ce0da7bd4981 100644 (file)
@@ -476,7 +476,7 @@ public class HemfFont extends HwmfFont {
     @Override
     protected int readString(LittleEndianInputStream leis, StringBuilder sb, int limit) throws IOException {
         sb.setLength(0);
-        byte buf[] = new byte[limit*2];
+        byte[] buf = new byte[limit * 2];
         leis.readFully(buf);
 
         int b1, b2, readBytes = 0;
index edf96497438cc0e05f1dc02540a46dd38c4eca26..b067ce355f2de7d664e2cebca323261be5be4d47 100644 (file)
@@ -143,7 +143,7 @@ public final class HMEFDumper {
                   thisLen = len - offset;
                }
 
-               byte data[] = IOUtils.safelyAllocate(thisLen, MAX_RECORD_LENGTH);
+                byte[] data = IOUtils.safelyAllocate(thisLen, MAX_RECORD_LENGTH);
                System.arraycopy(attr.getData(), offset, data, 0, thisLen);
                
                System.out.print(
index 32ff69f24a2f9668e0b838c1b840b3fa114e5cd0..505ad50a2fd257ae799688f96b66b0847ba2c534 100644 (file)
@@ -47,7 +47,7 @@ public abstract class EscherPart extends HPBFPart {
                        new DefaultEscherRecordFactory();
 
                ArrayList<EscherRecord> ec = new ArrayList<>();
-               byte data[] = getData();
+        byte[] data = getData();
                int left = data.length;
                while(left > 0) {
                        EscherRecord er = erf.createRecord(data, 0);
@@ -74,7 +74,7 @@ public abstract class EscherPart extends HPBFPart {
                        size += records[i].getRecordSize();
                }
 
-               byte data[] = IOUtils.safelyAllocate(size, MAX_RECORD_LENGTH);
+        byte[] data = IOUtils.safelyAllocate(size, MAX_RECORD_LENGTH);
                size = 0;
                for(int i=0; i<records.length; i++) {
                        int thisSize =
index f3fefe55c63a5578cb5b68b9027bafae32fa87e7..2a19670f1f24466ff437c6074ccbd059d310ac1d 100644 (file)
@@ -102,7 +102,7 @@ public abstract class HPBFPart {
                return data;
        }
        
-       protected final void setData(byte data[]) {
+       protected final void setData(byte[] data) {
            this.data = data.clone();
        }
 
index cc420922f796463b7f48cb18ac72a0ac64aee6b0..8db0e5b7d29d589936515e7ec63dc59291b6c838 100644 (file)
@@ -46,7 +46,7 @@ public final class QuillContents extends HPBFPart {
 
                // Now parse the first 512 bytes, and produce
                //  all our bits
-               byte data[] = getData();
+        byte[] data = getData();
 
                // Check first 8 bytes
                String f8 = new String(data, 0, 8, LocaleUtil.CHARSET_1252);
index 5dd2a079f1787c636391e87038d451492bc8dc69..dddbdde5bb1170f48aade0d0aa5cc568583f2387 100644 (file)
@@ -48,7 +48,7 @@ public abstract class QCBit {
         */
        public String getBitType() { return bitType; }
        public final byte[] getData() { return data; }
-       protected final void setData(byte data[]) {
+       protected final void setData(byte[] data) {
            this.data = data.clone();
        }
 
index 29426cda78fb306e0d6e73fd70c6002017e51b84..57146192ff734c1993393885752cb27e2e3b4d29 100644 (file)
@@ -74,7 +74,7 @@ public abstract class QCPLCBit extends QCBit {
                return plcValB;
        }
 
-       final void setPreData(int preData[]) {
+       final void setPreData(int[] preData) {
            this.preData = preData.clone();
        }
 
@@ -115,18 +115,19 @@ public abstract class QCPLCBit extends QCBit {
                        super(thingType, bitType, data);
 
                        // Grab our 4x pre-data
-                       int preData[] = {
-                       LittleEndian.getUShort(data, 8+0),
-                       LittleEndian.getUShort(data, 8+2),
-                       LittleEndian.getUShort(data, 8+4),
-                       LittleEndian.getUShort(data, 8+6)
-                       };
+            int[] preData = {
+                    LittleEndian.getUShort(data, 8 + 0),
+                    LittleEndian.getUShort(data, 8 + 2),
+                    LittleEndian.getUShort(data, 8 + 4),
+                    LittleEndian.getUShort(data, 8 + 6)
+            };
                        setPreData(preData);
 
             // And grab the 2 byte values
                        int cntPlcs = getNumberOfPLCs();
-                       long plcValA[] = new long[cntPlcs], plcValB[] = new long[cntPlcs];
-                       for(int i=0; i<cntPlcs; i++) {
+            long[] plcValA = new long[cntPlcs];
+            long[] plcValB = new long[cntPlcs];
+            for(int i=0; i<cntPlcs; i++) {
                                plcValA[i] = LittleEndian.getUShort(data, 16+(4*i));
                                plcValB[i] = LittleEndian.getUShort(data, 16+(4*i)+2);
                        }
@@ -144,18 +145,19 @@ public abstract class QCPLCBit extends QCBit {
                        super(thingType, bitType, data);
 
                        // Grab our 4x pre-data
-                       int preData[] = {
-                       LittleEndian.getUShort(data, 8+0),
-                       LittleEndian.getUShort(data, 8+2),
-                       LittleEndian.getUShort(data, 8+4),
-                       LittleEndian.getUShort(data, 8+6)
-                       };
+            int[] preData = {
+                    LittleEndian.getUShort(data, 8 + 0),
+                    LittleEndian.getUShort(data, 8 + 2),
+                    LittleEndian.getUShort(data, 8 + 4),
+                    LittleEndian.getUShort(data, 8 + 6)
+            };
                        setPreData(preData);
 
                        // And grab the 4 byte values
             int cntPlcs = getNumberOfPLCs();
-            long plcValA[] = new long[cntPlcs], plcValB[] = new long[cntPlcs];
-                       for(int i=0; i<cntPlcs; i++) {
+            long[] plcValA = new long[cntPlcs];
+            long[] plcValB = new long[cntPlcs];
+            for(int i=0; i<cntPlcs; i++) {
                                plcValA[i] = LittleEndian.getUInt(data, 16+(8*i));
                                plcValB[i] = LittleEndian.getUInt(data, 16+(8*i)+4);
                        }
@@ -173,21 +175,22 @@ public abstract class QCPLCBit extends QCBit {
                        super(thingType, bitType, data);
 
                        // Grab our 7x pre-data
-                       int preData[] = {
-                       LittleEndian.getUShort(data, 8+0),
-                       LittleEndian.getUShort(data, 8+2),
-                       LittleEndian.getUShort(data, 8+4),
-                       LittleEndian.getUShort(data, 8+6),
-                       LittleEndian.getUShort(data, 8+8),
-                       LittleEndian.getUShort(data, 8+10),
-                       LittleEndian.getUShort(data, 8+12)
-                       };
+            int[] preData = {
+                    LittleEndian.getUShort(data, 8 + 0),
+                    LittleEndian.getUShort(data, 8 + 2),
+                    LittleEndian.getUShort(data, 8 + 4),
+                    LittleEndian.getUShort(data, 8 + 6),
+                    LittleEndian.getUShort(data, 8 + 8),
+                    LittleEndian.getUShort(data, 8 + 10),
+                    LittleEndian.getUShort(data, 8 + 12)
+            };
             setPreData(preData);
 
                        // And grab the 4 byte values
             int cntPlcs = getNumberOfPLCs();
-            long plcValA[] = new long[cntPlcs], plcValB[] = new long[cntPlcs];
-                       for(int i=0; i<cntPlcs; i++) {
+            long[] plcValA = new long[cntPlcs];
+            long[] plcValB = new long[cntPlcs];
+            for(int i=0; i<cntPlcs; i++) {
                                plcValA[i] = LittleEndian.getUInt(data, 22+(8*i));
                                plcValB[i] = LittleEndian.getUInt(data, 22+(8*i)+4);
                        }
@@ -221,7 +224,7 @@ public abstract class QCPLCBit extends QCBit {
 
                        // We have 4 bytes, then the start point of each
                        //  hyperlink, then the end point of the text.
-                       int preData[] = new int[1+cntPlcs+1];
+            int[] preData = new int[1 + cntPlcs + 1];
                        for(int i=0; i<preData.length; i++) {
                                preData[i] = (int)LittleEndian.getUInt(data, 8+(i*4));
                        }
@@ -238,8 +241,8 @@ public abstract class QCPLCBit extends QCBit {
                                until = twoStartsAt + (cntPlcs-2)*threePlusIncrement;
                        }
 
-                       long plcValA[] = new long[(until-at)/2];
-                       long plcValB[] = new long[0];
+            long[] plcValA = new long[(until - at) / 2];
+            long[] plcValB = new long[0];
                        for(int i=0; i<plcValA.length; i++) {
                                plcValA[i] = LittleEndian.getUShort(data, at+(i*2));
                        }
index 38de0244e70de589ad4c1443b451420d4f75b351..330c948fb2d9f92ea018ad3d1921a2c169167340 100644 (file)
@@ -41,7 +41,7 @@ public final class QCTextBit extends QCBit {
        }
 
        public void setText(String text) {
-               byte data[] = IOUtils.safelyAllocate(text.length()*2, MAX_RECORD_LENGTH);
+        byte[] data = IOUtils.safelyAllocate(text.length() * 2, MAX_RECORD_LENGTH);
                StringUtil.putUnicodeLE(text, data, 0);
                setData(data);
        }
index 5ac4a5160834075e095a54fdb7c8bde3bf21ba08..7d82ae8e38d366db9a50804b1dbd622c51e94c3c 100644 (file)
@@ -267,10 +267,10 @@ public final class PPTXMLDump {
         if(nl && length > 0)out.write(CR);
     }
 
-    private static final byte hexval[] =
-        {(byte) '0', (byte) '1', (byte) '2', (byte) '3',
-         (byte) '4', (byte) '5', (byte) '6', (byte) '7',
-         (byte) '8', (byte) '9', (byte) 'A', (byte) 'B',
-         (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F'};
+    private static final byte[] hexval =
+            {(byte) '0', (byte) '1', (byte) '2', (byte) '3',
+                    (byte) '4', (byte) '5', (byte) '6', (byte) '7',
+                    (byte) '8', (byte) '9', (byte) 'A', (byte) 'B',
+                    (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F'};
 
 }
index 6eee90f8576b6ff4411c534cb8a9114ea8f8844e..0d9664ba9730b2cd71416cb6ca8e20deba8eb386 100644 (file)
@@ -65,7 +65,7 @@ public final class SlideShowDumper {
    *  right now this function takes one parameter: a ppt file, and outputs
    *  a dump of what it contains
    */
-  public static void main(String args[]) throws IOException
+  public static void main(String[] args) throws IOException
   {
        if(args.length == 0) {
                System.err.println("Useage: SlideShowDumper [-escher|-basicescher] <filename>");
index cf7343a42f8db3e6a2c41501daeca9cf40b21017..e60d1e76919e5911752943a554a14dcc8f2becdc 100644 (file)
@@ -55,7 +55,7 @@ public final class SlideShowRecordDumper {
      * right now this function takes one parameter: a ppt file, and outputs a
      * dump of what it contains
      */
-    public static void main(String args[]) throws IOException {
+    public static void main(String[] args) throws IOException {
         String filename = "";
         boolean verbose = false;
         boolean escher = false;
index ffd3cc1083c14141be83be72f917b17571c2944b..17a7c1bdf7c80aca64b8c17217e8f777845b2375 100644 (file)
@@ -29,7 +29,7 @@ import org.apache.poi.sl.usermodel.PictureData.PictureType;
  * Utility to extract pictures from a PowerPoint file.
  */
 public final class ImageExtractor {
-    public static void main(String args[]) throws IOException {
+    public static void main(String[] args) throws IOException {
         if (args.length < 1) {
             System.err.println("Usage:");
             System.err.println("\tImageExtractor <file>");
index dc12c218eca77c90e03d8d8d53a44706b0047f9b..dc2ecc776a4e307ee324472f3ea7cb0fda26bab8 100644 (file)
@@ -55,7 +55,7 @@ public final class PowerPointExtractor extends POIOLE2TextExtractor {
        /**
         * Basic extractor. Returns all the text, and optionally all the notes
         */
-       public static void main(String args[]) throws IOException {
+       public static void main(String[] args) throws IOException {
                if (args.length < 1) {
                        System.err.println("Useage:");
                        System.err.println("\tPowerPointExtractor [-notes] <file>");
index dd810b26cc8bcce5b1a688b16c364a94923e90c4..d53f0db56c7185c61d371dd8df364a53259a9216 100644 (file)
@@ -61,7 +61,7 @@ public final class QuickButCruddyTextExtractor {
         * Really basic text extractor, that will also return lots of crud text.
         * Takes a single argument, the file to extract from
         */
-       public static void main(String args[]) throws IOException
+       public static void main(String[] args) throws IOException
        {
                if(args.length < 1) {
                        System.err.println("Useage:");
index 0b28c76f074f45f4c338bf177dcf479199b49627..741862b5f7e83bb54997bf34b2cde864a3751a21 100644 (file)
@@ -69,7 +69,7 @@ public class HSLFMetroShape<T extends Shape<?,?>> {
      */
     @SuppressWarnings("unchecked")
     public T getShape() {
-        byte metroBytes[] = getMetroBytes();
+        byte[] metroBytes = getMetroBytes();
         if (metroBytes == null) {
             return null;
         }
index 282b7791e9b6bf4ab9b2f7990ecdf88165c27c21..dca666903bcf715d29473407aee69c718f759dad 100644 (file)
@@ -55,7 +55,7 @@ public class HSLFTabStopPropCollection extends TextProp {
      * @param data the data stream
      * @param offset the offset within the data
      */
-    public void parseProperty(byte data[], int offset) {
+    public void parseProperty(byte[] data, int offset) {
         tabStops.addAll(readTabStops(new LittleEndianByteArrayInputStream(data, offset)));
     }
     
index 488893cd71ab0561d837b145618234bfe45a44f2..7637408326f37c2e77c802ebb6c66c03d53ff208 100644 (file)
@@ -112,7 +112,7 @@ public final class DocumentEncryptionAtom extends PositionDependentRecordAtom {
        public void writeOut(OutputStream out) throws IOException {
 
                // Data
-               byte data[] = new byte[1024];
+        byte[] data = new byte[1024];
                LittleEndianByteArrayOutputStream bos = new LittleEndianByteArrayOutputStream(data, 0);
                bos.writeShort(ei.getVersionMajor());
                bos.writeShort(ei.getVersionMinor());
index f6094950c025faef3e061d41c438644137326a9f..546caa7e444321b1004e743f4355c3c90efcda7b 100644 (file)
@@ -58,7 +58,7 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord {
     @Override
     public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) {
         int bytesRemaining = readHeader( data, offset );
-        byte remainingData[] = IOUtils.safelyAllocate(bytesRemaining, MAX_RECORD_LENGTH);
+        byte[] remainingData = IOUtils.safelyAllocate(bytesRemaining, MAX_RECORD_LENGTH);
         System.arraycopy(data, offset+8, remainingData, 0, bytesRemaining);
         setRemainingData(remainingData);
         return bytesRemaining + 8;
@@ -70,8 +70,8 @@ public class HSLFEscherClientDataRecord extends EscherClientDataRecord {
         
         LittleEndian.putShort(data, offset, getOptions());
         LittleEndian.putShort(data, offset+2, getRecordId());
-        
-        byte childBytes[] = getRemainingData();
+
+        byte[] childBytes = getRemainingData();
         
         LittleEndian.putInt(data, offset+4, childBytes.length);
         System.arraycopy(childBytes, 0, data, offset+8, childBytes.length);
index 22c5b2ad1fd03eac21fab796e2bbe0c3f1d28390..f2e7c05ce0f5a675c92870ba7ce5b3857e2ff45f 100644 (file)
@@ -189,7 +189,7 @@ public final class PersistPtrHolder extends PositionDependentRecordAtom
         
         @SuppressWarnings("resource")
         BufAccessBAOS bos = new BufAccessBAOS(); // NOSONAR
-        byte intbuf[] = new byte[4];
+        byte[] intbuf = new byte[4];
         int lastPersistEntry = -1;
         int lastSlideId = -1;
         for (Entry<Integer,Integer> me : orderedSlideLocations.entrySet()) {
index f13cd756adc5e7e0913da04fa08346dd24cd33cd..f07542ee069d4e83ad7bd72e17cb014bef721fd8 100644 (file)
@@ -201,8 +201,8 @@ public class SSSlideInfoAtom extends RecordAtom {
         out.write(_header);
         writeLittleEndian(_slideTime, out);
         writeLittleEndian(_soundIdRef, out);
-        
-        byte byteBuf[] = new byte[LittleEndianConsts.BYTE_SIZE];
+
+        byte[] byteBuf = new byte[LittleEndianConsts.BYTE_SIZE];
         LittleEndian.putUByte(byteBuf, 0, _effectDirection);
         out.write(byteBuf);
         LittleEndian.putUByte(byteBuf, 0, _effectType);
index 0c1fc32e0e8fd578e939440f358c4576c08d8d46..096e35c89b229072ceb9022e19a8ca1137604c84 100644 (file)
@@ -398,8 +398,8 @@ public final class StyleTextPropAtom extends RecordAtom {
         }
 
         out.append("  original byte stream \n");
-        
-        byte buf[] = IOUtils.safelyAllocate(rawContents.length+reserved.length, MAX_RECORD_LENGTH);
+
+        byte[] buf = IOUtils.safelyAllocate(rawContents.length + reserved.length, MAX_RECORD_LENGTH);
         System.arraycopy(rawContents, 0, buf, 0, rawContents.length);
         System.arraycopy(reserved, 0, buf, rawContents.length, reserved.length);
         out.append( HexDump.dump(buf, 0, 0) );
index c732f39c7bbf086f2c8f003cafe25929641d1dcd..d506f48282921f267ffb9460750df7aee4683b23 100644 (file)
@@ -135,7 +135,7 @@ public final class TextSpecInfoAtom extends RecordAtom {
         assert(size > 0);
         int covered = 0;
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
-        TextSpecInfoRun runs[] = getTextSpecInfoRuns();
+        TextSpecInfoRun[] runs = getTextSpecInfoRuns();
         assert(runs.length > 0);
         for (int i=0; i<runs.length && covered < size; i++) {
             TextSpecInfoRun run = runs[i];
index 2f47f71fcb9920cce587bb181bd1b24be12a48fe..3b35258ace8003d22c35bc5c614bfda648f1ea51 100644 (file)
@@ -173,18 +173,18 @@ public class TextSpecInfoRun {
      * @throws java.io.IOException if an error occurs.
      */
     public void writeOut(OutputStream out) throws IOException {
-        final byte buf[] = new byte[4];
+        final byte[] buf = new byte[4];
         LittleEndian.putInt(buf, 0, length);
         out.write(buf);
         LittleEndian.putInt(buf, 0, mask);
         out.write(buf);
-        Object flds[] = {
-            spellFld, spellInfo, "spell info",
-            langFld, langId, "lang id",
-            altLangFld, altLangId, "alt lang id",
-            bidiFld, bidi, "bidi",
-            pp10extFld, pp10extMask, "pp10 extension field",
-            smartTagFld, smartTagsBytes, "smart tags"
+        Object[] flds = {
+                spellFld, spellInfo, "spell info",
+                langFld, langId, "lang id",
+                altLangFld, altLangId, "alt lang id",
+                bidiFld, bidi, "bidi",
+                pp10extFld, pp10extMask, "pp10 extension field",
+                smartTagFld, smartTagsBytes, "smart tags"
         };
         
         for (int i=0; i<flds.length-1; i+=3) {
@@ -193,7 +193,7 @@ public class TextSpecInfoRun {
             if (!fld.isSet(mask)) continue;
             boolean valid;
             if (valO instanceof byte[]) {
-                byte bufB[] = (byte[])valO;
+                byte[] bufB = (byte[]) valO;
                 valid = bufB.length > 0;
                 out.write(bufB);
             } else if (valO instanceof Integer) {
index f1f2c224060164fb8c1052b2eadba56f6d393673..c10daef5e91c47e9916da757bb0fe23a8d9588a2 100644 (file)
@@ -382,8 +382,8 @@ public abstract class HSLFShape implements Shape<HSLFShape,HSLFTextParagraph> {
         boolean fSystemRGB = ecr.hasSystemRGBFlag();
         boolean fSchemeIndex = ecr.hasSchemeIndexFlag();
         boolean fSysIndex = ecr.hasSysIndexFlag();
-        
-        int rgb[] = ecr.getRGB();
+
+        int[] rgb = ecr.getRGB();
 
         HSLFSheet sheet = getSheet();
         if (fSchemeIndex && sheet != null) {
index 2f0a116d6836fd53edfd491323473f97342919f0..de90334840196215286a983d58db542cc782b4cd 100644 (file)
@@ -1020,7 +1020,7 @@ public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagrap
                ExEmbed exEmbed = new ExEmbed();
         // remove unneccessary infos, so we don't need to specify the type
         // of the ole object multiple times
-        Record children[] = exEmbed.getChildRecords();
+        Record[] children = exEmbed.getChildRecords();
         exEmbed.removeChild(children[2]);
         exEmbed.removeChild(children[3]);
         exEmbed.removeChild(children[4]);
index eb9526469415863ff9e670569fc0bcd48e82bdf3..63977ccc23c7bee885c07a85e3473e9737dd992f 100644 (file)
@@ -60,18 +60,18 @@ public class HSLFSlideShowEncrypted implements Closeable {
 
     private static final BitField fieldRecInst = new BitField(0xFFF0);
 
-    private static final int BLIB_STORE_ENTRY_PARTS[] = {
-        1,     // btWin32
-        1,     // btMacOS
-        16,    // rgbUid
-        2,     // tag
-        4,     // size
-        4,     // cRef
-        4,     // foDelay
-        1,     // unused1
-        1,     // cbName (@ index 33)
-        1,     // unused2
-        1,     // unused3
+    private static final int[] BLIB_STORE_ENTRY_PARTS = {
+            1,     // btWin32
+            1,     // btMacOS
+            16,    // rgbUid
+            2,     // tag
+            4,     // size
+            4,     // cRef
+            4,     // foDelay
+            1,     // unused1
+            1,     // cbName (@ index 33)
+            1,     // unused2
+            1,     // unused3
     };
     
     protected HSLFSlideShowEncrypted(DocumentEncryptionAtom dea) {
@@ -359,7 +359,7 @@ public class HSLFSlideShowEncrypted implements Closeable {
         }
     }
 
-    protected Record[] updateEncryptionRecord(Record records[]) {
+    protected Record[] updateEncryptionRecord(Record[] records) {
         String password = Biff8EncryptionKey.getCurrentUserPassword();
         if (password == null) {
             if (dea == null) {
@@ -376,12 +376,12 @@ public class HSLFSlideShowEncrypted implements Closeable {
                 dea = new DocumentEncryptionAtom();
             }
             EncryptionInfo ei = dea.getEncryptionInfo();
-            byte salt[] = ei.getVerifier().getSalt();
+            byte[] salt = ei.getVerifier().getSalt();
             Encryptor enc = getEncryptionInfo().getEncryptor();
             if (salt == null) {
                 enc.confirmPassword(password);
             } else {
-                byte verifier[] = ei.getDecryptor().getVerifier();
+                byte[] verifier = ei.getDecryptor().getVerifier();
                 enc.confirmPassword(password, null, null, verifier, salt, null);
             }
 
@@ -396,7 +396,7 @@ public class HSLFSlideShowEncrypted implements Closeable {
      * Before this method is called, make sure that the offsets are correct,
      * i.e. call {@link HSLFSlideShowImpl#updateAndWriteDependantRecords(OutputStream, Map)}
      */
-    protected static Record[] normalizeRecords(Record records[]) {
+    protected static Record[] normalizeRecords(Record[] records) {
         // http://msdn.microsoft.com/en-us/library/office/gg615594(v=office.14).aspx
         // repeated slideIds can be overwritten, i.e. ignored
 
@@ -456,7 +456,7 @@ public class HSLFSlideShowEncrypted implements Closeable {
     }
 
 
-    protected static Record[] removeEncryptionRecord(Record records[]) {
+    protected static Record[] removeEncryptionRecord(Record[] records) {
         int deaSlideId = -1;
         int deaOffset = -1;
         PersistPtrHolder ptr = null;
@@ -502,7 +502,7 @@ public class HSLFSlideShowEncrypted implements Closeable {
     }
 
 
-    protected static Record[] addEncryptionRecord(Record records[], DocumentEncryptionAtom dea) {
+    protected static Record[] addEncryptionRecord(Record[] records, DocumentEncryptionAtom dea) {
         assert(dea != null);
         int ueaIdx = -1, ptrIdx = -1, deaIdx = -1, idx = -1;
         for (Record r : records) {
@@ -530,7 +530,7 @@ public class HSLFSlideShowEncrypted implements Closeable {
             uea.setEncryptSessionPersistIdRef(nextSlideId);
             uea.setMaxPersistWritten(nextSlideId);
 
-            Record newRecords[] = new Record[records.length+1];
+            Record[] newRecords = new Record[records.length + 1];
             if (ptrIdx > 0) {
                 System.arraycopy(records, 0, newRecords, 0, ptrIdx);
             }
index e9df925d0abca98bf97ecc72015b29de5a0b3856..627100203710cb1e829194200055fe2d0784d7a8 100644 (file)
@@ -157,7 +157,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> {
         super.afterInsert(sh);
 
         Set<HSLFLine> lineSet = new HashSet<>();
-        for (HSLFTableCell row[] : cells) {
+        for (HSLFTableCell[] row : cells) {
             for (HSLFTableCell c : row) {
                 addShape(c);
                 for (HSLFLine bt : new HSLFLine[]{ c.borderTop, c.borderRight, c.borderBottom, c.borderLeft }) {
@@ -343,7 +343,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> {
         if (cells == null) {
             initTable();
         } else {
-            for (HSLFTableCell cols[] : cells) {
+            for (HSLFTableCell[] cols : cells) {
                 for (HSLFTableCell col : cols) {
                     col.setSheet(sheet);
                 }
@@ -412,7 +412,7 @@ implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph> {
         }
         double currentWidth = cells[0][col].getAnchor().getWidth();
         double dx = width - currentWidth;
-        for (HSLFTableCell cols[] : cells) {
+        for (HSLFTableCell[] cols : cells) {
             Rectangle2D anchor = cols[col].getAnchor();
             anchor.setRect(anchor.getX(), anchor.getY(), width, anchor.getHeight());
             cols[col].setAnchor(anchor);
index 5b9bdfa5bcedf7dd57fc3f68b77a545dbe6b253d..e6a271da634691ec094d56d0775d788a41010f94 100644 (file)
@@ -284,7 +284,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText
      * @return text run records
      */
     public Record[] getRecords() {
-        Record r[] = _headerAtom.getParentRecord().getChildRecords();
+        Record[] r = _headerAtom.getParentRecord().getChildRecords();
         return getRecords(r, new int[] { 0 }, _headerAtom);
     }
 
@@ -313,7 +313,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText
             }
         }
 
-        Record result[] = new Record[length];
+        Record[] result = new Record[length];
         System.arraycopy(records, startIdx[0], result, 0, length);
         startIdx[0] += length;
 
@@ -812,7 +812,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText
      * are queried
      */
     protected <T extends TextProp> T getPropVal(TextPropCollection props, String propName) {
-        String propNames[] = propName.split(",");
+        String[] propNames = propName.split(",");
         for (String pn : propNames) {
             T prop = props.findByName(pn);
             if (isValidProp(prop)) {
@@ -835,7 +835,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText
             }
         }
 
-        final String propNames[] = propName.split(",");
+        final String[] propNames = propName.split(",");
         final HSLFSheet sheet = getSheet();
         final int txtype = getRunType();
         final HSLFMasterSheet master;
index 412bc1ff49044559ee7ecc4904af5a7b5814f2f7..f617955d101ab680a573d79b399030752b3e6751 100644 (file)
@@ -238,7 +238,7 @@ implements TextShape<HSLFShape,HSLFTextParagraph> {
         if (sheet != null) {
             PPDrawing drawing = sheet.getPPDrawing();
             if (drawing != null) {
-                EscherTextboxWrapper wrappers[] = drawing.getTextboxWrappers();
+                EscherTextboxWrapper[] wrappers = drawing.getTextboxWrappers();
                 if (wrappers != null) {
                     for (EscherTextboxWrapper w : wrappers) {
                         // check for object identity
index 2f9811fc63779fe90e2e4272bfa3a7628e66802f..05f5d200be11fe3cd0f07e3eeadc0cd4bb4f3459 100644 (file)
@@ -155,7 +155,7 @@ public class HwmfGraphics {
         int cap = ps.getLineCap().awtFlag;
         int join = ps.getLineJoin().awtFlag;
         float miterLimit = (float)getProperties().getPenMiterLimit();
-        float dashes[] = ps.getLineDashes();
+        float[] dashes = ps.getLineDashes();
         boolean dashAlt = ps.isAlternateDash();
         // This value is not an integer index into the dash pattern array.
         // Instead, it is a floating-point value that specifies a linear distance.
index a800bb0e0500684b3271fcf6352760026900f767..1632525d8e49ee2cf0e776d9ccb72c86623153c0 100644 (file)
@@ -215,13 +215,13 @@ public class HwmfBitmapDib {
     private long headerColorUsed = -1;
     @SuppressWarnings("unused")
     private long headerColorImportant = -1;
-    private Color colorTable[];
+    private Color[] colorTable;
     @SuppressWarnings("unused")
     private int colorMaskR,colorMaskG,colorMaskB;
 
     // size of header and color table, for start of image data calculation
     private int introSize;
-    private byte imageData[];
+    private byte[] imageData;
 
     public int init(LittleEndianInputStream leis, int recordSize) throws IOException {
         leis.mark(10000);
@@ -442,7 +442,7 @@ public class HwmfBitmapDib {
         int imageSize = (int)Math.max(imageData.length, introSize+headerImageSize);
         
         // create the image data and leave the parsing to the ImageIO api
-        byte buf[] = IOUtils.safelyAllocate(BMP_HEADER_SIZE+imageSize, MAX_RECORD_LENGTH);
+        byte[] buf = IOUtils.safelyAllocate(BMP_HEADER_SIZE + imageSize, MAX_RECORD_LENGTH);
 
         // https://en.wikipedia.org/wiki/BMP_file_format #  Bitmap file header
         buf[0] = (byte)'B';
index a1de4dca4616d47082f7259a946ab75f8432ce91..0d00934530e12959471245ed4aa178c42376b914 100644 (file)
@@ -182,7 +182,7 @@ public class HwmfEscape implements HwmfRecord {
     /**
      * An array of bytes of size ByteCount.
      */
-    private byte escapeData[];
+    private byte[] escapeData;
     
     @Override
     public HwmfRecordType getWmfRecordType() {
index 4413983ef31887efb25836c8d49bd351e13aef8a..621fa6a095f4ba8dbc56bf4006235e56387b2ffe 100644 (file)
@@ -502,7 +502,9 @@ public class HwmfFont implements FontInfo {
     }
 
     protected int readString(LittleEndianInputStream leis, StringBuilder sb, int limit) throws IOException {
-        byte buf[] = new byte[limit], b, readBytes = 0;
+        byte[] buf = new byte[limit];
+        byte b;
+        byte readBytes = 0;
         do {
             if (readBytes == limit) {
                 return -1;
index 4ae792293f6599bc3b04e447a9e091c81c4b7b57..69afe0b44fc5bd0b631ac21352f02c6d95d0b0e9 100644 (file)
@@ -357,7 +357,7 @@ public enum HwmfTernaryRasterOp {
     }
 
     public String describeCmd() {
-        String stack[] = new String[10];
+        String[] stack = new String[10];
         int stackPnt = 0;
 
         for (char c : opCmd.toCharArray()) {
index 391215d65763c41fc0c60b1d64e79c5ddac71439..061f5cfc66067e2d0db7fb67e3cad814b49e3f89 100644 (file)
@@ -330,9 +330,9 @@ public class HwmfText {
          */
         protected byte[] rawTextBytes;
         /**
-         * An optional array of 16-bit signed integers that indicate the distance between 
-         * origins of adjacent character cells. For example, Dx[i] logical units separate the origins of 
-         * character cell i and character cell i + 1. If this field is present, there MUST be the same 
+         * An optional array of 16-bit signed integers that indicate the distance between
+         * origins of adjacent character cells. For example, Dx[i] logical units separate the origins of
+         * character cell i and character cell i + 1. If this field is present, there MUST be the same
          * number of values as there are characters in the string.
          */
         protected final List<Integer> dx = new ArrayList<>();
@@ -442,7 +442,7 @@ public class HwmfText {
      * The META_SETTEXTALIGN record defines text-alignment values in the playback device context.
      */
     public static class WmfSetTextAlign implements HwmfRecord {
-        
+
         /**
          * The drawing position in the playback device context MUST be updated after each text
          * output call. It MUST be used as the reference point.<p>
index bbf5b9eb157e1bdfdb098614807a99190610f22d..8759a5c7e64d0ccd3de66229d62e237b552da9a1 100644 (file)
@@ -529,12 +529,12 @@ public class HwmfWindowing {
          * A 16-bit unsigned integer that defines the horizontal (x-axis) coordinate,
          * in logical units, of the left endpoint of the scanline.
          */
-        private int left_scanline[];
+        private int[] left_scanline;
         /**
          * A 16-bit unsigned integer that defines the horizontal (x-axis) coordinate,
          * in logical units, of the right endpoint of the scanline.
          */
-        private int right_scanline[];
+        private int[] right_scanline;
         /**
          * A 16-bit unsigned integer that MUST be the same as the value of the Count
          * field; it is present to allow upward travel in the structure.
@@ -591,7 +591,7 @@ public class HwmfWindowing {
         /**
          * An array of Scan objects that define the scanlines in the region.
          */
-        private WmfScanObject scanObjects[];
+        private WmfScanObject[] scanObjects;
 
         @Override
         public HwmfRecordType getWmfRecordType() {
index e7f45c9671e34e97af79027cde7a38fa851a276e..a9555de6b7418a35750269546a63f57c0c95cbc8 100644 (file)
@@ -640,7 +640,7 @@ public final class HWPFDocument extends HWPFDocumentCore {
         updateEncryptionInfo();
         EncryptionInfo ei = getEncryptionInfo();
         if (ei != null) {
-            byte buf[] = new byte[1000];
+            byte[] buf = new byte[1000];
             LittleEndianByteArrayOutputStream leos = new LittleEndianByteArrayOutputStream(buf, 0);
             leos.writeShort(ei.getVersionMajor());
             leos.writeShort(ei.getVersionMinor());
index 1375a4bf5416b21e0efaa3230fb66338ec8642c6..a94730ddb3a139de16f7948dbbb02b643ee88441 100644 (file)
@@ -299,11 +299,11 @@ public abstract class HWPFDocumentCore extends POIDocument {
                 fBase.setFObfuscated(false);
             }
             Encryptor enc = _encryptionInfo.getEncryptor();
-            byte salt[] = _encryptionInfo.getVerifier().getSalt();
+            byte[] salt = _encryptionInfo.getVerifier().getSalt();
             if (salt == null) {
                 enc.confirmPassword(password);
             } else {
-                byte verifier[] = _encryptionInfo.getDecryptor().getVerifier();
+                byte[] verifier = _encryptionInfo.getDecryptor().getVerifier();
                 enc.confirmPassword(password, null, null, verifier, salt, null);
             }
         }
@@ -336,7 +336,7 @@ public abstract class HWPFDocumentCore extends POIDocument {
                     is = dec.getDataStream(dis, streamSize, 0);
                     if (encryptionOffset > 0) {
                         ChunkedCipherInputStream cis = (ChunkedCipherInputStream)is;
-                        byte plain[] = IOUtils.safelyAllocate(encryptionOffset, MAX_RECORD_LENGTH);
+                        byte[] plain = IOUtils.safelyAllocate(encryptionOffset, MAX_RECORD_LENGTH);
                         cis.readPlain(plain, 0, encryptionOffset);
                         bos.write(plain);
                     }
index ec7ed1ca9dbc41c64f36136c77b0f0ca7a7b2505..4a69de63c5d3e2f2d237481ba782d5c1ba01a35c 100644 (file)
@@ -70,7 +70,7 @@ public final class NumberFormatter {
         int num = number;
         final int radix = 26;
 
-        char buf[] = new char[33];
+        char[] buf = new char[33];
         int charPos = buf.length;
 
         while (num > 0) {
index 5a557ef84c9ea5a79b8023ef5a1bc39693b3876f..990e1b22b8f2eeea229015f503e040bd90d86c60 100644 (file)
@@ -114,7 +114,7 @@ public final class SprmOperation
 
             return LittleEndian.getInt( codeBytes, 0 );
         case 7:
-            byte threeByteInt[] = new byte[4];
+            byte[] threeByteInt = new byte[4];
             threeByteInt[0] = _grpprl[_gOffset];
             threeByteInt[1] = _grpprl[_gOffset + 1];
             threeByteInt[2] = _grpprl[_gOffset + 2];
index 16f40a72f7da631851c0473fbdb3a59d42643e41..6236f32323adc91ee30a080571cf73613a4901de 100644 (file)
@@ -57,8 +57,8 @@ public final class TestOleEmbedding {
         // Placeholder EMFs for clients that don't support the OLE components.
         List<HSLFPictureData> pictures = slideShow.getPictureData();
         assertEquals("Should be two pictures", 2, pictures.size());
-        
-        long checkSums[] = { 0xD37A4204l, 0x26A62F68l, 0x82853169l, 0xE0E45D2Bl };
+
+        long[] checkSums = {0xD37A4204l, 0x26A62F68l, 0x82853169l, 0xE0E45D2Bl};
         int checkId = 0;
         
         // check for checksum to be uptodate
@@ -154,11 +154,11 @@ public final class TestOleEmbedding {
        
        ppt = new HSLFSlideShow(new ByteArrayInputStream(bos.toByteArray()));
        HSLFObjectShape comp = (HSLFObjectShape)ppt.getSlides().get(0).getShapes().get(0);
-       byte compData[] = IOUtils.toByteArray(comp.getObjectData().getInputStream());
+        byte[] compData = IOUtils.toByteArray(comp.getObjectData().getInputStream());
        
        bos.reset();
        poiData1.writeFilesystem(bos);
-       byte expData[] = bos.toByteArray();
+        byte[] expData = bos.toByteArray();
        
        assertArrayEquals(expData, compData);
        
index db56e0e775e4c7d9f266f75e4cbe6d0e74139108..e03bded11df635504c4a02b3e3149b8d2d880d62 100644 (file)
@@ -259,7 +259,7 @@ public final class TestSlideMaster {
                 assertEquals(true, rt.isUnderlined());
                 assertEquals("Arial", rt.getFontFamily());
             } else if (tpara.getRunType() == TextHeaderAtom.BODY_TYPE){
-                int indents[] = { 32, 28, 24 };
+                int[] indents = {32, 28, 24};
                 for (HSLFTextRun rt : tpara.getTextRuns()) {
                     int indent = tpara.getIndentLevel();
                     assertEquals(indents[indent], rt.getFontSize(), 0);
index fdba39d08c1a994e846b7f5c9937eb5311de9e76..49ac6d39f4d953d8c0322b53494adedc11eb5c0c 100644 (file)
@@ -58,10 +58,10 @@ public class TestDocumentEncryption {
 
     @Test
     public void cryptoAPIDecryptionOther() throws Exception {
-        String encPpts[] = {
-            "Password_Protected-56-hello.ppt",
-            "Password_Protected-hello.ppt",
-            "Password_Protected-np-hello.ppt",
+        String[] encPpts = {
+                "Password_Protected-56-hello.ppt",
+                "Password_Protected-hello.ppt",
+                "Password_Protected-np-hello.ppt",
         };
 
         Biff8EncryptionKey.setCurrentUserPassword("hello");
@@ -156,7 +156,7 @@ public class TestDocumentEncryption {
             String rawText = HSLFTextParagraph.getRawText(slide.getTextParagraphs().get(0));
             assertEquals("Dominic Salemno", rawText);
 
-            String picCmp[][] = {
+            String[][] picCmp = {
                     {"0", "nKsDTKqxTCR8LFkVVWlP9GSTvZ0="},
                     {"95163", "SuNOR+9V1UVYZIoeD65l3VTaLoc="},
                     {"100864", "Ql3IGrr4bNq07ZTp5iPg7b+pva8="},
@@ -170,7 +170,7 @@ public class TestDocumentEncryption {
             List<HSLFPictureData> pd = ss.getSlideShowImpl().getPictureData();
             int i = 0;
             for (HSLFPictureData p : pd) {
-                byte hash[] = md.digest(p.getData());
+                byte[] hash = md.digest(p.getData());
                 assertEquals(Integer.parseInt(picCmp[i][0]), p.getOffset());
                 assertEquals(picCmp[i][1], Base64.encodeBase64String(hash));
                 i++;
index 533d250a9255bb1ade92f37698337289b147d468..0927d37edd396945f8d2c1d4e60a7a5022911d35 100644 (file)
@@ -669,7 +669,7 @@ public final class TestStyleTextPropAtom {
     @Test
     public void testLoadWriteC() {
         // BitMaskTextProperties will sanitize the output
-        byte expected[] = data_c.clone();
+        byte[] expected = data_c.clone();
         expected[56] = 0;
         expected[68] = 0;
         doReadWrite(data_c, expected, data_c_text_len);
index 9da61bd13ead07883527add757bf14964a79f469..3cf0c9a100aa1648d830a2712081d423717c3c88 100644 (file)
@@ -601,18 +601,18 @@ public final class TestBugs {
         HSLFAutoShape as = (HSLFAutoShape)ppt.getSlides().get(0).getShapes().get(0);
         AbstractEscherOptRecord opt = as.getEscherOptRecord();
         EscherArrayProperty ep = HSLFShape.getEscherProperty(opt, EscherProperties.FILL__SHADECOLORS);
-        double exp[][] = {
-            // r, g, b, position
-            { 94, 158, 255, 0 },
-            { 133, 194, 255, 0.399994 },
-            { 196, 214, 235, 0.699997 },
-            { 255, 235, 250, 1 }
+        double[][] exp = {
+                // r, g, b, position
+                {94, 158, 255, 0},
+                {133, 194, 255, 0.399994},
+                {196, 214, 235, 0.699997},
+                {255, 235, 250, 1}
         };
 
         int i = 0;
-        for (byte data[] : ep) {
+        for (byte[] data : ep) {
             EscherColorRef ecr = new EscherColorRef(data, 0, 4);
-            int rgb[] = ecr.getRGB();
+            int[] rgb = ecr.getRGB();
             double pos = Units.fixedPointToDouble(LittleEndian.getInt(data, 4));
             assertEquals((int)exp[i][0], rgb[0]);
             assertEquals((int)exp[i][1], rgb[1]);
@@ -796,7 +796,7 @@ public final class TestBugs {
 
     @Test
     public void bug58718() throws IOException {
-        String files[] = { "bug58718_008524.ppt","bug58718_008558.ppt","bug58718_349008.ppt","bug58718_008495.ppt",  }; 
+        String[] files = {"bug58718_008524.ppt", "bug58718_008558.ppt", "bug58718_349008.ppt", "bug58718_008495.ppt",};
         for (String f : files) {
             File sample = HSLFTestDataSamples.getSampleFile(f);
             try (SlideShowExtractor ex = new SlideShowExtractor(SlideShowFactory.create(sample))) {
@@ -877,8 +877,8 @@ public final class TestBugs {
             @Override
             public void write(int b) throws IOException {}
         };
-        
-        final boolean found[] = { false }; 
+
+        final boolean[] found = {false};
         DummyGraphics2d dgfx = new DummyGraphics2d(new PrintStream(nullOutput)){
             @Override
             public void drawString(AttributedCharacterIterator iterator, float x, float y) {
index 99c40c3f79c7a8be33863b7cfc4f705c47258cbb..c6ac218b5f219565eb1408516d8ba7a055699a9f 100644 (file)
@@ -56,13 +56,13 @@ public class TestFontRendering {
     public void bug55902mixedFontWithChineseCharacters() throws IOException, FontFormatException {
         // font files need to be downloaded first via
         // ant test-scratchpad-download-resources
-        String fontFiles[][] = {
-            // Calibri is not available on *nix systems, so we need to use another similar free font
-            { "build/scratchpad-test-resources/Cabin-Regular.ttf", "mapped", "Calibri" },
+        String[][] fontFiles = {
+                // Calibri is not available on *nix systems, so we need to use another similar free font
+                {"build/scratchpad-test-resources/Cabin-Regular.ttf", "mapped", "Calibri"},
 
-            // use "MS PGothic" if available (Windows only) ...
-            // for the junit test not all chars are rendered
-            { "build/scratchpad-test-resources/mona.ttf", "fallback", "Cabin" }
+                // use "MS PGothic" if available (Windows only) ...
+                // for the junit test not all chars are rendered
+                {"build/scratchpad-test-resources/mona.ttf", "fallback", "Cabin"}
         };
         
         // setup fonts (especially needed, when run under *nix systems)
@@ -70,7 +70,7 @@ public class TestFontRendering {
         Map<String,String> fontMap = new HashMap<>();
         Map<String,String> fallbackMap = new HashMap<>();
         
-        for (String fontFile[] : fontFiles) {
+        for (String[] fontFile : fontFiles) {
             File f = new File(fontFile[0]);
             assumeTrue("necessary font file "+f.getName()+" not downloaded.", f.exists());
             
index d071f2dbdc949756fab75a5666b8603f0bbfb0c0..0d9470647f889d22ef42c170f43677ae47106ed2 100644 (file)
@@ -173,12 +173,12 @@ public final class TestPicture {
     @Ignore("Just for visual validation - antialiasing is different on various systems")
     public void bug54541()
     throws IOException, ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
-        String files[] = {
+        String[] files = {
 //            "sample_pptx_grouping_issues.pptx",
 //            "54542_cropped_bitmap.pptx",
 //            "54541_cropped_bitmap.ppt",
 //            "54541_cropped_bitmap2.ppt",
-            "alterman_security.ppt",
+                "alterman_security.ppt",
 //            "alterman_security3.pptx",
         };
         
index 9a48cb3b0aef9b798173814fba2a2f79e88c88bd..12066f99d446ad38352c5f2f799846a75a988a7b 100644 (file)
@@ -453,8 +453,8 @@ public final class TestTextRun {
                assertEquals("sdfsdfsdf", rt.get(0).getRawText());
 
                textParas = textParass.get(1);
-               String texts[] = {"Sdfsdfsdf\r","Dfgdfg\r","Dfgdfgdfg\r","Sdfsdfs\r","Sdfsdf\r"};
-               int indents[] = {0,0,0,1,1};
+        String[] texts = {"Sdfsdfsdf\r", "Dfgdfg\r", "Dfgdfgdfg\r", "Sdfsdfs\r", "Sdfsdf\r"};
+        int[] indents = {0, 0, 0, 1, 1};
                int i=0;
                for (HSLFTextParagraph p : textParas) {
                    assertEquals(texts[i], p.getTextRuns().get(0).getRawText());
@@ -563,7 +563,7 @@ public final class TestTextRun {
         HSLFSlideShow ppt = HSLFTestDataSamples.getSlideShow("52244.ppt");
         HSLFSlide slide = ppt.getSlides().get(0);
 
-        int sizes[] = { 36, 24, 12, 32, 12, 12 };
+        int[] sizes = {36, 24, 12, 32, 12, 12};
         
         int i=0;
         for (List<HSLFTextParagraph> textParas : slide.getTextParagraphs()) {
index df084cdad3e22bffa82eb324d343ed32e2bad7a2..4a988250fef4c16cc355992cabcd7d0ea3ae6c49 100644 (file)
@@ -132,7 +132,7 @@ public class TestHwmfParsing {
                     if (pd.getType() != PictureType.WMF) {
                         continue;
                     }
-                    byte wmfData[] = pd.getData();
+                    byte[] wmfData = pd.getData();
                     String filename = String.format(Locale.ROOT, "%s-%04d.wmf", basename, wmfIdx);
                     FileOutputStream fos = new FileOutputStream(new File(outdir, filename));
                     fos.write(wmfData);
@@ -156,8 +156,9 @@ public class TestHwmfParsing {
         File outdir = new File("build/wmf");
         outdir.mkdirs();
         final String startFile = "";
-        File files[] = indir.listFiles(new FileFilter() {
+        File[] files = indir.listFiles(new FileFilter() {
             boolean foundStartFile;
+
             @Override
             public boolean accept(File pathname) {
                 foundStartFile |= startFile.isEmpty() || pathname.getName().contains(startFile);
index 7f8b4d3ed736048a483090cc16952d5a24ec6826..62091518761d8cffe49903709e580e27b2197932 100644 (file)
@@ -35,30 +35,30 @@ import org.junit.Test;
  */
 public class TestFieldsTables extends HWPFTestCase {
 
-    private static final String EXPECTED[] = {
-        "[19, 43) - FLD - 0x13; 0x1f\n" + "[43, 54) - FLD - 0x14; 0xff\n"
-        + "[54, 59) - FLD - 0x15; 0x81\n",
+    private static final String[] EXPECTED = {
+            "[19, 43) - FLD - 0x13; 0x1f\n" + "[43, 54) - FLD - 0x14; 0xff\n"
+                    + "[54, 59) - FLD - 0x15; 0x81\n",
 
-        "[31, 59) - FLD - 0x13; 0x45\n" + "[59, 61) - FLD - 0x14; 0xff\n"
-        + "[61, 66) - FLD - 0x15; 0x80\n",
+            "[31, 59) - FLD - 0x13; 0x45\n" + "[59, 61) - FLD - 0x14; 0xff\n"
+                    + "[61, 66) - FLD - 0x15; 0x80\n",
 
-        "[23, 49) - FLD - 0x13; 0x11\n" + "[49, 64) - FLD - 0x14; 0xff\n"
-        + "[64, 69) - FLD - 0x15; 0x80\n",
+            "[23, 49) - FLD - 0x13; 0x11\n" + "[49, 64) - FLD - 0x14; 0xff\n"
+                    + "[64, 69) - FLD - 0x15; 0x80\n",
 
-        "[18, 42) - FLD - 0x13; 0x21\n" + "[42, 44) - FLD - 0x14; 0xff\n"
-        + "[44, 47) - FLD - 0x15; 0x81\n"
-        + "[47, 75) - FLD - 0x13; 0x1d\n"
-        + "[75, 85) - FLD - 0x14; 0xff\n"
-        + "[85, 91) - FLD - 0x15; 0x81\n",
+            "[18, 42) - FLD - 0x13; 0x21\n" + "[42, 44) - FLD - 0x14; 0xff\n"
+                    + "[44, 47) - FLD - 0x15; 0x81\n"
+                    + "[47, 75) - FLD - 0x13; 0x1d\n"
+                    + "[75, 85) - FLD - 0x14; 0xff\n"
+                    + "[85, 91) - FLD - 0x15; 0x81\n",
 
-        "[30, 54) - FLD - 0x13; 0x20\n" + "[54, 62) - FLD - 0x14; 0xff\n"
-        + "[62, 68) - FLD - 0x15; 0x81\n",
+            "[30, 54) - FLD - 0x13; 0x20\n" + "[54, 62) - FLD - 0x14; 0xff\n"
+                    + "[62, 68) - FLD - 0x15; 0x81\n",
 
-        "[1, 31) - FLD - 0x13; 0x15\n" + "[31, 51) - FLD - 0x14; 0xff\n"
-        + "[51, 541) - FLD - 0x15; 0x81\n",
+            "[1, 31) - FLD - 0x13; 0x15\n" + "[31, 51) - FLD - 0x14; 0xff\n"
+                    + "[51, 541) - FLD - 0x15; 0x81\n",
 
-        "[19, 47) - FLD - 0x13; 0x19\n" + "[47, 49) - FLD - 0x14; 0xff\n"
-        + "[49, 55) - FLD - 0x15; 0x81\n"
+            "[19, 47) - FLD - 0x13; 0x19\n" + "[47, 49) - FLD - 0x14; 0xff\n"
+                    + "[49, 55) - FLD - 0x15; 0x81\n"
     };
 
     @Override
index ce8ba23c6e252f68477f291e76402f6f00018562..26ca734f77ef45c86e2f34039e1d0c31a248fcd0 100644 (file)
@@ -75,27 +75,27 @@ public class TestVariantSupport {
     public void newNumberTypes() throws Exception {
         ClipboardData cd = new ClipboardData();
         cd.setValue(new byte[10]);
-        
-        Object exp[][] = {
-            { Variant.VT_CF, cd.toByteArray() },
-            { Variant.VT_BOOL, true },
-            { Variant.VT_LPSTR, "codepagestring" },
-            { Variant.VT_LPWSTR, "widestring" },
-            { Variant.VT_I2, -1 }, // int, not short ... :(
-            { Variant.VT_UI2, 0xFFFF },
-            { Variant.VT_I4, -1 },
-            { Variant.VT_UI4, 0xFFFFFFFFL },
-            { Variant.VT_I8, -1L },
-            { Variant.VT_UI8, BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.TEN) },
-            { Variant.VT_R4, -999.99f },
-            { Variant.VT_R8, -999.99d },
+
+        Object[][] exp = {
+                {Variant.VT_CF, cd.toByteArray()},
+                {Variant.VT_BOOL, true},
+                {Variant.VT_LPSTR, "codepagestring"},
+                {Variant.VT_LPWSTR, "widestring"},
+                {Variant.VT_I2, -1}, // int, not short ... :(
+                {Variant.VT_UI2, 0xFFFF},
+                {Variant.VT_I4, -1},
+                {Variant.VT_UI4, 0xFFFFFFFFL},
+                {Variant.VT_I8, -1L},
+                {Variant.VT_UI8, BigInteger.valueOf(Long.MAX_VALUE).add(BigInteger.TEN)},
+                {Variant.VT_R4, -999.99f},
+                {Variant.VT_R8, -999.99d},
         };
         
         HSSFWorkbook wb = new HSSFWorkbook();
         POIFSFileSystem poifs = new POIFSFileSystem();
         DocumentSummaryInformation dsi = PropertySetFactory.newDocumentSummaryInformation();
         CustomProperties cpList = new CustomProperties();
-        for (Object o[] : exp) {
+        for (Object[] o : exp) {
             int type = (Integer)o[0];
             Property p = new Property(PropertyIDMap.PID_MAX+type, type, o[1]);
             cpList.put("testprop"+type, new CustomProperty(p, "testprop"+type));
@@ -110,7 +110,7 @@ public class TestVariantSupport {
         dsi = (DocumentSummaryInformation)PropertySetFactory.create(poifs.getRoot(), DocumentSummaryInformation.DEFAULT_STREAM_NAME);
         cpList = dsi.getCustomProperties();
         int i=0;
-        for (Object o[] : exp) {
+        for (Object[] o : exp) {
             Object obj = cpList.get("testprop"+o[0]);
             if (o[1] instanceof byte[]) {
                 assertArrayEquals("property "+i, (byte[])o[1], (byte[])obj);
index c1c585db4e7dd65d30cc335335334605445fadfd..b50d5298448acb3532df63041e40d01987c9b02a 100644 (file)
@@ -319,7 +319,7 @@ public final class TestUnicodeString {
 
     @Test
     public void extRstEqualsAndHashCode() {
-        byte buf[] = new byte[200];
+        byte[] buf = new byte[200];
         LittleEndianByteArrayOutputStream bos = new LittleEndianByteArrayOutputStream(buf, 0);
         String str = "\u1d02\u1d12\u1d22";
         bos.writeShort(1);
index 76095dc2319ab9eac93e7aff954fc3a3a05c33a4..bf79bcb0d77b64c3e73e2379c2287552a732083f 100644 (file)
@@ -55,7 +55,7 @@ public final class TestExtendedPivotTableViewFieldsRecord extends TestCase {
        public void testOlderFormat_bug46918() {
                // There are 10 SXVDEX records in the file (not uploaded) that originated bugzilla 46918
                // They all had the following hex encoding:
-               byte data[] = HexRead.readFromString("00 01 0A 00 1E 14 00 0A FF FF FF FF 00 00");  
+        byte[] data = HexRead.readFromString("00 01 0A 00 1E 14 00 0A FF FF FF FF 00 00");
 
                RecordInputStream in = TestcaseRecordInputStream.create(data);
                ExtendedPivotTableViewFieldsRecord rec;
@@ -68,8 +68,8 @@ public final class TestExtendedPivotTableViewFieldsRecord extends TestCase {
                        throw e;
                }
 
-               byte expReserData[] = HexRead.readFromString("1E 14 00 0A FF FF FF FF 00 00" +
-                               "FF FF 00 00 00 00 00 00 00 00");  
+        byte[] expReserData = HexRead.readFromString("1E 14 00 0A FF FF FF FF 00 00" +
+                "FF FF 00 00 00 00 00 00 00 00");
                
                TestcaseRecordInputStream.confirmRecordEncoding(ExtendedPivotTableViewFieldsRecord.sid, expReserData, rec.serialize());
        }
index 093d2083a8560363ea50919cd052cd23f7a90d0a..6275fc0d0219b781928ad066e06b804e33ea4020 100644 (file)
@@ -429,7 +429,7 @@ public class DummyGraphics2d extends Graphics2D {
         g2D.drawArc( x, y, width, height, startAngle, arcAngle );
     }
 
-    public void drawBytes(byte data[], int offset, int length, int x, int y) {
+    public void drawBytes(byte[] data, int offset, int length, int x, int y) {
         String l =
             "drawBytes(byte[],int,int,int,int):" +
             "\n  data = " + Arrays.toString(data) +
@@ -441,7 +441,7 @@ public class DummyGraphics2d extends Graphics2D {
         g2D.drawBytes( data, offset, length, x, y );
     }
 
-    public void drawChars(char data[], int offset, int length, int x, int y) {
+    public void drawChars(char[] data, int offset, int length, int x, int y) {
         String l =
             "drawChars(data,int,int,int,int):" +
             "\n  data = " + Arrays.toString(data) +
@@ -568,7 +568,7 @@ public class DummyGraphics2d extends Graphics2D {
         g2D.drawPolygon( p );
     }
 
-    public void drawPolygon(int xPoints[], int yPoints[], int nPoints) {
+    public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
         String l =
             "drawPolygon(int[],int[],int):" +
             "\n  xPoints = " + Arrays.toString(xPoints) +
@@ -578,7 +578,7 @@ public class DummyGraphics2d extends Graphics2D {
         g2D.drawPolygon( xPoints, yPoints, nPoints );
     }
 
-    public void drawPolyline(int xPoints[], int yPoints[], int nPoints) {
+    public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
         String l =
             "drawPolyline(int[],int[],int):" +
             "\n  xPoints = " + Arrays.toString(xPoints) +
@@ -676,7 +676,7 @@ public class DummyGraphics2d extends Graphics2D {
         g2D.fillPolygon( p );
     }
 
-    public void fillPolygon(int xPoints[], int yPoints[], int nPoints) {
+    public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
         String l =
             "fillPolygon(int[],int[],int):" +
             "\n  xPoints = " + Arrays.toString(xPoints) +
index 09387f5f7c2924ff3ff69a30b8ec7238bad33a9e..21e47f8a56b3287ae580ea6a0cef3d43d17345d1 100644 (file)
@@ -247,11 +247,11 @@ public final class TestHSSFPicture extends BaseTestPicture {
        // test if inserted EscherMetafileBlip will be read again
         HSSFWorkbook wb = new HSSFWorkbook();
 
-        byte pictureDataEmf[] = POIDataSamples.getDocumentInstance().readFile("vector_image.emf");
+        byte[] pictureDataEmf = POIDataSamples.getDocumentInstance().readFile("vector_image.emf");
         int indexEmf = wb.addPicture(pictureDataEmf, HSSFWorkbook.PICTURE_TYPE_EMF);
-        byte pictureDataPng[] = POIDataSamples.getSpreadSheetInstance().readFile("logoKarmokar4.png");
+        byte[] pictureDataPng = POIDataSamples.getSpreadSheetInstance().readFile("logoKarmokar4.png");
         int indexPng = wb.addPicture(pictureDataPng, HSSFWorkbook.PICTURE_TYPE_PNG);
-        byte pictureDataWmf[] = POIDataSamples.getSlideShowInstance().readFile("santa.wmf");
+        byte[] pictureDataWmf = POIDataSamples.getSlideShowInstance().readFile("santa.wmf");
         int indexWmf = wb.addPicture(pictureDataWmf, HSSFWorkbook.PICTURE_TYPE_WMF);
 
         HSSFSheet sheet = wb.createSheet();
@@ -281,10 +281,10 @@ public final class TestHSSFPicture extends BaseTestPicture {
         
         
         wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
-        byte pictureDataOut[] = wb.getAllPictures().get(0).getData();
+        byte[] pictureDataOut = wb.getAllPictures().get(0).getData();
         assertArrayEquals(pictureDataEmf, pictureDataOut);
 
-        byte wmfNoHeader[] = new byte[pictureDataWmf.length-22];
+        byte[] wmfNoHeader = new byte[pictureDataWmf.length - 22];
         System.arraycopy(pictureDataWmf, 22, wmfNoHeader, 0, pictureDataWmf.length-22);
         pictureDataOut = wb.getAllPictures().get(2).getData();
         assertArrayEquals(wmfNoHeader, pictureDataOut);
index 943de4ad2329a6b85701894fae6acbdfc79c9cc3..583ef24f50689e35d615b49ffde90ca8bab32f51 100644 (file)
@@ -50,9 +50,9 @@ public class TestXorEncryption {
         int key = CryptoFunctions.createXorKey1("abc");
         assertEquals(20810, key);
         assertEquals(52250, verifier);
-        
-        byte xorArrAct[] = CryptoFunctions.createXorArray1("abc");
-        byte xorArrExp[] = HexRead.readFromString("AC-CC-A4-AB-D6-BA-C3-BA-D6-A3-2B-45-D3-79-29-BB");
+
+        byte[] xorArrAct = CryptoFunctions.createXorArray1("abc");
+        byte[] xorArrExp = HexRead.readFromString("AC-CC-A4-AB-D6-BA-C3-BA-D6-A3-2B-45-D3-79-29-BB");
         assertThat(xorArrExp, equalTo(xorArrAct));
     }
 
index 51a7d34d74178f8d340ea2a4548600b47390e389..ad686358d0f1028cca0d77c7f22cbb01232ea1cc 100644 (file)
@@ -50,14 +50,14 @@ public class TestOle10Native {
 
     @Test
     public void testFiles() throws IOException, Ole10NativeException {
-        File files[] = {
-            // bug 51891
-            POIDataSamples.getPOIFSInstance().getFile("multimedia.doc"),
-            // tika bug 1072
-            POIDataSamples.getPOIFSInstance().getFile("20-Force-on-a-current-S00.doc"),
-            // other files containing ole10native records ...
-            POIDataSamples.getDocumentInstance().getFile("Bug53380_3.doc"),
-            POIDataSamples.getDocumentInstance().getFile("Bug47731.doc")
+        File[] files = {
+                // bug 51891
+                POIDataSamples.getPOIFSInstance().getFile("multimedia.doc"),
+                // tika bug 1072
+                POIDataSamples.getPOIFSInstance().getFile("20-Force-on-a-current-S00.doc"),
+                // other files containing ole10native records ...
+                POIDataSamples.getDocumentInstance().getFile("Bug53380_3.doc"),
+                POIDataSamples.getDocumentInstance().getFile("Bug47731.doc")
         };
         
         for (File f : files) {
index 2add416529030a802a4dd79cf0081633c2ea73f4..eb88186a8e692586e7ae7f28417bd349201b5c23 100644 (file)
@@ -2612,7 +2612,7 @@ public final class TestPOIFSStream {
    public void NPOIFSReadCopyWritePOIFSRead() throws IOException {
       File testFile = POIDataSamples.getSpreadSheetInstance().getFile("Simple.xls");
       POIFSFileSystem src = new POIFSFileSystem(testFile);
-      byte wbDataExp[] = IOUtils.toByteArray(src.createDocumentInputStream("Workbook"));
+       byte[] wbDataExp = IOUtils.toByteArray(src.createDocumentInputStream("Workbook"));
 
       POIFSFileSystem nfs = new POIFSFileSystem();
       EntryUtils.copyNodes(src.getRoot(), nfs.getRoot());
@@ -2623,7 +2623,7 @@ public final class TestPOIFSStream {
       nfs.close();
 
       POIFSFileSystem pfs = new POIFSFileSystem(new ByteArrayInputStream(bos.toByteArray()));
-      byte wbDataAct[] = IOUtils.toByteArray(pfs.createDocumentInputStream("Workbook"));
+       byte[] wbDataAct = IOUtils.toByteArray(pfs.createDocumentInputStream("Workbook"));
 
       assertThat(wbDataExp, equalTo(wbDataAct));
       pfs.close();
index 365d1352ccf3f4311029fd3eb1a09d047d55b594..aba965bbf60894de72a8ed54114de89e3c8a0f36 100644 (file)
@@ -50,25 +50,25 @@ public class TestWorkdayFunction {
 
     @Test
     public void testFailWhenNoArguments() {
-        ValueEval ve[] = new ValueEval[0];
+        ValueEval[] ve = new ValueEval[0];
         assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, null));
     }
 
     @Test
     public void testFailWhenLessThan2Arguments() {
-        ValueEval ve[] = new ValueEval[1];
+        ValueEval[] ve = new ValueEval[1];
         assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, null));
     }
 
     @Test
     public void testFailWhenMoreThan3Arguments() {
-        ValueEval ve[] = new ValueEval[4];
+        ValueEval[] ve = new ValueEval[4];
         assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, null));
     }
 
     @Test
     public void testFailWhenArgumentsAreNotDatesNorNumbers() {
-        ValueEval ve[] = { new StringEval("Potato"), new StringEval("Cucumber") };
+        ValueEval[] ve = {new StringEval("Potato"), new StringEval("Cucumber")};
         assertEquals(VALUE_INVALID, WorkdayFunction.instance.evaluate(ve, EC));
     }
 
@@ -76,7 +76,7 @@ public class TestWorkdayFunction {
     public void testReturnWorkdays() {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2009, 3, 30);
         Date expDate = expCal.getTime();
-        ValueEval ve[] = { new StringEval(STARTING_DATE), new NumberEval(151) };
+        ValueEval[] ve = {new StringEval(STARTING_DATE), new NumberEval(151)};
         Date actDate = DateUtil.getJavaDate(((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue());
         assertEquals(expDate, actDate);
     }
@@ -86,7 +86,7 @@ public class TestWorkdayFunction {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 8, 27);
         Date expDate = expCal.getTime();
 
-       ValueEval ve[] = { new StringEval("2013/09/30"), new NumberEval(-1) };
+        ValueEval[] ve = {new StringEval("2013/09/30"), new NumberEval(-1)};
                double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
                assertEquals(41544.0, numberValue, 0);
                
@@ -98,8 +98,8 @@ public class TestWorkdayFunction {
     public void testReturnWorkdaysSpanningAWeekendAddingDays() {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 8, 30);
         Date expDate = expCal.getTime();
-        
-        ValueEval ve[] = { new StringEval("2013/09/27"), new NumberEval(1) };
+
+        ValueEval[] ve = {new StringEval("2013/09/27"), new NumberEval(1)};
         double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
         assertEquals(41547.0, numberValue, 0);
 
@@ -111,8 +111,8 @@ public class TestWorkdayFunction {
     public void testReturnWorkdaysWhenStartIsWeekendAddingDays() {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 9, 7);
         Date expDate = expCal.getTime();
-        
-        ValueEval ve[] = { new StringEval("2013/10/06"), new NumberEval(1) };
+
+        ValueEval[] ve = {new StringEval("2013/10/06"), new NumberEval(1)};
         double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
         assertEquals(41554.0, numberValue, 0);
 
@@ -124,8 +124,8 @@ public class TestWorkdayFunction {
     public void testReturnWorkdaysWhenStartIsWeekendSubtractingDays() {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2013, 9, 4);
         Date expDate = expCal.getTime();
-        
-        ValueEval ve[] = { new StringEval("2013/10/06"), new NumberEval(-1) };
+
+        ValueEval[] ve = {new StringEval("2013/10/06"), new NumberEval(-1)};
         double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
         assertEquals(41551.0, numberValue, 0);
 
@@ -137,8 +137,8 @@ public class TestWorkdayFunction {
     public void testReturnWorkdaysWithDaysTruncated() {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2009, 3, 30);
         Date expDate = expCal.getTime();
-        
-        ValueEval ve[] = { new StringEval(STARTING_DATE), new NumberEval(151.99999) };
+
+        ValueEval[] ve = {new StringEval(STARTING_DATE), new NumberEval(151.99999)};
         double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
         
         Date actDate = DateUtil.getJavaDate(numberValue);
@@ -149,8 +149,8 @@ public class TestWorkdayFunction {
     public void testReturnRetroativeWorkday() {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2008, 8, 23);
         Date expDate = expCal.getTime();
-        
-        ValueEval ve[] = { new StringEval(STARTING_DATE), new NumberEval(-5), new StringEval(RETROATIVE_HOLIDAY) };
+
+        ValueEval[] ve = {new StringEval(STARTING_DATE), new NumberEval(-5), new StringEval(RETROATIVE_HOLIDAY)};
         double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
         
         Date actDate = DateUtil.getJavaDate(numberValue);
@@ -161,10 +161,10 @@ public class TestWorkdayFunction {
     public void testReturnNetworkdaysWithManyHolidays() {
         Calendar expCal = LocaleUtil.getLocaleCalendar(2009, 4, 5);
         Date expDate = expCal.getTime();
-        
-        ValueEval ve[] = {
-            new StringEval(STARTING_DATE), new NumberEval(151),
-            new MockAreaEval(FIRST_HOLIDAY, SECOND_HOLIDAY, THIRD_HOLIDAY) };
+
+        ValueEval[] ve = {
+                new StringEval(STARTING_DATE), new NumberEval(151),
+                new MockAreaEval(FIRST_HOLIDAY, SECOND_HOLIDAY, THIRD_HOLIDAY)};
         double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(ve, EC)).getNumberValue();
         
         Date actDate = DateUtil.getJavaDate(numberValue);
index 71c49cf7539119cbbd8bd892718c3ad26bfb2e18..8fbfa699610dff771dc27429114a8e3bda78c541 100644 (file)
@@ -68,7 +68,7 @@ public class TestEOMonth {
     }
 
     private void checkValue(double startDate, int monthInc, double expectedResult) {
-        ValueEval ve[] = {new NumberEval(startDate), new NumberEval(monthInc)};
+        ValueEval[] ve = {new NumberEval(startDate), new NumberEval(monthInc)};
         NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec);
         assertEquals(expectedResult, result.getNumberValue(), 0);
     }
@@ -107,10 +107,10 @@ public class TestEOMonth {
             cal.clear(Calendar.SECOND);
             cal.clear(Calendar.MILLISECOND);
             Date expDate = cal.getTime();
-            
-            ValueEval ve[] = {
-                new NumberEval(DateUtil.getExcelDate(startDate)),
-                new NumberEval(offset)
+
+            ValueEval[] ve = {
+                    new NumberEval(DateUtil.getExcelDate(startDate)),
+                    new NumberEval(offset)
             };
             NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec);
             Date actDate = DateUtil.getJavaDate(result.getNumberValue());
@@ -121,14 +121,14 @@ public class TestEOMonth {
 
     @Test
     public void testBug56688() {
-        ValueEval ve[] = {new NumberEval(DATE_1902_09_26), new RefEvalImplementation(new NumberEval(0))};
+        ValueEval[] ve = {new NumberEval(DATE_1902_09_26), new RefEvalImplementation(new NumberEval(0))};
         NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec);
         assertEquals(DATE_1902_09_30, result.getNumberValue(), 0);
     }
 
     @Test
     public void testRefEvalStartDate() {
-        ValueEval ve[] = {new RefEvalImplementation(new NumberEval(DATE_1902_09_26)), new NumberEval(0)};
+        ValueEval[] ve = {new RefEvalImplementation(new NumberEval(DATE_1902_09_26)), new NumberEval(0)};
         NumberEval result = (NumberEval) eOMonth.evaluate(ve, ec);
         assertEquals(DATE_1902_09_30, result.getNumberValue(), 0);
     }
index 90300bf24072b6709612de85acac6e55d206ab96..dc4783072780adfd4d59087451d3d9eaa3cda62b 100644 (file)
@@ -70,8 +70,11 @@ public class TestFinanceLib extends AbstractNumericTestCase {
         
     }
     public void testNpv() {
-        double r, v[], npv, x;
-        
+        double r;
+        double[] v;
+        double npv;
+        double x;
+
         r = 1; v = new double[]{100, 200, 300, 400};
         npv = FinanceLib.npv(r, v);
         x = 162.5;
index 9054c6b0ae8f2dc5d0117a4a3a177968edb6d289..41ca4b8e980f1da8c7aa44710f0ea4d69a42c6a9 100644 (file)
@@ -66,7 +66,7 @@ public final class TestSubtotal {
                }
 
                AreaEval arg1 = EvalFactory.createAreaEval("C1:D5", values);
-               ValueEval args[] = { new NumberEval(function), arg1 };
+        ValueEval[] args = {new NumberEval(function), arg1};
 
                ValueEval result = new Subtotal().evaluate(args, 0, 0);
 
index 40dfd698fcb93d72867d7ae3755dfc5d13e1eed1..c721774461b2bcbbc49daaebc3b080bcbe09db23 100644 (file)
@@ -82,11 +82,11 @@ public class TestDateUtil {
 
         Calendar expCal = LocaleUtil.getLocaleCalendar(1900, 0, 0);
 
-        Calendar actCal[] = {
-            DateUtil.getJavaCalendar(dateValue),
-            DateUtil.getJavaCalendar(dateValue, use1904windowing),
-            DateUtil.getJavaCalendar(dateValue, use1904windowing, tz),
-            DateUtil.getJavaCalendar(dateValue, use1904windowing, tz, roundSeconds)
+        Calendar[] actCal = {
+                DateUtil.getJavaCalendar(dateValue),
+                DateUtil.getJavaCalendar(dateValue, use1904windowing),
+                DateUtil.getJavaCalendar(dateValue, use1904windowing, tz),
+                DateUtil.getJavaCalendar(dateValue, use1904windowing, tz, roundSeconds)
         };
         assertEquals(expCal, actCal[0]);
         assertEquals(expCal, actCal[1]);
index af3d8877b056fbc3a4927a18ee09e44620751dac..198b8bc7a28796203fd5c449b023c21794f1cd75 100644 (file)
@@ -53,8 +53,8 @@ public class TestHexDump {
         byte[] testArray = testArray();
         ByteArrayOutputStream streamAct = new ByteArrayOutputStream();
         HexDump.dump(testArray, 0, streamAct, 0);
-        byte bytesAct[] = streamAct.toByteArray();
-        byte bytesExp[] = toHexDump(0,0);
+        byte[] bytesAct = streamAct.toByteArray();
+        byte[] bytesExp = toHexDump(0, 0);
 
         assertEquals("array size mismatch", bytesExp.length, bytesAct.length);
         assertArrayEquals("array mismatch", bytesExp, bytesAct);
@@ -123,7 +123,7 @@ public class TestHexDump {
 
     private byte[] toHexDump(long offset, int index) {
         StringBuilder strExp = new StringBuilder(), chrs = new StringBuilder();
-        Object obj[] = new Object[33];
+        Object[] obj = new Object[33];
         StringBuilder format = new StringBuilder();
 
         for (int j = 0; j < 16 && (index + j*16) < 256; j++) {
index 67741921a78aea462ab8a41f38f469d137d374e1..24072fa6565f8e502e607fc2bf46d98a8c2d64e3 100644 (file)
@@ -43,7 +43,7 @@ public final class TestLittleEndian {
         testdata[0] = 0x01;
         testdata[1] = (byte) 0xFF;
         testdata[2] = 0x02;
-        short expected[] = new short[2];
+        short[] expected = new short[2];
 
         expected[0] = ( short ) 0xFF01;
         expected[1] = 0x02FF;
@@ -164,7 +164,7 @@ public final class TestLittleEndian {
         expected[1] = (byte) 0xFF;
         expected[2] = 0x02;
         byte[] received   = new byte[ LittleEndianConsts.SHORT_SIZE + 1 ];
-        short  testdata[] = new short[2];
+        short[] testdata = new short[2];
 
         testdata[0] = ( short ) 0xFF01;
         testdata[1] = 0x02FF;