-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b15
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045779 | 8u25 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8052454 | emb-8u26 | Aleksej Efimov | P3 | Resolved | Fixed | b17 |
JDK-8042468 | 7u80 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8060920 | 7u79 | Aleksej Efimov | P3 | Resolved | Fixed | b01 |
JDK-8057345 | 7u76 | Aleksej Efimov | P3 | Closed | Fixed | b01 |
FULL PRODUCT VERSION :
java version " 1.7.0_09 "
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux myhost 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
DOM Serializer prints stack traces to System.err when underlying output stream throws IOException.
REGRESSION. Last worked in version 7
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run test case provided below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect the following output in System.err:
Exception
ACTUAL -
java.io.IOException
at DOMSerializerBugReproduction$1.write(DOMSerializerBugReproduction.java:26)
at java.io.OutputStream.write(OutputStream.java:116)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
at com.sun.org.apache.xml.internal.serialize.Printer.flush(Printer.java:324)
at com.sun.org.apache.xml.internal.serialize.XMLSerializer.serializeElement(XMLSerializer.java:1092)
at com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.serializeNode(BaseMarkupSerializer.java:1193)
at com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.serializeNode(BaseMarkupSerializer.java:1268)
at com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.serialize(BaseMarkupSerializer.java:471)
at com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.write(DOMSerializerImpl.java:808)
at DOMSerializerBugReproduction.main(DOMSerializerBugReproduction.java:33)
Exception
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.io.OutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSOutput;
import org.w3c.dom.ls.LSSerializer;
public class DOMSerializerBugReproduction {
public static void main(String[] args) {
try {
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = documentBuilder.newDocument();
Element root = document.createElement( " test " );
document.appendChild(root);
OutputStream out = new OutputStream() {
@Override
public void write(int b) throws IOException {
throw new IOException();
}
};
DOMImplementationLS implementation = (DOMImplementationLS) document.getImplementation();
LSOutput lsOutput = implementation.createLSOutput();
lsOutput.setByteStream(out);
LSSerializer lsSerializer = implementation.createLSSerializer();
lsSerializer.write(document, lsOutput);
out.flush();
} catch (Exception e) {
System.err.println( " Exception " );
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
doesn't exist
java version " 1.7.0_09 "
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux myhost 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
DOM Serializer prints stack traces to System.err when underlying output stream throws IOException.
REGRESSION. Last worked in version 7
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run test case provided below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect the following output in System.err:
Exception
ACTUAL -
java.io.IOException
at DOMSerializerBugReproduction$1.write(DOMSerializerBugReproduction.java:26)
at java.io.OutputStream.write(OutputStream.java:116)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
at com.sun.org.apache.xml.internal.serialize.Printer.flush(Printer.java:324)
at com.sun.org.apache.xml.internal.serialize.XMLSerializer.serializeElement(XMLSerializer.java:1092)
at com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.serializeNode(BaseMarkupSerializer.java:1193)
at com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.serializeNode(BaseMarkupSerializer.java:1268)
at com.sun.org.apache.xml.internal.serialize.BaseMarkupSerializer.serialize(BaseMarkupSerializer.java:471)
at com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl.write(DOMSerializerImpl.java:808)
at DOMSerializerBugReproduction.main(DOMSerializerBugReproduction.java:33)
Exception
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.io.OutputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.ls.DOMImplementationLS;
import org.w3c.dom.ls.LSOutput;
import org.w3c.dom.ls.LSSerializer;
public class DOMSerializerBugReproduction {
public static void main(String[] args) {
try {
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document document = documentBuilder.newDocument();
Element root = document.createElement( " test " );
document.appendChild(root);
OutputStream out = new OutputStream() {
@Override
public void write(int b) throws IOException {
throw new IOException();
}
};
DOMImplementationLS implementation = (DOMImplementationLS) document.getImplementation();
LSOutput lsOutput = implementation.createLSOutput();
lsOutput.setByteStream(out);
LSSerializer lsSerializer = implementation.createLSSerializer();
lsSerializer.write(document, lsOutput);
out.flush();
} catch (Exception e) {
System.err.println( " Exception " );
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
doesn't exist
- backported by
-
JDK-8042468 DOM Serializer prints stack traces to System.err
- Resolved
-
JDK-8045779 DOM Serializer prints stack traces to System.err
- Resolved
-
JDK-8052454 DOM Serializer prints stack traces to System.err
- Resolved
-
JDK-8060920 DOM Serializer prints stack traces to System.err
- Resolved
-
JDK-8057345 DOM Serializer prints stack traces to System.err
- Closed