aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorJason Height <jheight@apache.org>2006-08-28 03:54:04 +0000
committerJason Height <jheight@apache.org>2006-08-28 03:54:04 +0000
commitd4b421b471d495fec1e782beed2dc8bb010c4474 (patch)
tree168c12c0faae1cfa1c220f6b62ccbac8e3f2be12 /src/java
parent4db9e619040b285efdb5dfd091decd47d8f07b47 (diff)
downloadpoi-d4b421b471d495fec1e782beed2dc8bb010c4474.tar.gz
poi-d4b421b471d495fec1e782beed2dc8bb010c4474.zip
Bug28755: CellReference will throws IllegalArgumentException when an illegal cell reference is provided.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437522 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/hssf/util/CellReference.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/java/org/apache/poi/hssf/util/CellReference.java b/src/java/org/apache/poi/hssf/util/CellReference.java
index 623f8175a1..0b29415d9b 100644
--- a/src/java/org/apache/poi/hssf/util/CellReference.java
+++ b/src/java/org/apache/poi/hssf/util/CellReference.java
@@ -34,13 +34,17 @@ public class CellReference {
public CellReference(String cellRef) {
String[] parts = separateRefParts(cellRef);
sheetName = parts[0];
- String ref = parts[1];
+ String ref = parts[1];
+ if ((ref == null)||("".equals(ref)))
+ throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
if (ref.charAt(0) == '$') {
colAbs=true;
ref=ref.substring(1);
}
col = convertColStringToNum(ref);
ref=parts[2];
+ if ((ref == null)||("".equals(ref)))
+ throw new IllegalArgumentException("Invalid Formula cell reference: '"+cellRef+"'");
if (ref.charAt(0) == '$') {
rowAbs=true;
ref=ref.substring(1);