Summary: | [PATCH] ArrayIndexOutOfBoundsException in ValueRecordsAggregate.rowHasCells | ||
---|---|---|---|
Product: | POI | Reporter: | Julien Aymé <julien.ayme> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | Keywords: | PatchAvailable |
Priority: | P2 | ||
Version: | 3.0-dev | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | other | ||
Attachments: |
Patch for the class org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate
Patch for the class org.apache.poi.hssf.record.aggregates.TestValueRecordsAggregate |
Description
Julien Aymé
2006-11-23 05:45:27 UTC
Created attachment 19166 [details]
Patch for the class org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate
A little bug: just an '>=' instead of '>' and its all done.
Created attachment 19167 [details]
Patch for the class org.apache.poi.hssf.record.aggregates.TestValueRecordsAggregate
Adds a test corresponding to the bug.
(In reply to comment #0) > Calling the method ValueRecordsAgregate.rowHasCells(int) with the parameter > equals to the length of the records throws an ArrayIndexOutOfBoundsException. > This happened when I called the method HSSFWorkbook.write(OutputStream): > > The stacktrace: > java.lang.ArrayIndexOutOfBoundsException: 30 > at > org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.rowHasCells(ValueRecordsAggregate.java:195) > at org.apache.poi.hssf.model.Sheet.getSize(Sheet.java:2112) > at org.apache.poi.hssf.usermodel.HSSFWorkbook.getBytes(HSSFWorkbook.java:920) > at org.apache.poi.hssf.usermodel.HSSFWorkbook.write(HSSFWorkbook.java:875) > > I join two patches: > One for ValueRecordsAggregate, and one for TestValueRecordsAggregate. Modifying the source of org.apache.poi.hssf.record.aggregates.ValueRecordsAggregate.rowHasCells method dosent work either. [ if (row >= records.length) ] Same exception is thrown again. Can someone please put in a testcase that triggers this bug? Its quite difficult to fix otherwise. Thanks. The same expection is thrown now on reading the file attached to Bug 37684 . Without a testcase here, cannot confirm if the bug is the same... the symptoms seem similar. The attached patch does not fix this. This has been fixed with the commit <a href="http://svn.apache.org/viewvc?view=rev&revision=513609">#513609</a> |