poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1776714 - in /poi/trunk/src: java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmap16.java
Date Sat, 31 Dec 2016 09:43:08 GMT
Author: centic
Date: Sat Dec 31 09:43:08 2016
New Revision: 1776714

URL: http://svn.apache.org/viewvc?rev=1776714&view=rev
Log:
Fix some Findbugs reports

Modified:
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmap16.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java?rev=1776714&r1=1776713&r2=1776714&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java Sat Dec 31 09:43:08
2016
@@ -19,10 +19,7 @@
 
 package org.apache.poi.poifs.filesystem;
 
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 
 import org.apache.poi.poifs.dev.POIFSViewable;
 import org.apache.poi.util.CloseIgnoringInputStream;
@@ -152,10 +149,16 @@ public class POIFSFileSystem
         // TODO Make this nicer!
         // Create a new empty POIFS in the file
         POIFSFileSystem tmp = new POIFSFileSystem();
-        FileOutputStream fout = new FileOutputStream(file);
-        tmp.writeFilesystem(fout);
-        fout.close();
-        tmp.close();
+        try {
+            OutputStream out = new FileOutputStream(file);
+            try {
+                tmp.writeFilesystem(out);
+            } finally {
+                out.close();
+            }
+        } finally {
+            tmp.close();
+        }
         
         // Open it up again backed by the file
         return new POIFSFileSystem(file, false);
@@ -166,14 +169,9 @@ public class POIFSFileSystem
      *
      * @param args names of the files; arg[ 0 ] is the input file,
      *             arg[ 1 ] is the output file
-     *
-     * @exception IOException
      */
-
-    public static void main(String args[])
-        throws IOException
+    public static void main(String args[]) throws IOException
     {
         OPOIFSFileSystem.main(args);
     }
 }
-

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmap16.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmap16.java?rev=1776714&r1=1776713&r2=1776714&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmap16.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmap16.java Sat Dec 31 09:43:08
2016
@@ -74,8 +74,7 @@ public class HwmfBitmap16 {
         }
 
         int length = (((width * bitsPixel + 15) >> 4) << 1) * height;
-        @SuppressWarnings("unused")
-        byte buf[] = IOUtils.toByteArray(leis, length);
+        /*byte buf[] =*/ IOUtils.toByteArray(leis, length);
         
         // TODO: this is not implemented ... please provide a sample, if it
         // ever happens to you, to come here ...



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


Mime
View raw message