diff options
Diffstat (limited to 'src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java')
-rw-r--r-- | src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index 30776608ba..a76cfd159b 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -600,6 +600,8 @@ public class HSSFWorkbook extends POIDocument * * @param sheetname sheetname to set for the sheet. * @return HSSFSheet representing the new sheet. + * @throws IllegalArgumentException if there is already a sheet present with a case-insensitive + * match for the specified name. */ public HSSFSheet createSheet(String sheetname) @@ -639,9 +641,9 @@ public class HSSFWorkbook extends POIDocument } /** - * Get sheet with the given name + * Get sheet with the given name (case insensitive match) * @param name of the sheet - * @return HSSFSheet with the name provided or null if it does not exist + * @return HSSFSheet with the name provided or <code>null</code> if it does not exist */ public HSSFSheet getSheet(String name) @@ -652,7 +654,7 @@ public class HSSFWorkbook extends POIDocument { String sheetname = workbook.getSheetName(k); - if (sheetname.equals(name)) + if (sheetname.equalsIgnoreCase(name)) { retval = (HSSFSheet) sheets.get(k); } |