You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2005/03/12 02:33:51 UTC

DO NOT REPLY [Bug 24207] - [INFO NEEDED] Call HSSFName.getReference() throwing java.lang.IndexOutOfBoundsException

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=24207>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=24207





------- Additional Comments From jianmang@stachanov.com  2005-03-12 02:33 -------
I'm not sure I have encoutered the same problem but it looks to me the root
causes are the same

import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.poifs.filesystem.*;
import org.apache.poi.hssf.util.*;
import java.io.*;

public class TestPOI
{
  public static void main(String[] argv){
    try{
      POIFSFileSystem fs=new POIFSFileSystem(new FileInputStream(argv[0]));
      HSSFWorkbook wb = new HSSFWorkbook(fs);
      System.out.println(wb.getNumberOfNames());
      for(int i=0;i<wb.getNumberOfNames();i++){
        HSSFName nm=wb.getNameAt(i);
          AreaReference areaRef=new AreaReference(nm.getReference());
      }
    }catch(Exception e){
      e.printStackTrace();
    }
  }
}

create a fresh new Excel book and put two names in it say a at A1 and b at A2.
run the program against the book and it will be fine.

delete the second row so the a at A2 will disapepar. save the book and run the
program against the modified book. you will get something like

[WARNING] Unknown Ptg 3c (60)
2
java.lang.ArrayIndexOutOfBoundsException: 5
        at
org.apache.poi.hssf.util.CellReference.separateRefParts(CellReference.java:111)
        at org.apache.poi.hssf.util.CellReference.<init>(CellReference.java:35)
        at org.apache.poi.hssf.util.AreaReference.<init>(AreaReference.java:33)
        at TestPOI.main(TestPOI.java:15)


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/