diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java index 2ba065b766..5e65241e46 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFBuiltinTableStyle.java @@ -20,7 +20,6 @@ package org.apache.poi.xssf.usermodel; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.StringWriter; import java.nio.charset.StandardCharsets; import java.util.EnumMap; import java.util.Map; @@ -31,6 +30,7 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.apache.commons.io.output.StringBuilderWriter; import org.apache.poi.ooxml.util.DocumentHelper; import org.apache.poi.ss.usermodel.DifferentialStyleProvider; import org.apache.poi.ss.usermodel.TableStyle; @@ -428,7 +428,7 @@ public enum XSSFBuiltinTableStyle { // add a dummy node to adjust properly. dxfsNode.insertBefore(dxfsNode.getOwnerDocument().createElement("dxf"), dxfsNode.getFirstChild()); - StringBuilder sb = new StringBuilder(); + StringBuilder sb = new StringBuilder(1024); sb.append("\n") .append("