jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1767) WebDAV XML serialization in JDK 1.4 broken
Date Sun, 05 Oct 2008 16:34:44 GMT

    [ https://issues.apache.org/jira/browse/JCR-1767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12636910#action_12636910
] 

Julian Reschke commented on JCR-1767:
-------------------------------------

Yes. As far as I can tell, 1.4 is nearing end of life anyway (see <http://java.sun.com/j2se/1.4.2/>).
So maybe we should just park this one, and see that we can accelerate getting rid of the requrement
to support 1.4.

Related to this:  the way SerializingContentHandler.getSerializer() currently works seems
to cause the "probe" happening upon each invocation, which seems to be a very expensive thing
to do. As the outcome of the probe only depends on the VM + loaded classes, maybe the result
should be held in a static variable?




> WebDAV XML serialization in JDK 1.4 broken
> ------------------------------------------
>
>                 Key: JCR-1767
>                 URL: https://issues.apache.org/jira/browse/JCR-1767
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-webdav
>            Reporter: Julian Reschke
>            Priority: Minor
>
> WebDAV uses XmlRequestEntity for serializing XML, which in turn uses org.apache.jackrabbit.commons.xml.SerializingContentHandler
to work around the JDK 1.4 problem (serializing in absence of explicit namespace declarations).
> The following test fails under JDK 1.4, but passed with newer JDKs:
>     public void testXmlSerialization() throws ParserConfigurationException, IOException,
SAXException {
>         
>         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
>         dbf.setNamespaceAware(true);
>         DocumentBuilder db = dbf.newDocumentBuilder();
>         
>         Document doc = db.newDocument();
>         doc.appendChild(doc.createElementNS("DAV:", "propfind"));
>         
>         XmlRequestEntity xmlent = new XmlRequestEntity(doc);
>         ByteArrayOutputStream bos = new ByteArrayOutputStream();
>         xmlent.writeRequest(bos);
>         
>         Document doc2 = db.parse(new ByteArrayInputStream(bos.toByteArray()));
>         Element docelem = doc2.getDocumentElement();
>         assertEquals("DAV:", docelem.getNamespaceURI());
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message