Summary: | [PATCH] java.lang.IndexOutOfBoundsException on row.getRowStyle() | ||
---|---|---|---|
Product: | POI | Reporter: | najh <najh.ru> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | critical | ||
Priority: | P2 | ||
Version: | 3.6-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
Example
[PATCH] Bug 49237 - limit xfIndex read to 12 bits |
Description
najh
2010-04-30 08:07:58 UTC
Created attachment 25385 [details]
Example
Does the problem still occur with a recent nightly build / recent svn checkout? I can verify that this bug still exists in 3.8. I got this error dump: java.lang.IndexOutOfBoundsException: Index: 8400, Size: 589 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at org.apache.poi.hssf.model.WorkbookRecordList.get(WorkbookRecordList.java:50) at org.apache.poi.hssf.model.InternalWorkbook.getExFormatAt(InternalWorkbook.java:832) at org.apache.poi.hssf.usermodel.HSSFRow.getRowStyle(HSSFRow.java:587) at org.apache.poi.hssf.usermodel.HSSFRow.getRowStyle(HSSFRow.java:39) (In reply to comment #3) > I can verify that this bug still exists in 3.8. I got this error dump: > > java.lang.IndexOutOfBoundsException: Index: 8400, Size: 589 > at java.util.ArrayList.RangeCheck(ArrayList.java:547) > at java.util.ArrayList.get(ArrayList.java:322) > at > org.apache.poi.hssf.model.WorkbookRecordList.get(WorkbookRecordList.java:50) > at > org.apache.poi.hssf.model.InternalWorkbook.getExFormatAt(InternalWorkbook. > java:832) > at org.apache.poi.hssf.usermodel.HSSFRow.getRowStyle(HSSFRow.java:587) > at org.apache.poi.hssf.usermodel.HSSFRow.getRowStyle(HSSFRow.java:39) POI can read the attached file and we have a unit test for it. Can you upload a sample file that demonstrates the problem? Created attachment 30993 [details] [PATCH] Bug 49237 - limit xfIndex read to 12 bits Currently the RowRecord class tries to read the full 16 bits for the xfIndex, but spec only specifies 12 bits. (see http://msdn.microsoft.com/en-us/library/dd906757(v=office.12).aspx). In the original test file the higher bits for top and border bottom were also set, so this led to the wrong style index |