poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1722406 - in /poi/trunk/src: ooxml/java/org/apache/poi/poifs/crypt/agile/ testcases/org/apache/poi/ testcases/org/apache/poi/ss/util/ testcases/org/apache/poi/util/
Date Wed, 30 Dec 2015 20:31:13 GMT
Author: centic
Date: Wed Dec 30 20:31:13 2015
New Revision: 1722406

URL: http://svn.apache.org/viewvc?rev=1722406&view=rev
Log:
Eclipse warnings

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java
    poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java
    poi/trunk/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
    poi/trunk/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
    poi/trunk/src/testcases/org/apache/poi/util/TestHexDump.java
    poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java?rev=1722406&r1=1722405&r2=1722406&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/agile/AgileDecryptor.java Wed Dec
30 20:31:13 2015
@@ -278,7 +278,6 @@ public class AgileDecryptor extends Decr
         }
     }
 
-    @SuppressWarnings("resource")
     public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException
{
         DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY);
         _length = dis.readLong();

Modified: poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java?rev=1722406&r1=1722405&r2=1722406&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/TestPOIDocumentMain.java Wed Dec 30 20:31:13 2015
@@ -131,10 +131,14 @@ public final class TestPOIDocumentMain {
         doc.write(baos);
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
 
+        ((HSSFWorkbook)doc).close();
+
         doc = new HSSFWorkbook(bais);
 
         assertNotNull(doc.getSummaryInformation());
         assertNotNull(doc.getDocumentSummaryInformation());
+        
+        ((HSSFWorkbook)doc).close();
     }
 
     @Test
@@ -148,6 +152,9 @@ public final class TestPOIDocumentMain {
         // Write out and back in again, no change
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         doc.write(baos);
+        
+        ((HSSFWorkbook)doc).close();
+        
         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         doc = new HSSFWorkbook(bais);
 
@@ -162,6 +169,9 @@ public final class TestPOIDocumentMain {
         // Save and re-load
         baos = new ByteArrayOutputStream();
         doc.write(baos);
+        
+        ((HSSFWorkbook)doc).close();
+
         bais = new ByteArrayInputStream(baos.toByteArray());
         doc = new HSSFWorkbook(bais);
 
@@ -177,5 +187,7 @@ public final class TestPOIDocumentMain {
         assertNotNull(doc.getDocumentSummaryInformation());
         assertEquals("POI Testing", doc.getSummaryInformation().getAuthor());
         assertEquals("ASF", doc.getDocumentSummaryInformation().getCompany());
+
+        ((HSSFWorkbook)doc).close();
     }
 }

Modified: poi/trunk/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java?rev=1722406&r1=1722405&r2=1722406&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
(original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/util/NumberRenderingSpreadsheetGenerator.java
Wed Dec 30 20:31:13 2015
@@ -206,7 +206,7 @@ public class NumberRenderingSpreadsheetG
 	}
 
 	private static void writeLong(byte[] bb, int i, long val) {
-		String oldVal = interpretLong(bb, i);
+		/*String oldVal =*/ interpretLong(bb, i);
 		bb[i+7] = (byte) (val >> 56);
 		bb[i+6] = (byte) (val >> 48);
 		bb[i+5] = (byte) (val >> 40);

Modified: poi/trunk/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java?rev=1722406&r1=1722405&r2=1722406&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java Wed Dec 30 20:31:13
2015
@@ -17,18 +17,17 @@ limitations under the License.
 
 package org.apache.poi.ss.util;
 
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertNotEquals;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-//TODO: replace junit3 with junit4 code
-import junit.framework.TestCase; //junit3
-import static org.junit.Assert.assertNotEquals; //junit4
-
 import org.apache.poi.hssf.record.TestcaseRecordInputStream;
 import org.apache.poi.util.LittleEndianOutputStream;
 
+//TODO: replace junit3 with junit4 code
+import junit.framework.TestCase; //junit3
+
 public final class TestCellRangeAddress extends TestCase {
     byte[] data = new byte[] { (byte) 0x02, (byte) 0x00, (byte) 0x04,
             (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x00, };

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=1722406&r1=1722405&r2=1722406&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/util/TestHexDump.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/util/TestHexDump.java Wed Dec 30 20:31:13 2015
@@ -19,7 +19,6 @@ package org.apache.poi.util;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -29,7 +28,6 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
-import java.lang.reflect.Constructor;
 
 import org.junit.Test;
 

Modified: poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java?rev=1722406&r1=1722405&r2=1722406&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/util/TestLittleEndianStreams.java Wed Dec 30 20:31:13
2015
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertArr
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
@@ -32,7 +33,7 @@ import junit.framework.TestCase;
  */
 public final class TestLittleEndianStreams extends TestCase {
 
-	public void testRead() {
+	public void testRead() throws IOException {
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 		LittleEndianOutput leo = new LittleEndianOutputStream(baos);
 		leo.writeInt(12345678);
@@ -42,6 +43,7 @@ public final class TestLittleEndianStrea
 		leo.writeByte(200);
 		leo.writeLong(1234567890123456789L);
 		leo.writeDouble(123.456);
+		((LittleEndianOutputStream)leo).close();
 
 		LittleEndianInput lei = new LittleEndianInputStream(new ByteArrayInputStream(baos.toByteArray()));
 
@@ -52,6 +54,7 @@ public final class TestLittleEndianStrea
 		assertEquals(200, lei.readUByte());
 		assertEquals(1234567890123456789L, lei.readLong());
 		assertEquals(123.456, lei.readDouble(), 0.0);
+        ((LittleEndianInputStream)lei).close();
 	}
 
 	/**



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


Mime
View raw message