From d0e9e4bc6ddc15fcc8ebe601df74250eae47b308 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 16 Feb 2018 11:47:24 +0000 Subject: [PATCH] Unit test to try to reproduce bug #62108 (currenly works though...) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1824451 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 131b441d64..fe8cafcaac 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -3252,4 +3252,45 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { wb.close(); } + + /** + * Auto column sizing failed when there were loads of fonts with + * errors like ArrayIndexOutOfBoundsException: -32765 + * TODO Get this to actually reproduce the bug... + */ + @Test + public void test62108() throws IOException { + XSSFWorkbook wb = new XSSFWorkbook(); + XSSFSheet sheet = wb.createSheet(); + XSSFRow row = sheet.createRow(0); + + // Create lots of fonts + XSSFDataFormat formats = wb.createDataFormat(); + XSSFFont[] fonts = new XSSFFont[50000]; + for (int i=0; i