You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2016/06/15 03:29:32 UTC

svn commit: r1748485 - /poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java

Author: onealj
Date: Wed Jun 15 03:29:31 2016
New Revision: 1748485

URL: http://svn.apache.org/viewvc?rev=1748485&view=rev
Log:
update WriteAuthorAntTitle example to Java 1.6+

Modified:
    poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java

Modified: poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java?rev=1748485&r1=1748484&r2=1748485&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java (original)
+++ poi/trunk/src/examples/src/org/apache/poi/hpsf/examples/WriteAuthorAndTitle.java Wed Jun 15 03:29:31 2016
@@ -347,7 +347,7 @@ public class WriteAuthorAndTitle
         /** Contains the directory paths that have already been created in the
          * output POI filesystem and maps them to their corresponding
          * {@link org.apache.poi.poifs.filesystem.DirectoryNode}s. */
-        private final Map paths = new HashMap();
+        private final Map<String, DirectoryEntry> paths = new HashMap<String, DirectoryEntry>();
 
 
 
@@ -381,7 +381,7 @@ public class WriteAuthorAndTitle
             {
                 /* Check whether this directory has already been created. */
                 final String s = path.toString();
-                DirectoryEntry de = (DirectoryEntry) paths.get(s);
+                DirectoryEntry de = paths.get(s);
                 if (de != null)
                     /* Yes: return the corresponding DirectoryEntry. */
                     return de;
@@ -411,10 +411,7 @@ public class WriteAuthorAndTitle
                  * exists. However, since we have full control about directory
                  * creation we can ensure that this will never happen. */
                 ex.printStackTrace(System.err);
-                throw new RuntimeException(ex.toString());
-                /* FIXME (2): Replace the previous line by the following once we
-                 * no longer need JDK 1.3 compatibility. */
-                // throw new RuntimeException(ex);
+                throw new RuntimeException(ex);
             }
         }
     }



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