From: Vladislav Galas Date: Fri, 4 Jan 2019 14:25:11 +0000 (+0000) Subject: Fixed build (explicitly specified charset for new String(byte[])) X-Git-Tag: REL_4_1_0~122 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6d87e362275dd335f2c661cb48ac27a63f556043;p=poi.git Fixed build (explicitly specified charset for new String(byte[])) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1850366 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java index a699161410..8705ea5094 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java @@ -26,6 +26,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -1166,7 +1167,7 @@ public abstract class BaseTestCell { assertEquals(CellType.NUMERIC, cell.getCellType()); int badLength = cell.getSheet().getWorkbook().getSpreadsheetVersion().getMaxTextLength() + 1; - String badStringValue = new String(new byte[badLength]); + String badStringValue = new String(new byte[badLength], StandardCharsets.UTF_8); try { cell.setCellValue(badStringValue); @@ -1188,7 +1189,7 @@ public abstract class BaseTestCell { int badLength = cell.getSheet().getWorkbook().getSpreadsheetVersion().getMaxTextLength() + 1; RichTextString badStringValue = cell.getSheet().getWorkbook().getCreationHelper(). - createRichTextString(new String(new byte[badLength])); + createRichTextString(new String(new byte[badLength], StandardCharsets.UTF_8)); try { cell.setCellValue(badStringValue);