aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-12-08 17:09:36 +0000
committerPJ Fanning <fanningpj@apache.org>2020-12-08 17:09:36 +0000
commit326ff18e51cccabeef0c4d15d666354399fcd962 (patch)
tree126e558ad853b1fb323f3ff6ffb9c22ebc06eed1 /src/java
parent29642eedb1dd488d5da40caaef418c7274f7b769 (diff)
downloadpoi-326ff18e51cccabeef0c4d15d666354399fcd962.tar.gz
poi-326ff18e51cccabeef0c4d15d666354399fcd962.zip
[bug-64964] HSSFCell.convertCellValueToBoolean shall throw more specific exception
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFCell.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
index 9c54fbb84f..a29179ad23 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
@@ -831,6 +831,7 @@ public class HSSFCell extends CellBase {
* setCellValue(boolean) straight afterwards. This method only exists to give
* the cell a somewhat reasonable value until the setCellValue() call (if at all).
* TODO - perhaps a method like setCellTypeAndValue(int, Object) should be introduced to avoid this
+ * @throws IllegalStateException if cell type cannot be converted to boolean
*/
private boolean convertCellValueToBoolean() {
@@ -855,8 +856,9 @@ public class HSSFCell extends CellBase {
case BLANK:
return false;
}
- throw new RuntimeException("Unexpected cell type (" + _cellType + ")");
+ throw new IllegalStateException("Unexpected cell type (" + _cellType + ")");
}
+
private String convertCellValueToString() {
switch (_cellType) {