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
This commit is contained in:
Dominik Stadler 2017-09-26 12:33:08 +00:00
parent 2a04408bf3
commit 9bb3e05e6a
1 changed files with 2 additions and 6 deletions

View 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);
if(directory.hasEntry(wbName)) {
return wbName;
} catch (FileNotFoundException e) {
// continue - to try other options
}
}