poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1568554 - in /poi/trunk/src/ooxml: java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java java/org/apache/poi/xssf/streaming/SheetDataWriter.java testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
Date Sat, 15 Feb 2014 00:18:34 GMT
Author: centic
Date: Sat Feb 15 00:18:34 2014
New Revision: 1568554

URL: http://svn.apache.org/r1568554
Log:
Add assertions, remove Sonar warnings

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java?rev=1568554&r1=1568553&r2=1568554&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/GZIPSheetDataWriter.java Sat Feb
15 00:18:34 2014
@@ -51,9 +51,8 @@ public class GZIPSheetDataWriter extends
      * @return temp file to write sheet data
      */
     @Override
-	public File createTempFile()throws IOException {
-        File fd = File.createTempFile("poi-sxssf-sheet-xml", ".gz");
-        return fd;
+    public File createTempFile()throws IOException {
+        return File.createTempFile("poi-sxssf-sheet-xml", ".gz");
     }
 
     /**

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java?rev=1568554&r1=1568553&r2=1568554&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/streaming/SheetDataWriter.java Sat Feb 15
00:18:34 2014
@@ -75,8 +75,7 @@ public class SheetDataWriter {
      * @return temp file to write sheet data
      */
     public File createTempFile()throws IOException {
-        File fd = File.createTempFile("poi-sxssf-sheet", ".xml");
-        return fd;
+        return File.createTempFile("poi-sxssf-sheet", ".xml");
     }
 
     /**

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java?rev=1568554&r1=1568553&r2=1568554&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java Sat
Feb 15 00:18:34 2014
@@ -93,14 +93,14 @@ public final class TestSXSSFWorkbook ext
     	xssfWorkbook.createSheet("S1");
     	SXSSFWorkbook wb = new SXSSFWorkbook(xssfWorkbook);
     	xssfWorkbook = (XSSFWorkbook) SXSSFITestDataProvider.instance.writeOutAndReadBack(wb);
-    	wb.dispose();
+    	assertTrue(wb.dispose());
 
         wb = new SXSSFWorkbook(xssfWorkbook);
     	assertEquals(1, wb.getNumberOfSheets());
     	Sheet sheet  = wb.getSheetAt(0);
     	assertNotNull(sheet);
     	assertEquals("S1", sheet.getSheetName());
-        wb.dispose();
+        assertTrue(wb.dispose());
 
     }
 
@@ -151,7 +151,7 @@ public final class TestSXSSFWorkbook ext
     	cell.setCellValue("value 2_1_1");
     	SXSSFWorkbook wb = new SXSSFWorkbook(xssfWorkbook);
     	xssfWorkbook = (XSSFWorkbook) SXSSFITestDataProvider.instance.writeOutAndReadBack(wb);
-        wb.dispose();
+        assertTrue(wb.dispose());
 
         wb = new SXSSFWorkbook(xssfWorkbook);
 
@@ -218,7 +218,7 @@ public final class TestSXSSFWorkbook ext
         File tmp = wr.getTempFile();
         assertTrue(tmp.getName().startsWith("poi-sxssf-sheet"));
         assertTrue(tmp.getName().endsWith(".xml"));
-        wb.dispose();
+        assertTrue(wb.dispose());
 
         wb = new SXSSFWorkbook();
         wb.setCompressTempFiles(true);
@@ -228,7 +228,7 @@ public final class TestSXSSFWorkbook ext
         tmp = wr.getTempFile();
         assertTrue(tmp.getName().startsWith("poi-sxssf-sheet-xml"));
         assertTrue(tmp.getName().endsWith(".gz"));
-        wb.dispose();
+        assertTrue(wb.dispose());
 
         //Test escaping of Unicode control characters
         wb = new SXSSFWorkbook();
@@ -237,7 +237,7 @@ public final class TestSXSSFWorkbook ext
         Cell cell = xssfWorkbook.getSheet("S1").getRow(0).getCell(0);
         assertEquals("value?", cell.getStringCellValue());
 
-        wb.dispose();
+        assertTrue(wb.dispose());
 
     }
 
@@ -280,7 +280,7 @@ public final class TestSXSSFWorkbook ext
             }
         }
 
-        wb.dispose();
+        assertTrue(wb.dispose());
 
     }
 
@@ -366,10 +366,10 @@ public final class TestSXSSFWorkbook ext
 				}
 
 				wb.write(outSteam);
-				// wb.dispose();
+				// assertTrue(wb.dispose());
 				outSteam.close();
 			} finally {
-				wb.dispose();
+				assertTrue(wb.dispose());
 			}
 		}
 		out.delete();



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


Mime
View raw message