You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2014/05/01 16:22:49 UTC

[jira] [Closed] (SANTUARIO-349) Update JCP dsig code to simplify serialization

     [ https://issues.apache.org/jira/browse/SANTUARIO-349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh closed SANTUARIO-349.
-----------------------------------------


> Update JCP dsig code to simplify serialization
> ----------------------------------------------
>
>                 Key: SANTUARIO-349
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-349
>             Project: Santuario
>          Issue Type: Improvement
>      Security Level: Public(Public issues, viewable by everyone) 
>          Components: Java
>    Affects Versions: Java 1.5.2, Java 1.5.3
>            Reporter: Eric Johnson
>            Assignee: Colm O hEigeartaigh
>              Labels: enhancement, serialization
>             Fix For: Java 2.0.0
>
>         Attachments: SANTUARIO-349-try2.patch, SANTUARIO-349.patch
>
>
> In working on the Santuario port to GenXDM, I discovered that the serialization code for the org.apache.jcp.xml.dsig.internal.dom package turns out to be highly repetitive.
> For example, code like this:
>         Document ownerDoc = DOMUtils.getOwnerDocument(parent);
>         // prepend namespace prefix, if necessary
>         Element knElem = DOMUtils.createElement(ownerDoc, "KeyName",
>                                                 XMLSignature.XMLNS, dsPrefix);
>         knElem.appendChild(ownerDoc.createTextNode(name));
>         parent.appendChild(knElem);
> can be replaced by:
>         xwriter.writeTextElement(dsPrefix, "KeyName", XMLSignature.XMLNS, keyName.getName());
> ... which both reduces the amount of code, and better exposes the intent.



--
This message was sent by Atlassian JIRA
(v6.2#6252)