Bug 45640 - java.lang.ClassCastException in the HSSFSheet.addRow
Summary: java.lang.ClassCastException in the HSSFSheet.addRow
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-17 04:34 UTC by Anton Sharapov
Modified: 2008-08-19 00:49 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Sharapov 2008-08-17 04:34:56 UTC
This is the exception that occurs when I try to add row on sheet after sheet.groupRow(...) method :
java.lang.ClassCastException: org.apache.poi.hssf.record.aggregates.ColumnInfoRecordsAggregate
	at org.apache.poi.hssf.model.Sheet.addRow(Sheet.java:769)
	at org.apache.poi.hssf.usermodel.HSSFSheet.addRow(HSSFSheet.java:298)
	at org.apache.poi.hssf.usermodel.HSSFSheet.createRow(HSSFSheet.java:201)

example code: 
        final HSSFWorkbook wb = new HSSFWorkbook();
        final HSSFSheet sheet = wb.createSheet("test");
        sheet.createRow(0);
        sheet.createRow(1);
        sheet.groupRow(0,1);
        sheet.createRow(2);

Tested on current poi version (poi-3.2-alpha1-20080817)
Note: in earlier builds (checked on poi-3.2-alpha1-20080716) this bug wasn't occurs.
Comment 1 Josh Micich 2008-08-19 00:49:59 UTC
Fixed in svn r686977

junit added

Thanks for the bug report.  This bug was introduced in the records aggregates refactoring since 3.1-final (svn r682282-r683880).