diff options
author | Dominik Stadler <centic@apache.org> | 2017-09-26 12:33:08 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2017-09-26 12:33:08 +0000 |
commit | 9bb3e05e6aa139142836b8980516cd23d99f3b97 (patch) | |
tree | 9d1541b3d9dfed90611e252fb17b563b4e20015c /src | |
parent | 2a04408bf3c2ff99766c733edfc099b6ef940ef3 (diff) | |
download | poi-9bb3e05e6aa139142836b8980516cd23d99f3b97.tar.gz poi-9bb3e05e6aa139142836b8980516cd23d99f3b97.zip |
Replace "getEntry() plus catch" by "hasEntry()" in HSSFWorkbook
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809738 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index 70d947ee5f..01324e5716 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -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 } } |