You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by ra...@apache.org on 2004/11/18 23:47:48 UTC

cvs commit: xml-security/src/org/apache/xml/security/c14n/implementations Canonicalizer20010315.java

raul        2004/11/18 14:47:48

  Modified:    src/org/apache/xml/security/c14n/implementations
                        Canonicalizer20010315.java
  Log:
  Transforms all the Constants references to a own static member, reduce memory needs & improves performance
  
  Revision  Changes    Path
  1.35      +12 -10    xml-security/src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315.java
  
  Index: Canonicalizer20010315.java
  ===================================================================
  RCS file: /home/cvs/xml-security/src/org/apache/xml/security/c14n/implementations/Canonicalizer20010315.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Canonicalizer20010315.java	24 Sep 2004 20:54:29 -0000	1.34
  +++ Canonicalizer20010315.java	18 Nov 2004 22:47:47 -0000	1.35
  @@ -44,6 +44,8 @@
    */
   public abstract class Canonicalizer20010315 extends CanonicalizerBase {
   	boolean firstCall=true;
  +    static final String XMLNS_URI=Constants.NamespaceSpecNS;
  +    static final String XML_LANG_URI=Constants.XML_LANG_SPACE_SpecNS;
      /**
       * Constructor Canonicalizer20010315
       *
  @@ -83,14 +85,14 @@
            String NValue=N.getValue();
            String NUri =N.getNamespaceURI();
   
  -         if (!Constants.NamespaceSpecNS.equals(NUri)) {
  +         if (!XMLNS_URI.equals(NUri)) {
            	//It's not a namespace attr node. Add to the result and continue.
               result.add(N);
               continue;
            }
            
            if (XML.equals(NName)
  -                 && Constants.XML_LANG_SPACE_SpecNS.equals(NValue)) {
  +                 && XML_LANG_URI.equals(NValue)) {
            	//The default mapping for xml must not be output.
            	continue;
            }
  @@ -148,12 +150,12 @@
                     // for all attributes in the ancestor element
                     Attr currentAncestorAttr = (Attr) ancestorAttrs.item(i);
   
  -                  if (Constants.XML_LANG_SPACE_SpecNS.equals(
  +                  if (XML_LANG_URI.equals(
                             currentAncestorAttr.getNamespaceURI())) {
   
                        // do we have an xml:* ?
                        if (!E.hasAttributeNS(
  -                             Constants.XML_LANG_SPACE_SpecNS,
  +                             XML_LANG_URI,
                                currentAncestorAttr.getLocalName())) {
   
                           // the xml:* attr is not in E
  @@ -203,7 +205,7 @@
          String NValue=N.getValue();
          String NUri =N.getNamespaceURI();
          
  -       if (!Constants.NamespaceSpecNS.equals(NUri)) {
  +       if (!XMLNS_URI.equals(NUri)) {
          	  //A non namespace definition node.
          	  if (isRealVisible){
          		//The node is visible add the attribute to the list of output attributes.
  @@ -215,7 +217,7 @@
   
                 
          if ("xml".equals(NName)
  -               && Constants.XML_LANG_SPACE_SpecNS.equals(NValue)) {
  +               && XML_LANG_URI.equals(NValue)) {
             /* except omit namespace node with local name xml, which defines
              * the xml prefix, if its string value is http://www.w3.org/XML/1998/namespace.
              */
  @@ -238,7 +240,7 @@
       }
       if (isRealVisible) {    	           
       	//The element is visible, handle the xmlns definition        
  -        Attr xmlns = E.getAttributeNodeNS(Constants.NamespaceSpecNS, "xmlns");
  +        Attr xmlns = E.getAttributeNodeNS(XMLNS_URI, XMLNS);
           Node n=null;
           if (xmlns == null) {
           	//No xmlns def just get the already defined.
  @@ -302,12 +304,12 @@
                     // for all attributes in the ancestor element
                     Attr currentAncestorAttr = (Attr) ancestorAttrs.item(i);
   
  -                  if (Constants.XML_LANG_SPACE_SpecNS.equals(
  +                  if (XML_LANG_URI.equals(
                             currentAncestorAttr.getNamespaceURI())) {
   
                        // do we have an xml:* ?
                        if (!E.hasAttributeNS(
  -                             Constants.XML_LANG_SPACE_SpecNS,
  +                             XML_LANG_URI,
                                currentAncestorAttr.getLocalName())) {
   
                           // the xml:* attr is not in E