https://issues.apache.org/bugzilla/show_bug.cgi?id=52348
Bug #: 52348
Summary: XSSFWorkbook#createCellStyle() fails with
ArrayIndexOutOfBoundsException
Product: POI
Version: 3.8-dev
Platform: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Created attachment 28079
--> https://issues.apache.org/bugzilla/attachment.cgi?id=28079
5 files showing the issue
This is a bug resulting from a discussion on the mailing list
http://apache-poi.1045710.n5.nabble.com/XSSFWorkbook-createCellStyle-fails-with-ArrayIndexOutOfBoundsException-td5033683.html
I am attaching 5 files (two input xlsx files with the output xlsx you can
obtain yourself if you run the JUnit class that uses the Util class). One is a
util class that should allow me to merge two XLSX books and the other a JUnit
test that cannot run and creates an output file where the style for the second
sheet is missing.
Look for the below lines and uncomment the code in the Util class then run the
test again. The Exception will be thrown:
//BUG: The below produces:
/*
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(ArrayList.java:324)
at
org.apache.poi.xssf.model.StylesTable.getCellStyleXfAt(StylesTable.java:305)
at
org.apache.poi.xssf.usermodel.XSSFCellStyle.<init>(XSSFCellStyle.java:79)
at
org.apache.poi.xssf.model.StylesTable.createCellStyle(StylesTable.java:521)
at
org.apache.poi.xssf.usermodel.XSSFWorkbook.createCellStyle(XSSFWorkbook.java:443)
*/
//newCellStyle =
newCell.getSheet().getWorkbook().createCellStyle();
//newCellStyle.cloneStyleFrom(oldCell.getCellStyle());
//styleMap.put(stHashCode, newCellStyle);
Thanks!
-Nestor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]