From 6d87e362275dd335f2c661cb48ac27a63f556043 Mon Sep 17 00:00:00 2001 From: Vladislav Galas Date: Fri, 4 Jan 2019 14:25:11 +0000 Subject: [PATCH] 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 --- src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);