https://bz.apache.org/bugzilla/show_bug.cgi?id=62108

            Bug ID: 62108
           Summary: ArrayIndexOfBounds exception when getColumnWidth()
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: XSSF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

XSSFCellStyle::getFontIndex return short and actually cast return of
getFontId() (actually int) to short.
Moreover, getFontId cast long CTXfImpl::getFontId to int.
So in some cases we have double-overflow (long -> int -> short) which cause
ArrayIndexOfBoundsException while trying to autoSizeColumns

Stacktrace:


java.lang.ArrayIndexOutOfBoundsException: -32765
        at java.util.ArrayList.elementData(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)
        at
org.apache.poi.xssf.model.StylesTable.getFontAt(StylesTable.java:204)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.getFontAt(XSSFWorkbook.java:809)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.getFontAt(XSSFWorkbook.java:106)
        at org.apache.poi.ss.util.SheetUtil.getCellWidth(SheetUtil.java:124)
        at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:229)
        at
org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:398)

-- 
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]

Reply via email to