]> source.dussan.org Git - poi.git/commitdiff
Fixed build (explicitly specified charset for new String(byte[]))
authorVladislav Galas <gallon@apache.org>
Fri, 4 Jan 2019 14:25:11 +0000 (14:25 +0000)
committerVladislav Galas <gallon@apache.org>
Fri, 4 Jan 2019 14:25:11 +0000 (14:25 +0000)
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

index a69916141037d9677b0bae619747639a5eb2e02e..8705ea5094029dc47301194a7c4408bf4506eed1 100644 (file)
@@ -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);