You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by on...@apache.org on 2016/09/14 21:44:06 UTC

svn commit: r1760798 - /poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java

Author: onealj
Date: Wed Sep 14 21:44:06 2016
New Revision: 1760798

URL: http://svn.apache.org/viewvc?rev=1760798&view=rev
Log:
declare methods throw runtime exceptions for IDE hints

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=1760798&r1=1760797&r2=1760798&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java Wed Sep 14 21:44:06 2016
@@ -827,7 +827,7 @@ public final class XSSFCell implements C
      * @throws IllegalStateException if the cell type returned by {@link #getCellTypeEnum()} isn't {@link CellType#ERROR}
      * @see FormulaError
      */
-    public String getErrorCellString() {
+    public String getErrorCellString() throws IllegalStateException {
         CellType cellType = getBaseCellType(true);
         if(cellType != CellType.ERROR) throw typeMismatch(CellType.ERROR, cellType, false);
 
@@ -845,13 +845,16 @@ public final class XSSFCell implements C
      * @see FormulaError
      */
     @Override
-    public byte getErrorCellValue() {
+    public byte getErrorCellValue() throws IllegalStateException {
         String code = getErrorCellString();
         if (code == null) {
             return 0;
         }
-
-        return FormulaError.forString(code).getCode();
+        try {
+            return FormulaError.forString(code).getCode();
+        } catch (final IllegalArgumentException e) {
+            throw new IllegalStateException("Unexpected error code", e);
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org