poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1849716 [4/4] - in /poi/trunk/src: examples/src/org/apache/poi/hslf/examples/ examples/src/org/apache/poi/ss/examples/ examples/src/org/apache/poi/xslf/usermodel/ java/org/apache/poi/ddf/ java/org/apache/poi/hpsf/ java/org/apache/poi/hssf/...
Date Tue, 25 Dec 2018 10:00:00 GMT
Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java Tue Dec
25 09:59:58 2018
@@ -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)
{

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestFontRendering.java
Tue Dec 25 09:59:58 2018
@@ -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());
             

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPicture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPicture.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPicture.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPicture.java Tue
Dec 25 09:59:58 2018
@@ -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",
         };
         

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestTextRun.java Tue
Dec 25 09:59:58 2018
@@ -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()) {

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java Tue Dec 25
09:59:58 2018
@@ -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);

Modified: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java (original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/TestFieldsTables.java Tue Dec 25
09:59:58 2018
@@ -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",
-
-        "[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",
-
-        "[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",
+    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",
+
+            "[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",
 
-        "[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

Modified: poi/trunk/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hpsf/TestVariantSupport.java Tue Dec 25 09:59:58
2018
@@ -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);

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/common/TestUnicodeString.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/common/TestUnicodeString.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/common/TestUnicodeString.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/record/common/TestUnicodeString.java Tue Dec
25 09:59:58 2018
@@ -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);

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java
(original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/record/pivot/TestExtendedPivotTableViewFieldsRecord.java
Tue Dec 25 09:59:58 2018
@@ -55,7 +55,7 @@ public final class TestExtendedPivotTabl
 	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 TestExtendedPivotTabl
 			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());
 	}

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/DummyGraphics2d.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/DummyGraphics2d.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/DummyGraphics2d.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/DummyGraphics2d.java Tue Dec 25
09:59:58 2018
@@ -429,7 +429,7 @@ public class DummyGraphics2d extends Gra
         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 Gra
         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 Gra
         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 Gra
         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 Gra
         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) +

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java Tue Dec 25
09:59:58 2018
@@ -247,11 +247,11 @@ public final class TestHSSFPicture exten
     	// 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 exten
         
         
         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);

Modified: poi/trunk/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/poifs/crypt/TestXorEncryption.java Tue Dec 25 09:59:58
2018
@@ -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));
     }
 

Modified: poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestOle10Native.java Tue Dec 25
09:59:58 2018
@@ -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) {

Modified: poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestPOIFSStream.java Tue Dec 25
09:59:58 2018
@@ -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();

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java Tue Dec
25 09:59:58 2018
@@ -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);

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestEOMonth.java Tue Dec 25
09:59:58 2018
@@ -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);
     }

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestFinanceLib.java Tue Dec
25 09:59:58 2018
@@ -70,8 +70,11 @@ public class TestFinanceLib extends Abst
         
     }
     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;

Modified: poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/formula/functions/TestSubtotal.java Tue Dec
25 09:59:58 2018
@@ -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);
 

Modified: poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDateUtil.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDateUtil.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDateUtil.java [UTF-8] (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/usermodel/TestDateUtil.java [UTF-8] Tue Dec
25 09:59:58 2018
@@ -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]);

Modified: poi/trunk/src/testcases/org/apache/poi/util/TestHexDump.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/util/TestHexDump.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/util/TestHexDump.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/util/TestHexDump.java Tue Dec 25 09:59:58 2018
@@ -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++) {

Modified: poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndian.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndian.java?rev=1849716&r1=1849715&r2=1849716&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndian.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndian.java Tue Dec 25 09:59:58
2018
@@ -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;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message