You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Eric Johnson (JIRA)" <ji...@apache.org> on 2012/11/21 20:55:59 UTC

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

Eric Johnson created SANTUARIO-349:
--------------------------------------

             Summary: Update JCP dsig code to simplify serialization
                 Key: SANTUARIO-349
                 URL: https://issues.apache.org/jira/browse/SANTUARIO-349
             Project: Santuario
          Issue Type: Improvement
          Components: Java
    Affects Versions: Java 1.5.3, Java 1.5.2
            Reporter: Eric Johnson
            Assignee: Colm O hEigeartaigh


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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Posted by "Eric Johnson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Johnson updated SANTUARIO-349:
-----------------------------------

    Attachment: SANTUARIO-349.patch

Patch to update serialization code.
                
> Update JCP dsig code to simplify serialization
> ----------------------------------------------
>
>                 Key: SANTUARIO-349
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-349
>             Project: Santuario
>          Issue Type: Improvement
>          Components: Java
>    Affects Versions: Java 1.5.2, Java 1.5.3
>            Reporter: Eric Johnson
>            Assignee: Colm O hEigeartaigh
>              Labels: enhancement, serialization
>         Attachments: 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira