poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1763997 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbookWithCustomZipEntrySource.java
Date Sun, 09 Oct 2016 18:06:46 GMT
Author: onealj
Date: Sun Oct  9 18:06:46 2016
New Revision: 1763997

URL: http://svn.apache.org/viewvc?rev=1763997&view=rev
Log:
bug 60153: java.nio.charset.StandardCharsets is not available until Java 7. Use Charset.forName
for Java 6 compatibility

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbookWithCustomZipEntrySource.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbookWithCustomZipEntrySource.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbookWithCustomZipEntrySource.java?rev=1763997&r1=1763996&r2=1763997&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbookWithCustomZipEntrySource.java
(original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbookWithCustomZipEntrySource.java
Sun Oct  9 18:06:46 2016
@@ -19,7 +19,6 @@
 
 package org.apache.poi.xssf.streaming;
 
-import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -32,9 +31,9 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.nio.charset.Charset;
 import java.security.GeneralSecurityException;
 import java.security.SecureRandom;
-import java.util.ArrayList;
 import java.util.List;
 
 import javax.crypto.Cipher;
@@ -115,6 +114,11 @@ public final class TestSXSSFWorkbookWith
         opc.close();
     }
     
+    // Java 7 and above:
+    // import static java.nio.charset.StandardCharsets.UTF_8;
+    // Java 6 and below:
+    private static final Charset UTF_8 = Charset.forName("UTF-8");
+    
     @Test
     public void validateTempFilesAreEncrypted() throws IOException {
         TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource workbook = new TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message