Bug 14269

Summary: [PATCH] - CellReference NumberFormatException
Product: POI Reporter: Dennis Doubleday <dennis>
Component: HSSFAssignee: POI Developers List <dev>
Severity: normal    
Priority: P3    
Version: 2.0-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch to fix reported problem
Fixed patch file that doesn't have a println accidentally left in

Description Dennis Doubleday 2002-11-05 19:59:11 UTC
int nameNum = book.getNumberOfNames();
for (int i = 0; i < nameNum; i++) {
    HSSFName namedRef = book.getNameAt(i);
    System.out.println("Cell ref = " + namedRef.getReference());
    CellReference cellRef = new CellReference(namedRef.getReference());

results in: 

Cell ref = Summary!$D$31
java.lang.NumberFormatException: D$31 	
  at java.lang.Integer.parseInt(Integer.java:426) 	
  at java.lang.Integer.parseInt(Integer.java:476) 	

because it doesn't seem to be parsing the string right (it doesn't pass
over the sheet name before trying to parse row/col information out.

Patch is attached.
Comment 1 Dennis Doubleday 2002-11-05 20:00:17 UTC
Created attachment 3742 [details]
Patch to fix reported problem
Comment 2 Dennis Doubleday 2002-11-07 20:03:25 UTC
Created attachment 3768 [details]
Fixed patch file that doesn't have a println accidentally left in
Comment 3 Dennis Doubleday 2002-11-07 20:04:23 UTC
Oops, I accidentally left in a println() in the first patch. Use the second
attached patch file please.
Comment 4 Andy Oliver 2002-11-28 19:27:35 UTC
applied, sold out, tonight.  Please crosscheck.  It would be good if we had a
unit test for the same.