]> source.dussan.org Git - poi.git/commitdiff
Replace "getEntry() plus catch" by "hasEntry()" in HSSFWorkbook
authorDominik Stadler <centic@apache.org>
Tue, 26 Sep 2017 12:33:08 +0000 (12:33 +0000)
committerDominik Stadler <centic@apache.org>
Tue, 26 Sep 2017 12:33:08 +0000 (12:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809738 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java

index 70d947ee5f1bf638ead426d70b77b7c65e9b079a..01324e5716770598e4fc115bd40d5c46fe9a9dc1 100644 (file)
@@ -271,13 +271,9 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
     }
 
     public static String getWorkbookDirEntryName(DirectoryNode directory) {
-
-        for (String wbName : WORKBOOK_DIR_ENTRY_NAMES) {
-            try {
-                directory.getEntry(wbName);
+        for(String wbName : WORKBOOK_DIR_ENTRY_NAMES) {
+            if(directory.hasEntry(wbName)) {
                 return wbName;
-            } catch (FileNotFoundException e) {
-                // continue - to try other options
             }
         }