You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2012/09/25 17:50:18 UTC

svn commit: r1389944 - in /santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security: c14n/implementations/CanonicalizerBase.java c14n/implementations/UtfHelpper.java utils/UnsyncBufferedOutputStream.java

Author: coheigea
Date: Tue Sep 25 15:50:17 2012
New Revision: 1389944

URL: http://svn.apache.org/viewvc?rev=1389944&view=rev
Log:
Some minor cleanup stuff

Modified:
    santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java
    santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/UtfHelpper.java
    santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/utils/UnsyncBufferedOutputStream.java

Modified: santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java?rev=1389944&r1=1389943&r2=1389944&view=diff
==============================================================================
--- santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java (original)
+++ santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/CanonicalizerBase.java Tue Sep 25 15:50:17 2012
@@ -552,8 +552,7 @@ public abstract class CanonicalizerBase 
         if (nodeFilter != null) {
             Iterator<NodeFilter> it = nodeFilter.iterator();
             while (it.hasNext()) {   			
-                int i = (
-                    it.next()).isNodeInclude(currentNode);
+                int i = (it.next()).isNodeInclude(currentNode);
                 if (i != 1) {
                     return i;
                 }
@@ -623,7 +622,7 @@ public abstract class CanonicalizerBase 
             return;
         }
         //Obtain all the parents of the element
-        List<Element> parents = new ArrayList<Element>(10);
+        List<Element> parents = new ArrayList<Element>();
         Node parent = n1;
         while (parent != null && Node.ELEMENT_NODE == parent.getNodeType()) {
             parents.add((Element)parent);
@@ -635,6 +634,7 @@ public abstract class CanonicalizerBase 
             Element ele = it.previous();
             handleParent(ele, ns);
         }
+        parents.clear();
         Attr nsprefix;
         if (((nsprefix = ns.getMappingWithoutRendered(XMLNS)) != null) 
             && "".equals(nsprefix.getValue())) {

Modified: santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/UtfHelpper.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/UtfHelpper.java?rev=1389944&r1=1389943&r2=1389944&view=diff
==============================================================================
--- santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/UtfHelpper.java (original)
+++ santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/c14n/implementations/UtfHelpper.java Tue Sep 25 15:50:17 2012
@@ -121,7 +121,7 @@ public class UtfHelpper {
     public static final byte[] getStringInUtf8(final String str) {
         final int length = str.length();
         boolean expanded = false;
-        byte []result = new byte[length];
+        byte[] result = new byte[length];
         int i = 0;
         int out = 0;
         char c;    

Modified: santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/utils/UnsyncBufferedOutputStream.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/utils/UnsyncBufferedOutputStream.java?rev=1389944&r1=1389943&r2=1389944&view=diff
==============================================================================
--- santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/utils/UnsyncBufferedOutputStream.java (original)
+++ santuario/xml-security-java/branches/1.5.x-fixes/src/main/java/org/apache/xml/security/utils/UnsyncBufferedOutputStream.java Tue Sep 25 15:50:17 2012
@@ -72,7 +72,7 @@ public class UnsyncBufferedOutputStream 
         if (pointer > 0) {
             out.write(buf, 0, pointer);
         }
-        pointer=0;
+        pointer = 0;
 
     }
 
@@ -94,6 +94,7 @@ public class UnsyncBufferedOutputStream 
     /** @inheritDoc */
     public void close() throws IOException {
         flush();
+        out.close();
         bufCache.remove();
     }