Bug6451633.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
@Test
public void test() throws Exception {
    TransformerHandler th = ((SAXTransformerFactory) TransformerFactory.newInstance()).newTransformerHandler();

    DOMResult result = new DOMResult();
    th.setResult(result);

    th.startDocument();
    th.startElement("", "root", "root", new AttributesImpl());
    th.characters(new char[0], 0, 0);
    th.endElement("", "root", "root");
    th.endDocument();

    // there's no point in having empty text --- we should remove it
    Assert.assertEquals(0, ((Document) result.getNode()).getDocumentElement().getChildNodes().getLength());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号