]> source.dussan.org Git - poi.git/commitdiff
Fix some Eclipse warnings in ReaderWriter
authorDominik Stadler <centic@apache.org>
Thu, 26 Dec 2013 09:32:08 +0000 (09:32 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 26 Dec 2013 09:32:08 +0000 (09:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1553465 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/poifs/filesystem/ReaderWriter.java

index 961be1a56723246d4224be3b7bb704107733d3e3..717e6e9632d38e6de686f50d9db1ad619eb88773 100644 (file)
 
 package org.apache.poi.poifs.filesystem;
 
-import java.util.*;
-
-import java.io.*;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.poi.poifs.eventfilesystem.POIFSReader;
 import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
@@ -41,7 +44,7 @@ public class ReaderWriter
     private DirectoryEntry  root;
 
     // keys are DocumentDescriptors, values are byte[]s
-    private Map             dataMap;
+    private Map<DocumentDescriptor, byte[]>             dataMap;
 
     /**
      * Constructor ReaderWriter
@@ -55,7 +58,7 @@ public class ReaderWriter
     {
         this.filesystem = filesystem;
         root            = this.filesystem.getRoot();
-        dataMap         = new HashMap();
+        dataMap         = new HashMap<DocumentDescriptor, byte[]>();
     }
 
     /**
@@ -120,7 +123,7 @@ public class ReaderWriter
             System.out.println("adding document: " + descriptor + " (" + size
                                + " bytes)");
             dataMap.put(descriptor, data);
-            int            pathLength = path.length();
+            //int            pathLength = path.length();
             DirectoryEntry entry      = root;
 
             for (int k = 0; k < path.length(); k++)
@@ -173,7 +176,7 @@ public class ReaderWriter
 
             System.out.println("looking up document: " + descriptor + " ("
                                + event.getLimit() + " bytes)");
-            event.getStream().write(( byte [] ) dataMap.get(descriptor));
+            event.getStream().write(dataMap.get(descriptor));
         }
         catch (IOException e)
         {