Skip to content

Commit d765941

Browse files
committed
Another instance of a broken Charset?
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1470746 13f79535-47bb-0310-9956-ffa450edef68
1 parent a1f4d43 commit d765941

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,18 @@ private void testAvailableRead(final String csName) throws Exception {
418418
@Test
419419
public void testAvailable() throws Exception {
420420
for (final String csName : Charset.availableCharsets().keySet()) {
421-
// prevent java.lang.UnsupportedOperationException at sun.nio.cs.ext.ISO2022_CN.newEncoder.
422-
if (Charset.forName(csName).canEncode()) {
421+
// prevent java.lang.UnsupportedOperationException at sun.nio.cs.ext.ISO2022_CN.newEncoder.
422+
// also try and avoid the following Effor on Continuum
423+
// java.lang.UnsupportedOperationException: null
424+
// at java.nio.CharBuffer.array(CharBuffer.java:940)
425+
// at sun.nio.cs.ext.COMPOUND_TEXT_Encoder.encodeLoop(COMPOUND_TEXT_Encoder.java:75)
426+
// at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:544)
427+
// at org.apache.commons.io.input.CharSequenceInputStream.fillBuffer(CharSequenceInputStream.java:120)
428+
// at org.apache.commons.io.input.CharSequenceInputStream.read(CharSequenceInputStream.java:151)
429+
// at org.apache.commons.io.input.CharSequenceInputStreamTest.testAvailableRead(CharSequenceInputStreamTest.java:412)
430+
// at org.apache.commons.io.input.CharSequenceInputStreamTest.testAvailable(CharSequenceInputStreamTest.java:424)
431+
432+
if (Charset.forName(csName).canEncode() && ! "COMPOUND_TEXT".equalsIgnoreCase(csName)) {
423433
testAvailableSkip(csName);
424434
testAvailableRead(csName);
425435
}

0 commit comments

Comments
 (0)