ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gi...@apache.org
Subject svn commit: r1337945 [5/5] - in /webservices/wss4j/branches/swssf: ./ cxf-integration/src/main/java/org/swssf/cxfIntegration/interceptor/ cxf-integration/src/test/java/org/swssf/cxfIntegration/test/integration/ cxf-integration/src/test/resources/ cxf-i...
Date Sun, 13 May 2012 17:27:13 GMT
Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractEncryptOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractEncryptOutputProcessor.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractEncryptOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractEncryptOutputProcessor.java Sun May 13 17:27:10 2012
@@ -29,14 +29,10 @@ import javax.crypto.Cipher;
 import javax.crypto.CipherOutputStream;
 import javax.crypto.NoSuchPaddingException;
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLEventFactory;
 import javax.xml.stream.XMLEventWriter;
 import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.Characters;
-import javax.xml.stream.events.EndElement;
-import javax.xml.stream.events.StartElement;
-import javax.xml.stream.events.XMLEvent;
+import javax.xml.stream.events.*;
 import java.io.BufferedOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -44,7 +40,9 @@ import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * Processor to encrypt XML structures
@@ -54,6 +52,17 @@ import java.util.*;
  */
 public abstract class AbstractEncryptOutputProcessor extends AbstractOutputProcessor {
 
+    private static final XMLOutputFactory xmlOutputFactory;
+    private static final StartElement wrapperStartElement;
+    private static final EndElement wrapperEndElement;
+
+    static {
+        xmlOutputFactory = XMLOutputFactory.newInstance();
+        xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, false);
+        wrapperStartElement = XMLSecurityConstants.XMLEVENTFACTORY.createStartElement(new QName("a"), null, null);
+        wrapperEndElement = XMLSecurityConstants.XMLEVENTFACTORY.createEndElement(new QName("a"), null);
+    }
+
     private AbstractInternalEncryptionOutputProcessor activeInternalEncryptionOutputProcessor = null;
 
     public AbstractEncryptOutputProcessor() throws XMLSecurityException {
@@ -91,9 +100,9 @@ public abstract class AbstractEncryptOut
                 throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IOException, XMLStreamException {
 
             super();
-            this.getBeforeProcessors().add(AbstractEncryptEndingOutputProcessor.class.getName());
-            this.getBeforeProcessors().add(AbstractInternalEncryptionOutputProcessor.class.getName());
-            this.getAfterProcessors().add(AbstractEncryptOutputProcessor.class.getName());
+            this.addBeforeProcessor(AbstractEncryptEndingOutputProcessor.class.getName());
+            this.addBeforeProcessor(AbstractInternalEncryptionOutputProcessor.class.getName());
+            this.addAfterProcessor(AbstractEncryptOutputProcessor.class.getName());
             this.setEncryptionPartDef(encryptionPartDef);
             this.setStartElement(startElement);
             this.setEncoding(encoding);
@@ -127,12 +136,10 @@ public abstract class AbstractEncryptOut
                 cipherOutputStream = new TrimmerOutputStream(outputStream, 8192, 3, 4);
 
                 //we create a new StAX writer for optimized namespace writing.
-                XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newInstance();
-                xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, false);
                 //spec says (4.2): "The cleartext octet sequence obtained in step 3 is interpreted as UTF-8 encoded character data."
                 xmlEventWriter = xmlOutputFactory.createXMLEventWriter(cipherOutputStream, "UTF-8");
                 //we have to output a fake element to workaround text-only encryption:
-                xmlEventWriter.add(XMLEventFactory.newInstance().createStartElement(new QName("a"), null, null));
+                xmlEventWriter.add(wrapperStartElement);
             } catch (NoSuchPaddingException e) {
                 throw new XMLSecurityException(XMLSecurityException.ErrorCode.FAILED_ENCRYPTION, e);
             } catch (NoSuchAlgorithmException e) {
@@ -160,10 +167,9 @@ public abstract class AbstractEncryptOut
         public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
 
             if (xmlEvent.isStartElement()) {
-
                 StartElement startElement = xmlEvent.asStartElement();
 
-                if (startElement.getName().equals(this.getStartElement().getName()) && getElementCounter() == 0) {
+                if (this.elementCounter == 0 && startElement.getName().equals(this.getStartElement().getName())) {
                     //if the user selected element encryption we have to encrypt the current element-event...
                     if (getEncryptionPartDef().getModifier() == SecurePart.Modifier.Element) {
                         subOutputProcessorChain = outputProcessorChain.createSubChain(this);
@@ -181,14 +187,12 @@ public abstract class AbstractEncryptOut
                     encryptEvent(xmlEvent);
                 }
 
-                setElementCounter(getElementCounter() + 1);
+                this.elementCounter++;
 
             } else if (xmlEvent.isEndElement()) {
-                setElementCounter(getElementCounter() - 1);
-
-                EndElement endElement = xmlEvent.asEndElement();
+                this.elementCounter--;
 
-                if (endElement.getName().equals(this.getStartElement().getName()) && getElementCounter() == 0) {
+                if (this.elementCounter == 0 && xmlEvent.asEndElement().getName().equals(this.getStartElement().getName())) {
                     if (getEncryptionPartDef().getModifier() == SecurePart.Modifier.Element) {
                         encryptEvent(xmlEvent);
                         doFinalInternal(subOutputProcessorChain);
@@ -227,23 +231,23 @@ public abstract class AbstractEncryptOut
          * Creates the Data structure around the cipher data
          */
         protected void processEventInternal(OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
-            Map<QName, String> attributes = null;
+            List<Attribute> attributes = null;
 
-            attributes = new HashMap<QName, String>();
-            attributes.put(XMLSecurityConstants.ATT_NULL_Id, getEncryptionPartDef().getEncRefId());
-            attributes.put(XMLSecurityConstants.ATT_NULL_Type, getEncryptionPartDef().getModifier().getModifier());
-            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_EncryptedData, attributes);
-
-            attributes = new HashMap<QName, String>();
-            attributes.put(XMLSecurityConstants.ATT_NULL_Algorithm, securityProperties.getEncryptionSymAlgorithm());
-            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_EncryptionMethod, attributes);
+            attributes = new ArrayList<Attribute>(2);
+            attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Id, getEncryptionPartDef().getEncRefId()));
+            attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Type, getEncryptionPartDef().getModifier().getModifier()));
+            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_EncryptedData, true, attributes);
+
+            attributes = new ArrayList<Attribute>(1);
+            attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Algorithm, securityProperties.getEncryptionSymAlgorithm()));
+            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_EncryptionMethod, false, attributes);
 
             createEndElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_EncryptionMethod);
-            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_dsig_KeyInfo, null);
+            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_dsig_KeyInfo, true, null);
             createKeyInfoStructure(outputProcessorChain);
             createEndElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_dsig_KeyInfo);
-            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_CipherData, null);
-            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_CipherValue, null);
+            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_CipherData, false, null);
+            createStartElementAndOutputAsEvent(outputProcessorChain, XMLSecurityConstants.TAG_xenc_CipherValue, false, null);
 
             /*
             <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="EncDataId-1612925417"
@@ -270,7 +274,7 @@ public abstract class AbstractEncryptOut
         protected void doFinalInternal(OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
 
             try {
-                xmlEventWriter.add(XMLEventFactory.newInstance().createEndElement(new QName("a"), null));
+                xmlEventWriter.add(wrapperEndElement);
                 //close the event writer to flush all outstanding events to the encrypt stream
                 xmlEventWriter.close();
                 //call close to force a cipher.doFinal()
@@ -308,14 +312,6 @@ public abstract class AbstractEncryptOut
             this.startElement = startElement;
         }
 
-        protected int getElementCounter() {
-            return elementCounter;
-        }
-
-        protected void setElementCounter(int elementCounter) {
-            this.elementCounter = elementCounter;
-        }
-
         public String getEncoding() {
             return encoding;
         }
@@ -330,7 +326,7 @@ public abstract class AbstractEncryptOut
      */
     public class CharacterEventGeneratorOutputStream extends OutputStream {
 
-        private List<Characters> charactersBuffer = new LinkedList<Characters>();
+        private List<Characters> charactersBuffer = new ArrayList<Characters>();
         private String encoding;
 
         public CharacterEventGeneratorOutputStream(String encoding) {
@@ -343,17 +339,17 @@ public abstract class AbstractEncryptOut
 
         @Override
         public void write(int b) throws IOException {
-            charactersBuffer.add(createCharacters(new String(new byte[]{((byte) b)}, encoding)).asCharacters());
+            charactersBuffer.add(createCharacters(new String(new byte[]{((byte) b)}, encoding)));
         }
 
         @Override
         public void write(byte[] b) throws IOException {
-            charactersBuffer.add(createCharacters(new String(b, encoding)).asCharacters());
+            charactersBuffer.add(createCharacters(new String(b, encoding)));
         }
 
         @Override
         public void write(byte[] b, int off, int len) throws IOException {
-            charactersBuffer.add(createCharacters(new String(b, off, len, encoding)).asCharacters());
+            charactersBuffer.add(createCharacters(new String(b, off, len, encoding)));
         }
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureEndingOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureEndingOutputProcessor.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureEndingOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureEndingOutputProcessor.java Sun May 13 17:27:10 2012
@@ -26,8 +26,8 @@ import org.swssf.xmlsec.impl.algorithms.
 import org.swssf.xmlsec.impl.util.IDGenerator;
 import org.swssf.xmlsec.impl.util.SignerOutputStream;
 
-import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.Attribute;
 import javax.xml.stream.events.XMLEvent;
 import java.io.BufferedOutputStream;
 import java.io.IOException;
@@ -35,7 +35,9 @@ import java.io.OutputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * @author $Author$
@@ -90,9 +92,9 @@ public abstract class AbstractSignatureE
 
         OutputProcessorChain subOutputProcessorChain = outputProcessorChain.createSubChain(this);
 
-        Map<QName, String> attributes = new HashMap<QName, String>();
-        attributes.put(XMLSecurityConstants.ATT_NULL_Id, IDGenerator.generateID(null));
-        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Signature, attributes);
+        List<Attribute> attributes = new ArrayList<Attribute>(1);
+        attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Id, IDGenerator.generateID(null)));
+        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Signature, true, attributes);
 
         SignatureAlgorithm signatureAlgorithm;
 
@@ -121,33 +123,33 @@ public abstract class AbstractSignatureE
 
         SignedInfoProcessor signedInfoProcessor = newSignedInfoProcessor(signatureAlgorithm, subOutputProcessorChain);
 
-        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignedInfo, null);
+        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignedInfo, false, null);
 
-        attributes = new HashMap<QName, String>();
-        attributes.put(XMLSecurityConstants.ATT_NULL_Algorithm, getSecurityProperties().getSignatureCanonicalizationAlgorithm());
-        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_CanonicalizationMethod, attributes);
+        attributes = new ArrayList<Attribute>(1);
+        attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Algorithm, getSecurityProperties().getSignatureCanonicalizationAlgorithm()));
+        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_CanonicalizationMethod, false, attributes);
         createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_CanonicalizationMethod);
 
-        attributes = new HashMap<QName, String>();
-        attributes.put(XMLSecurityConstants.ATT_NULL_Algorithm, getSecurityProperties().getSignatureAlgorithm());
-        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignatureMethod, attributes);
+        attributes = new ArrayList<Attribute>(1);
+        attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Algorithm, getSecurityProperties().getSignatureAlgorithm()));
+        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignatureMethod, false, attributes);
         createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignatureMethod);
 
         Iterator<SignaturePartDef> signaturePartDefIterator = signaturePartDefList.iterator();
         while (signaturePartDefIterator.hasNext()) {
             SignaturePartDef signaturePartDef = signaturePartDefIterator.next();
-            attributes = new HashMap<QName, String>();
-            attributes.put(XMLSecurityConstants.ATT_NULL_URI, "#" + signaturePartDef.getSigRefId());
-            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Reference, attributes);
-            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Transforms, null);
+            attributes = new ArrayList<Attribute>(1);
+            attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_URI, "#" + signaturePartDef.getSigRefId()));
+            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Reference, false, attributes);
+            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Transforms, false, null);
             createTransformsStructureForSignature(subOutputProcessorChain, signaturePartDef);
             createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Transforms);
 
-            attributes = new HashMap<QName, String>();
-            attributes.put(XMLSecurityConstants.ATT_NULL_Algorithm, getSecurityProperties().getSignatureDigestAlgorithm());
-            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestMethod, attributes);
+            attributes = new ArrayList<Attribute>(1);
+            attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Algorithm, getSecurityProperties().getSignatureDigestAlgorithm()));
+            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestMethod, false, attributes);
             createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestMethod);
-            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestValue, null);
+            createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestValue, false, null);
             createCharactersAndOutputAsEvent(subOutputProcessorChain, signaturePartDef.getDigestValue());
             createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_DigestValue);
             createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Reference);
@@ -156,14 +158,14 @@ public abstract class AbstractSignatureE
         createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignedInfo);
         subOutputProcessorChain.removeProcessor(signedInfoProcessor);
 
-        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignatureValue, null);
+        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignatureValue, false, null);
         final byte[] signatureValue = signedInfoProcessor.getSignatureValue();
         createCharactersAndOutputAsEvent(subOutputProcessorChain, new Base64(76, new byte[]{'\n'}).encodeToString(signatureValue));
         createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_SignatureValue);
 
-        attributes = new HashMap<QName, String>();
-        attributes.put(XMLSecurityConstants.ATT_NULL_Id, IDGenerator.generateID(null));
-        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_KeyInfo, attributes);
+        attributes = new ArrayList<Attribute>(1);
+        attributes.add(createAttribute(XMLSecurityConstants.ATT_NULL_Id, IDGenerator.generateID(null)));
+        createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_KeyInfo, false, attributes);
         createKeyInfoStructureForSignature(subOutputProcessorChain, wrappingSecurityToken, getSecurityProperties().isUseSingleCert());
         createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_KeyInfo);
         createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_dsig_Signature);
@@ -173,7 +175,7 @@ public abstract class AbstractSignatureE
         SignedInfoProcessor signedInfoProcessor = new SignedInfoProcessor(signatureAlgorithm);
         signedInfoProcessor.setXMLSecurityProperties(getSecurityProperties());
         signedInfoProcessor.setAction(getAction());
-        signedInfoProcessor.getAfterProcessors().add(AbstractSignatureEndingOutputProcessor.class.getName());
+        signedInfoProcessor.addAfterProcessor(AbstractSignatureEndingOutputProcessor.class.getName());
         signedInfoProcessor.init(outputProcessorChain);
         return signedInfoProcessor;
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureOutputProcessor.java Sun May 13 17:27:10 2012
@@ -19,6 +19,8 @@
 package org.swssf.xmlsec.impl.processor.output;
 
 import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.swssf.xmlsec.config.JCEAlgorithmMapper;
 import org.swssf.xmlsec.ext.*;
 import org.swssf.xmlsec.impl.SignaturePartDef;
@@ -27,7 +29,6 @@ import org.xmlsecurity.ns.configuration.
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.events.EndElement;
 import javax.xml.stream.events.XMLEvent;
 import java.io.BufferedOutputStream;
 import java.io.IOException;
@@ -37,7 +38,6 @@ import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
 import java.util.ArrayList;
-import java.util.LinkedList;
 import java.util.List;
 
 /**
@@ -46,7 +46,9 @@ import java.util.List;
  */
 public abstract class AbstractSignatureOutputProcessor extends AbstractOutputProcessor {
 
-    private List<SignaturePartDef> signaturePartDefList = new LinkedList<SignaturePartDef>();
+    private static final transient Log logger = LogFactory.getLog(AbstractSignatureOutputProcessor.class);
+
+    private List<SignaturePartDef> signaturePartDefList = new ArrayList<SignaturePartDef>();
 
     private InternalSignatureOutputProcessor activeInternalSignatureOutputProcessor = null;
 
@@ -81,7 +83,7 @@ public abstract class AbstractSignatureO
 
         public InternalSignatureOutputProcessor(SignaturePartDef signaturePartDef, QName startElement) throws XMLSecurityException, NoSuchProviderException, NoSuchAlgorithmException {
             super();
-            this.getBeforeProcessors().add(InternalSignatureOutputProcessor.class.getName());
+            this.addBeforeProcessor(InternalSignatureOutputProcessor.class.getName());
             this.signaturePartDef = signaturePartDef;
             this.startElement = startElement;
         }
@@ -90,12 +92,17 @@ public abstract class AbstractSignatureO
         public void init(OutputProcessorChain outputProcessorChain) throws XMLSecurityException {
             try {
                 AlgorithmType algorithmID = JCEAlgorithmMapper.getAlgorithmMapping(getSecurityProperties().getSignatureDigestAlgorithm());
-                MessageDigest messageDigest = MessageDigest.getInstance(algorithmID.getJCEName(), algorithmID.getJCEProvider());
+                MessageDigest messageDigest;
+                if (algorithmID.getJCEProvider() != null) {
+                    messageDigest = MessageDigest.getInstance(algorithmID.getJCEName(), algorithmID.getJCEProvider());
+                } else {
+                    messageDigest = MessageDigest.getInstance(algorithmID.getJCEName());
+                }
                 this.digestOutputStream = new DigestOutputStream(messageDigest);
                 this.bufferedDigestOutputStream = new BufferedOutputStream(digestOutputStream);
 
                 if (signaturePartDef.getTransformAlgo() != null) {
-                    List<String> inclusiveNamespaces = new ArrayList<String>();
+                    List<String> inclusiveNamespaces = new ArrayList<String>(1);
                     inclusiveNamespaces.add("#default");
                     Transformer transformer = XMLSecurityUtils.getTransformer(inclusiveNamespaces, this.bufferedDigestOutputStream, signaturePartDef.getC14nAlgo());
                     this.transformer = XMLSecurityUtils.getTransformer(transformer, null, signaturePartDef.getTransformAlgo());
@@ -129,9 +136,7 @@ public abstract class AbstractSignatureO
             } else if (xmlEvent.isEndElement()) {
                 elementCounter--;
 
-                EndElement endElement = xmlEvent.asEndElement();
-
-                if (endElement.getName().equals(this.startElement) && elementCounter == 0) {
+                if (elementCounter == 0 && xmlEvent.asEndElement().getName().equals(this.startElement)) {
                     try {
                         bufferedDigestOutputStream.close();
                     } catch (IOException e) {

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer11.java Sun May 13 17:27:10 2012
@@ -21,6 +21,7 @@ package org.swssf.xmlsec.impl.transforme
 import org.swssf.xmlsec.ext.ComparableAttribute;
 import org.swssf.xmlsec.ext.XMLEventNS;
 
+import javax.xml.namespace.QName;
 import javax.xml.stream.events.Attribute;
 import javax.xml.stream.events.StartElement;
 import java.io.OutputStream;
@@ -38,16 +39,19 @@ public class Canonicalizer11 extends Can
     }
 
     @Override
-    protected void getInitialUtilizedAttributes(XMLEventNS xmlEventNS, SortedSet<ComparableAttribute> utilizedAttributes, C14NStack<List<Comparable>> outputStack) {
-        List<ComparableAttribute>[] visibleAttributeList = xmlEventNS.getAttributeList();
+    protected void getInitialUtilizedAttributes(final XMLEventNS xmlEventNS, final SortedSet<ComparableAttribute> utilizedAttributes,
+                                                final C14NStack<List<Comparable>> outputStack) {
+
+        final List<ComparableAttribute>[] visibleAttributeList = xmlEventNS.getAttributeList();
         for (int i = 0; i < visibleAttributeList.length; i++) {
-            List<ComparableAttribute> comparableAttributes = visibleAttributeList[i];
+            final List<ComparableAttribute> comparableAttributes = visibleAttributeList[i];
             for (int j = 0; j < comparableAttributes.size(); j++) {
-                ComparableAttribute comparableAttribute = comparableAttributes.get(j);
+                final ComparableAttribute comparableAttribute = comparableAttributes.get(j);
                 //xml:id attributes must be handled like other attributes: emit but dont inherit
-                if (XML.equals(comparableAttribute.getName().getPrefix())
-                        && ("id".equals(comparableAttribute.getName().getLocalPart()))
-                        || ("base".equals(comparableAttribute.getName().getLocalPart()))) {
+                final QName comparableAttributeName = comparableAttribute.getName();
+                if (XML.equals(comparableAttributeName.getPrefix())
+                        && ("id".equals(comparableAttributeName.getLocalPart()))
+                        || ("base".equals(comparableAttributeName.getLocalPart()))) {
                     continue;
                 }
                 if (outputStack.containsOnStack(comparableAttribute) != null) {
@@ -58,20 +62,21 @@ public class Canonicalizer11 extends Can
             }
         }
 
-        StartElement startElement = xmlEventNS.asStartElement();
+        final StartElement startElement = xmlEventNS.asStartElement();
         @SuppressWarnings("unchecked")
-        Iterator<Attribute> attributesIterator = startElement.getAttributes();
+        final Iterator<Attribute> attributesIterator = startElement.getAttributes();
         while (attributesIterator.hasNext()) {
-            Attribute attribute = attributesIterator.next();
+            final Attribute attribute = attributesIterator.next();
             //attributes with xml prefix are already processed in the for loop above
             //xml:id attributes must be handled like other attributes: emit but dont inherit
-            if (XML.equals(attribute.getName().getPrefix())
-                    && !"id".equals(attribute.getName().getLocalPart())
-                    && !"base".equals(attribute.getName().getLocalPart())) {
+            final QName attributeName = attribute.getName();
+            if (XML.equals(attributeName.getPrefix())
+                    && !"id".equals(attributeName.getLocalPart())
+                    && !"base".equals(attributeName.getLocalPart())) {
                 continue;
             }
 
-            utilizedAttributes.add(new ComparableAttribute(attribute.getName(), attribute.getValue()));
+            utilizedAttributes.add(new ComparableAttribute(attributeName, attribute.getValue()));
         }
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/Canonicalizer20010315_Excl.java Sun May 13 17:27:10 2012
@@ -40,27 +40,31 @@ public abstract class Canonicalizer20010
     }
 
     @Override
-    protected void getCurrentUtilizedNamespaces(XMLEventNS xmlEventNS, SortedSet<ComparableNamespace> utilizedNamespaces, C14NStack<List<Comparable>> outputStack) {
+    protected void getCurrentUtilizedNamespaces(final XMLEventNS xmlEventNS, final SortedSet<ComparableNamespace> utilizedNamespaces,
+                                                final C14NStack<List<Comparable>> outputStack) {
         getInitialUtilizedNamespaces(xmlEventNS, utilizedNamespaces, outputStack);
     }
 
     @Override
-    protected void getInitialUtilizedNamespaces(XMLEventNS xmlEventNS, SortedSet<ComparableNamespace> utilizedNamespaces, C14NStack<List<Comparable>> outputStack) {
-        List<ComparableNamespace> initialUtilizedNamespace = xmlEventNS.getNamespaceList()[0];
+    protected void getInitialUtilizedNamespaces(final XMLEventNS xmlEventNS, final SortedSet<ComparableNamespace> utilizedNamespaces,
+                                                final C14NStack<List<Comparable>> outputStack) {
+        final List<ComparableNamespace> initialUtilizedNamespace = xmlEventNS.getNamespaceList()[0];
+        //ok, a for loop seems to perform a lot better than creating an iterator. But only with the background knowledge that the
+        //list implementation is an ArrayList!
         for (int j = 0; j < initialUtilizedNamespace.size(); j++) {
-            ComparableNamespace comparableNamespace = initialUtilizedNamespace.get(j);
+            final ComparableNamespace comparableNamespace = initialUtilizedNamespace.get(j);
 
             boolean visibleUtilized = false;
-            StartElement startElement = xmlEventNS.asStartElement();
+            final StartElement startElement = xmlEventNS.asStartElement();
             if (comparableNamespace.getPrefix().equals(startElement.getName().getPrefix())) {
                 visibleUtilized = true;
             }
 
             if (!visibleUtilized) {
                 @SuppressWarnings("unchecked")
-                Iterator<Attribute> attributesIterator = startElement.getAttributes();
+                final Iterator<Attribute> attributesIterator = startElement.getAttributes();
                 while (attributesIterator.hasNext()) {
-                    Attribute attribute = attributesIterator.next();
+                    final Attribute attribute = attributesIterator.next();
                     if (comparableNamespace.getPrefix().equals(attribute.getName().getPrefix())) {
                         visibleUtilized = true;
                     }
@@ -83,12 +87,13 @@ public abstract class Canonicalizer20010
     }
 
     @Override
-    protected void getInitialUtilizedAttributes(XMLEventNS xmlEventNS, SortedSet<ComparableAttribute> utilizedAttributes, C14NStack<List<Comparable>> outputStack) {
-        StartElement startElement = xmlEventNS.asStartElement();
+    protected void getInitialUtilizedAttributes(final XMLEventNS xmlEventNS, final SortedSet<ComparableAttribute> utilizedAttributes,
+                                                final C14NStack<List<Comparable>> outputStack) {
+        final StartElement startElement = xmlEventNS.asStartElement();
         @SuppressWarnings("unchecked")
-        Iterator<Attribute> attributesIterator = startElement.getAttributes();
+        final Iterator<Attribute> attributesIterator = startElement.getAttributes();
         while (attributesIterator.hasNext()) {
-            Attribute attribute = attributesIterator.next();
+            final Attribute attribute = attributesIterator.next();
             utilizedAttributes.add(new ComparableAttribute(attribute.getName(), attribute.getValue()));
         }
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/transformer/canonicalizer/CanonicalizerBase.java Sun May 13 17:27:10 2012
@@ -20,6 +20,7 @@ package org.swssf.xmlsec.impl.transforme
 
 import org.swssf.xmlsec.ext.*;
 
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.*;
@@ -50,6 +51,8 @@ public abstract class CanonicalizerBase 
 
     protected static final String XML = "xml";
     protected static final String XMLNS = "xmlns";
+    protected static final char DOUBLEPOINT = ':';
+    protected static final String XMLNS_DOUBLEPOINT = XMLNS + DOUBLEPOINT;
 
     private enum DocumentLevel {
         NODE_BEFORE_DOCUMENT_ELEMENT,
@@ -59,7 +62,7 @@ public abstract class CanonicalizerBase 
 
     private OutputStream outputStream;
 
-    private Map<String, byte[]> cache = new HashMap<String, byte[]>();
+    private static final Map<String, byte[]> cache = new WeakHashMap<String, byte[]>();
     private C14NStack<List<Comparable>> outputStack = new C14NStack<List<Comparable>>();
     private boolean includeComments = false;
     private DocumentLevel currentDocumentLevel = DocumentLevel.NODE_BEFORE_DOCUMENT_ELEMENT;
@@ -78,10 +81,10 @@ public abstract class CanonicalizerBase 
             return null;
         }
 
-        SortedSet<String> prefixes = new TreeSet<String>();
+        final SortedSet<String> prefixes = new TreeSet<String>();
 
         for (int i = 0; i < inclusiveNamespaces.size(); i++) {
-            String s = inclusiveNamespaces.get(i);
+            final String s = inclusiveNamespaces.get(i).intern();
             if ("#default".equals(s)) {
                 prefixes.add("");
             } else {
@@ -91,10 +94,11 @@ public abstract class CanonicalizerBase 
         return prefixes;
     }
 
-    protected void getCurrentUtilizedNamespaces(XMLEventNS xmlEventNS, SortedSet<ComparableNamespace> utilizedNamespaces, C14NStack<List<Comparable>> outputStack) {
-        List<ComparableNamespace> currentUtilizedNamespace = xmlEventNS.getNamespaceList()[0];
+    protected void getCurrentUtilizedNamespaces(final XMLEventNS xmlEventNS, final SortedSet<ComparableNamespace> utilizedNamespaces,
+                                                final C14NStack<List<Comparable>> outputStack) {
+        final List<ComparableNamespace> currentUtilizedNamespace = xmlEventNS.getNamespaceList()[0];
         for (int j = 0; j < currentUtilizedNamespace.size(); j++) {
-            ComparableNamespace comparableNamespace = currentUtilizedNamespace.get(j);
+            final ComparableNamespace comparableNamespace = currentUtilizedNamespace.get(j);
 
             final ComparableNamespace found = (ComparableNamespace) outputStack.containsOnStack(comparableNamespace);
             //found means the prefix matched. so check the ns further
@@ -107,22 +111,24 @@ public abstract class CanonicalizerBase 
         }
     }
 
-    protected void getCurrentUtilizedAttributes(XMLEventNS xmlEventNS, SortedSet<ComparableAttribute> utilizedAttributes, C14NStack<List<Comparable>> outputStack) {
-        StartElement startElement = xmlEventNS.asStartElement();
+    protected void getCurrentUtilizedAttributes(final XMLEventNS xmlEventNS, final SortedSet<ComparableAttribute> utilizedAttributes,
+                                                final C14NStack<List<Comparable>> outputStack) {
+        final StartElement startElement = xmlEventNS.asStartElement();
         @SuppressWarnings("unchecked")
-        Iterator<Attribute> attributesIterator = startElement.getAttributes();
+        final Iterator<Attribute> attributesIterator = startElement.getAttributes();
         while (attributesIterator.hasNext()) {
-            Attribute attribute = attributesIterator.next();
+            final Attribute attribute = attributesIterator.next();
             utilizedAttributes.add(new ComparableAttribute(attribute.getName(), attribute.getValue()));
         }
     }
 
-    protected void getInitialUtilizedNamespaces(XMLEventNS xmlEventNS, SortedSet<ComparableNamespace> utilizedNamespaces, C14NStack<List<Comparable>> outputStack) {
-        List<ComparableNamespace>[] visibleNamespaceList = xmlEventNS.getNamespaceList();
+    protected void getInitialUtilizedNamespaces(final XMLEventNS xmlEventNS, final SortedSet<ComparableNamespace> utilizedNamespaces,
+                                                final C14NStack<List<Comparable>> outputStack) {
+        final List<ComparableNamespace>[] visibleNamespaceList = xmlEventNS.getNamespaceList();
         for (int i = 0; i < visibleNamespaceList.length; i++) {
-            List<ComparableNamespace> initialUtilizedNamespace = visibleNamespaceList[i];
+            final List<ComparableNamespace> initialUtilizedNamespace = visibleNamespaceList[i];
             for (int j = 0; j < initialUtilizedNamespace.size(); j++) {
-                ComparableNamespace comparableNamespace = initialUtilizedNamespace.get(j);
+                final ComparableNamespace comparableNamespace = initialUtilizedNamespace.get(j);
 
                 final ComparableNamespace found = (ComparableNamespace) outputStack.containsOnStack(comparableNamespace);
                 //found means the prefix matched. so check the ns further
@@ -136,12 +142,13 @@ public abstract class CanonicalizerBase 
         }
     }
 
-    protected void getInitialUtilizedAttributes(XMLEventNS xmlEventNS, SortedSet<ComparableAttribute> utilizedAttributes, C14NStack<List<Comparable>> outputStack) {
-        List<ComparableAttribute>[] visibleAttributeList = xmlEventNS.getAttributeList();
+    protected void getInitialUtilizedAttributes(final XMLEventNS xmlEventNS, final SortedSet<ComparableAttribute> utilizedAttributes,
+                                                final C14NStack<List<Comparable>> outputStack) {
+        final List<ComparableAttribute>[] visibleAttributeList = xmlEventNS.getAttributeList();
         for (int i = 0; i < visibleAttributeList.length; i++) {
-            List<ComparableAttribute> comparableAttributes = visibleAttributeList[i];
+            final List<ComparableAttribute> comparableAttributes = visibleAttributeList[i];
             for (int j = 0; j < comparableAttributes.size(); j++) {
-                ComparableAttribute comparableAttribute = comparableAttributes.get(j);
+                final ComparableAttribute comparableAttribute = comparableAttributes.get(j);
                 if (outputStack.containsOnStack(comparableAttribute) != null) {
                     continue;
                 }
@@ -149,11 +156,11 @@ public abstract class CanonicalizerBase 
                 outputStack.peek().add(comparableAttribute);
             }
         }
-        StartElement startElement = xmlEventNS.asStartElement();
+        final StartElement startElement = xmlEventNS.asStartElement();
         @SuppressWarnings("unchecked")
-        Iterator<Attribute> attributesIterator = startElement.getAttributes();
+        final Iterator<Attribute> attributesIterator = startElement.getAttributes();
         while (attributesIterator.hasNext()) {
-            Attribute attribute = attributesIterator.next();
+            final Attribute attribute = attributesIterator.next();
             //attributes with xml prefix are already processed in the for loop above
             if (XML.equals(attribute.getName().getPrefix())) {
                 continue;
@@ -163,39 +170,38 @@ public abstract class CanonicalizerBase 
         }
     }
 
-    public void transform(XMLEvent xmlEvent) throws XMLStreamException {
+    public void transform(final XMLEvent xmlEvent) throws XMLStreamException {
         try {
             switch (xmlEvent.getEventType()) {
                 case XMLStreamConstants.START_ELEMENT:
 
-                    StartElement startElement = xmlEvent.asStartElement();
+                    final StartElement startElement = xmlEvent.asStartElement();
 
                     currentDocumentLevel = DocumentLevel.NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
-                    outputStack.push(new ArrayList<Comparable>());
+                    outputStack.push(Collections.<Comparable>emptyList());
 
-                    XMLEventNS xmlEventNS = (XMLEventNS) xmlEvent;
+                    final XMLEventNS xmlEventNS = (XMLEventNS) xmlEvent;
 
-                    SortedSet<ComparableNamespace> utilizedNamespaces = new TreeSet<ComparableNamespace>();
-                    SortedSet<ComparableAttribute> utilizedAttributes = new TreeSet<ComparableAttribute>();
+                    final SortedSet<ComparableNamespace> utilizedNamespaces = new TreeSet<ComparableNamespace>();
+                    final SortedSet<ComparableAttribute> utilizedAttributes = new TreeSet<ComparableAttribute>();
 
                     if (firstCall) {
                         outputStack.peek().add(new ComparableNamespace(""));
-                        outputStack.push(new ArrayList<Comparable>());
+                        outputStack.push(Collections.<Comparable>emptyList());
                         firstCall = false;
 
                         if (this.inclusiveNamespaces != null) {
-
-                            Iterator<String> iterator = this.inclusiveNamespaces.iterator();
+                            final Iterator<String> iterator = this.inclusiveNamespaces.iterator();
                             while (iterator.hasNext()) {
-                                String next = iterator.next();
-                                String ns = startElement.getNamespaceURI(next);
+                                final String next = iterator.next();
+                                final String ns = startElement.getNamespaceURI(next);
                                 //add default ns:
-                                if (ns == null && "".equals(next)) {
-                                    ComparableNamespace comparableNamespace = new ComparableNamespace(next, "");
+                                if (ns == null && next != null && next.isEmpty()) {
+                                    final ComparableNamespace comparableNamespace = new ComparableNamespace(next, "");
                                     utilizedNamespaces.add(comparableNamespace);
                                     outputStack.peek().add(comparableNamespace);
                                 } else if (ns != null) {
-                                    ComparableNamespace comparableNamespace = new ComparableNamespace(next, ns);
+                                    final ComparableNamespace comparableNamespace = new ComparableNamespace(next, ns);
                                     utilizedNamespaces.add(comparableNamespace);
                                     outputStack.peek().add(comparableNamespace);
                                 }
@@ -210,17 +216,17 @@ public abstract class CanonicalizerBase 
                     }
 
                     outputStream.write('<');
-                    String prefix = startElement.getName().getPrefix();
-                    if (prefix != null && prefix.length() > 0) {
+                    final String prefix = startElement.getName().getPrefix();
+                    if (prefix != null && !prefix.isEmpty()) {
                         UtfHelpper.writeByte(prefix, outputStream, cache);
-                        outputStream.write(':');
+                        outputStream.write(DOUBLEPOINT);
                     }
-                    String name = startElement.getName().getLocalPart();
+                    final String name = startElement.getName().getLocalPart();
                     UtfHelpper.writeByte(name, outputStream, cache);
 
-                    Iterator<ComparableNamespace> namespaceIterator = utilizedNamespaces.iterator();
+                    final Iterator<ComparableNamespace> namespaceIterator = utilizedNamespaces.iterator();
                     while (namespaceIterator.hasNext()) {
-                        ComparableNamespace namespace = namespaceIterator.next();
+                        final ComparableNamespace namespace = namespaceIterator.next();
 
                         if (!namespaceIsAbsolute(namespace.getNamespaceURI())) {
                             throw new XMLStreamException("namespace is relative encountered: " + namespace.getNamespaceURI());
@@ -229,36 +235,34 @@ public abstract class CanonicalizerBase 
                         if (namespace.isDefaultNamespaceDeclaration()) {
                             outputAttrToWriter(XMLNS, namespace.getNamespaceURI(), outputStream, cache);
                         } else {
-                            outputAttrToWriter(XMLNS + ":" + namespace.getPrefix(), namespace.getNamespaceURI(), outputStream, cache);
+                            outputAttrToWriter(XMLNS_DOUBLEPOINT + namespace.getPrefix(), namespace.getNamespaceURI(), outputStream, cache);
                         }
                     }
 
-                    Iterator<ComparableAttribute> attributeIterator = utilizedAttributes.iterator();
+                    final Iterator<ComparableAttribute> attributeIterator = utilizedAttributes.iterator();
                     while (attributeIterator.hasNext()) {
-                        ComparableAttribute attribute = attributeIterator.next();
+                        final ComparableAttribute attribute = attributeIterator.next();
 
-                        String localPart = "";
-                        if (attribute.getName().getPrefix() != null && attribute.getName().getPrefix().length() > 0) {
-                            localPart += attribute.getName().getPrefix() + ":";
+                        final QName attributeName = attribute.getName();
+                        if (attributeName.getPrefix() != null && !attributeName.getPrefix().isEmpty()) {
+                            final String localPart = attributeName.getPrefix() + DOUBLEPOINT + attributeName.getLocalPart();
+                            outputAttrToWriter(localPart, attribute.getValue(), outputStream, cache);
+                        } else {
+                            outputAttrToWriter(attributeName.getLocalPart(), attribute.getValue(), outputStream, cache);
                         }
-                        localPart += attribute.getName().getLocalPart();
-                        outputAttrToWriter(localPart,
-                                attribute.getValue(),
-                                outputStream, cache);
                     }
 
                     outputStream.write('>');
                     break;
                 case XMLStreamConstants.END_ELEMENT:
-                    EndElement endElement = xmlEvent.asEndElement();
-                    String localName = endElement.getName().getLocalPart();
-                    String localPrefix = endElement.getName().getPrefix();
+                    final EndElement endElement = xmlEvent.asEndElement();
+                    final String localPrefix = endElement.getName().getPrefix();
                     outputStream.write(_END_TAG);
-                    if (localPrefix != null && localPrefix.length() > 0) {
+                    if (localPrefix != null && !localPrefix.isEmpty()) {
                         UtfHelpper.writeByte(localPrefix, outputStream, cache);
-                        outputStream.write(':');
+                        outputStream.write(DOUBLEPOINT);
                     }
-                    UtfHelpper.writeStringToUtf8(localName, outputStream);
+                    UtfHelpper.writeStringToUtf8(endElement.getName().getLocalPart(), outputStream);
                     outputStream.write('>');
 
                     //We finished with this level, pop to the previous definitions.
@@ -321,7 +325,7 @@ public abstract class CanonicalizerBase 
         final int length = value.length();
         int i = 0;
         while (i < length) {
-            char c = value.charAt(i++);
+            final char c = value.charAt(i++);
 
             switch (c) {
 
@@ -374,7 +378,7 @@ public abstract class CanonicalizerBase 
         final int length = text.length();
         byte[] toWrite;
         for (int i = 0; i < length; i++) {
-            char c = text.charAt(i);
+            final char c = text.charAt(i);
 
             switch (c) {
 
@@ -423,7 +427,7 @@ public abstract class CanonicalizerBase 
         int length = target.length();
 
         for (int i = 0; i < length; i++) {
-            char c = target.charAt(i);
+            final char c = target.charAt(i);
             if (c == 0x0D) {
                 writer.write(__XD_);
             } else {
@@ -475,7 +479,7 @@ public abstract class CanonicalizerBase 
         final int length = data.length();
 
         for (int i = 0; i < length; i++) {
-            char c = data.charAt(i);
+            final char c = data.charAt(i);
             if (c == 0x0D) {
                 writer.write(__XD_);
             } else {
@@ -493,30 +497,47 @@ public abstract class CanonicalizerBase 
         }
     }
 
-    private boolean namespaceIsAbsolute(String namespaceValue) {
+    private boolean namespaceIsAbsolute(final String namespaceValue) {
         // assume empty namespaces are absolute
-        if (namespaceValue.length() == 0) {
+        if (namespaceValue.isEmpty()) {
             return true;
         }
-        return namespaceValue.indexOf(':') > 0;
+        return namespaceValue.indexOf(DOUBLEPOINT) > 0;
     }
 
 
     public static class C14NStack<E> extends ArrayDeque<List<Comparable>> {
 
-        public Object containsOnStack(Object o) {
-            if (o == null) {
-                return null;
-            }
+        public Object containsOnStack(final Object o) {
             //Important: iteration order from head to tail!
-            Iterator<List<Comparable>> elementIterator = super.iterator();
+            final Iterator<List<Comparable>> elementIterator = super.iterator();
             while (elementIterator.hasNext()) {
-                List list = elementIterator.next();
-                if (list.contains(o)) {
-                    return list.get(list.indexOf(o));
+                final List list = elementIterator.next();
+                if (list.size() == 0) {
+                    continue;
+                }
+                final int idx = list.indexOf(o);
+                if (idx != -1) {
+                    return list.get(idx);
                 }
             }
             return null;
         }
+
+        @Override
+        public List<Comparable> peek() {
+            List<Comparable> list = super.peekFirst();
+            if (list == Collections.<Comparable>emptyList()) {
+                super.removeFirst();
+                list = new ArrayList<Comparable>();
+                super.addFirst(list);
+            }
+            return list;
+        }
+
+        @Override
+        public List<Comparable> peekFirst() {
+            throw new UnsupportedOperationException("Use peek()");
+        }
     }
 }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/DigestOutputStream.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/DigestOutputStream.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/DigestOutputStream.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/DigestOutputStream.java Sun May 13 17:27:10 2012
@@ -33,14 +33,15 @@ import java.security.MessageDigest;
 public class DigestOutputStream extends OutputStream {
 
     protected static final transient Log log = LogFactory.getLog(DigestOutputStream.class);
+    protected static final transient boolean isDebugEnabled = log.isDebugEnabled();
 
     private MessageDigest messageDigest;
-    private StringBuffer stringBuffer;
+    private StringBuilder stringBuilder;
 
     public DigestOutputStream(MessageDigest messageDigest) {
         this.messageDigest = messageDigest;
-        if (log.isDebugEnabled()) {
-            stringBuffer = new StringBuffer();
+        if (isDebugEnabled) {
+            stringBuilder = new StringBuilder();
         }
     }
 
@@ -50,24 +51,24 @@ public class DigestOutputStream extends 
 
     public void write(int arg0) {
         messageDigest.update((byte) arg0);
-        if (log.isDebugEnabled()) {
-            stringBuffer.append(new String(new byte[]{(byte) arg0}));
+        if (isDebugEnabled) {
+            stringBuilder.append(new String(new byte[]{(byte) arg0}));
         }
     }
 
     public void write(byte[] arg0, int arg1, int arg2) {
         messageDigest.update(arg0, arg1, arg2);
-        if (log.isDebugEnabled()) {
-            stringBuffer.append(new String(arg0, arg1, arg2));
+        if (isDebugEnabled) {
+            stringBuilder.append(new String(arg0, arg1, arg2));
         }
     }
 
     public byte[] getDigestValue() {
-        if (log.isDebugEnabled()) {
+        if (isDebugEnabled) {
             log.debug("Pre Digest: ");
-            log.debug(stringBuffer.toString());
+            log.debug(stringBuilder.toString());
             log.debug("End pre Digest ");
-            stringBuffer = new StringBuffer();
+            stringBuilder = new StringBuilder();
         }
         return messageDigest.digest();
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/RFC2253Parser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/RFC2253Parser.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/RFC2253Parser.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/RFC2253Parser.java Sun May 13 17:27:10 2012
@@ -68,7 +68,7 @@ public class RFC2253Parser {
     public static String normalize(String dn, boolean toXML) {
 
         //if empty string
-        if ((dn == null) || dn.equals("")) {
+        if (dn == null || dn.isEmpty()) {
             return "";
         }
 
@@ -138,7 +138,7 @@ public class RFC2253Parser {
      */
     static String parseATAV(String str, boolean toXML) throws IOException {
 
-        int i = str.indexOf("=");
+        int i = str.indexOf('=');
 
         if ((i == -1) || ((i > 0) && (str.charAt(i - 1) == '\\'))) {
             return str;

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/SignerOutputStream.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/SignerOutputStream.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/SignerOutputStream.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/SignerOutputStream.java Sun May 13 17:27:10 2012
@@ -32,14 +32,15 @@ import java.io.OutputStream;
 public class SignerOutputStream extends OutputStream {
 
     protected static final transient Log log = LogFactory.getLog(SignerOutputStream.class);
+    protected static final transient boolean isDebugEnabled = log.isDebugEnabled();
 
     private final SignatureAlgorithm signatureAlgorithm;
-    private StringBuffer stringBuffer;
+    private StringBuilder stringBuilder;
 
     public SignerOutputStream(SignatureAlgorithm signatureAlgorithm) {
         this.signatureAlgorithm = signatureAlgorithm;
-        if (log.isDebugEnabled()) {
-            stringBuffer = new StringBuffer();
+        if (isDebugEnabled) {
+            stringBuilder = new StringBuilder();
         }
     }
 
@@ -50,8 +51,8 @@ public class SignerOutputStream extends 
     public void write(int arg0) {
         try {
             signatureAlgorithm.engineUpdate((byte) arg0);
-            if (log.isDebugEnabled()) {
-                stringBuffer.append(new String(new byte[]{(byte) arg0}));
+            if (isDebugEnabled) {
+                stringBuilder.append(new String(new byte[]{(byte) arg0}));
             }
         } catch (XMLSecurityException e) {
             throw new RuntimeException(e);
@@ -61,8 +62,8 @@ public class SignerOutputStream extends 
     public void write(byte[] arg0, int arg1, int arg2) {
         try {
             signatureAlgorithm.engineUpdate(arg0, arg1, arg2);
-            if (log.isDebugEnabled()) {
-                stringBuffer.append(new String(arg0, arg1, arg2));
+            if (isDebugEnabled) {
+                stringBuilder.append(new String(arg0, arg1, arg2));
             }
         } catch (XMLSecurityException e) {
             throw new RuntimeException(e);
@@ -70,21 +71,21 @@ public class SignerOutputStream extends 
     }
 
     public boolean verify(byte[] signatureValue) throws XMLSecurityException {
-        if (log.isDebugEnabled()) {
+        if (isDebugEnabled) {
             log.debug("Pre Signed: ");
-            log.debug(stringBuffer.toString());
+            log.debug(stringBuilder.toString());
             log.debug("End pre Signed ");
-            stringBuffer = new StringBuffer();
+            stringBuilder = new StringBuilder();
         }
         return signatureAlgorithm.engineVerify(signatureValue);
     }
 
     public byte[] sign() throws XMLSecurityException {
-        if (log.isDebugEnabled()) {
+        if (isDebugEnabled) {
             log.debug("Pre Signed: ");
-            log.debug(stringBuffer.toString());
+            log.debug(stringBuilder.toString());
             log.debug("End pre Signed ");
-            stringBuffer = new StringBuffer();
+            stringBuilder = new StringBuilder();
         }
         return signatureAlgorithm.engineSign();
     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/InputProcessorChainTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/InputProcessorChainTest.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/InputProcessorChainTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/InputProcessorChainTest.java Sun May 13 17:27:10 2012
@@ -44,10 +44,18 @@ public class InputProcessorChainTest {
         private Set<Object> beforeProcessors = new HashSet<Object>();
         private Set<Object> afterProcessors = new HashSet<Object>();
 
+        public void addBeforeProcessor(Object processor) {
+            this.beforeProcessors.add(processor);
+        }
+
         public Set<Object> getBeforeProcessors() {
             return beforeProcessors;
         }
 
+        public void addAfterProcessor(Object processor) {
+            this.afterProcessors.add(processor);
+        }
+
         public Set<Object> getAfterProcessors() {
             return afterProcessors;
         }
@@ -154,18 +162,18 @@ public class InputProcessorChainTest {
         AbstractInputProcessor inputProcessor4 = new AbstractInputProcessor() {
         };
         inputProcessor4.setPhase(XMLSecurityConstants.Phase.POSTPROCESSING);
-        inputProcessor4.getBeforeProcessors().add(inputProcessor3.getClass().getName());
+        inputProcessor4.addBeforeProcessor(inputProcessor3.getClass().getName());
         inputProcessorChain.addProcessor(inputProcessor4);
 
         AbstractInputProcessor inputProcessor5 = new AbstractInputProcessor() {
         };
         inputProcessor5.setPhase(XMLSecurityConstants.Phase.PREPROCESSING);
-        inputProcessor5.getBeforeProcessors().add(inputProcessor2.getClass().getName());
+        inputProcessor5.addBeforeProcessor(inputProcessor2.getClass().getName());
         inputProcessorChain.addProcessor(inputProcessor5);
 
         AbstractInputProcessor inputProcessor6 = new AbstractInputProcessor() {
         };
-        inputProcessor6.getBeforeProcessors().add(inputProcessor1.getClass().getName());
+        inputProcessor6.addBeforeProcessor(inputProcessor1.getClass().getName());
         inputProcessorChain.addProcessor(inputProcessor6);
 
         Assert.assertEquals(inputProcessorChain.getProcessors().get(0), inputProcessor3);
@@ -197,18 +205,18 @@ public class InputProcessorChainTest {
         AbstractInputProcessor inputProcessor4 = new AbstractInputProcessor() {
         };
         inputProcessor4.setPhase(XMLSecurityConstants.Phase.POSTPROCESSING);
-        inputProcessor4.getAfterProcessors().add(inputProcessor3.getClass().getName());
+        inputProcessor4.addAfterProcessor(inputProcessor3.getClass().getName());
         inputProcessorChain.addProcessor(inputProcessor4);
 
         AbstractInputProcessor inputProcessor5 = new AbstractInputProcessor() {
         };
         inputProcessor5.setPhase(XMLSecurityConstants.Phase.PREPROCESSING);
-        inputProcessor5.getAfterProcessors().add(inputProcessor2.getClass().getName());
+        inputProcessor5.addAfterProcessor(inputProcessor2.getClass().getName());
         inputProcessorChain.addProcessor(inputProcessor5);
 
         AbstractInputProcessor inputProcessor6 = new AbstractInputProcessor() {
         };
-        inputProcessor6.getAfterProcessors().add(inputProcessor1.getClass().getName());
+        inputProcessor6.addAfterProcessor(inputProcessor1.getClass().getName());
         inputProcessorChain.addProcessor(inputProcessor6);
 
         Assert.assertEquals(inputProcessorChain.getProcessors().get(0), inputProcessor4);
@@ -241,14 +249,14 @@ public class InputProcessorChainTest {
 
         AbstractInputProcessor inputProcessor5 = new AbstractInputProcessor() {
         };
-        inputProcessor5.getBeforeProcessors().add("");
-        inputProcessor5.getAfterProcessors().add(inputProcessor3.getClass().getName());
+        inputProcessor5.addBeforeProcessor("");
+        inputProcessor5.addAfterProcessor(inputProcessor3.getClass().getName());
         inputProcessorChain.addProcessor(inputProcessor5);
 
         AbstractInputProcessor inputProcessor6 = new AbstractInputProcessor() {
         };
-        inputProcessor6.getBeforeProcessors().add(inputProcessor5.getClass().getName());
-        inputProcessor6.getAfterProcessors().add("");
+        inputProcessor6.addBeforeProcessor(inputProcessor5.getClass().getName());
+        inputProcessor6.addAfterProcessor("");
         inputProcessorChain.addProcessor(inputProcessor6);
 
         Assert.assertEquals(inputProcessorChain.getProcessors().get(0), inputProcessor4);

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/OutputProcessorChainTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/OutputProcessorChainTest.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/OutputProcessorChainTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/OutputProcessorChainTest.java Sun May 13 17:27:10 2012
@@ -50,10 +50,18 @@ public class OutputProcessorChainTest {
         public void init(OutputProcessorChain outputProcessorChain) throws XMLSecurityException {
         }
 
+        public void addBeforeProcessor(Object processor) {
+            this.beforeProcessors.add(processor);
+        }
+
         public Set<Object> getBeforeProcessors() {
             return beforeProcessors;
         }
 
+        public void addAfterProcessor(Object processor) {
+            this.afterProcessors.add(processor);
+        }
+
         public Set<Object> getAfterProcessors() {
             return afterProcessors;
         }
@@ -155,18 +163,18 @@ public class OutputProcessorChainTest {
         AbstractOutputProcessor outputProcessor4 = new AbstractOutputProcessor() {
         };
         outputProcessor4.setPhase(XMLSecurityConstants.Phase.POSTPROCESSING);
-        outputProcessor4.getBeforeProcessors().add(outputProcessor3.getClass().getName());
+        outputProcessor4.addBeforeProcessor(outputProcessor3.getClass().getName());
         outputProcessorChain.addProcessor(outputProcessor4);
 
         AbstractOutputProcessor outputProcessor5 = new AbstractOutputProcessor() {
         };
         outputProcessor5.setPhase(XMLSecurityConstants.Phase.PREPROCESSING);
-        outputProcessor5.getBeforeProcessors().add(outputProcessor2.getClass().getName());
+        outputProcessor5.addBeforeProcessor(outputProcessor2.getClass().getName());
         outputProcessorChain.addProcessor(outputProcessor5);
 
         AbstractOutputProcessor outputProcessor6 = new AbstractOutputProcessor() {
         };
-        outputProcessor6.getBeforeProcessors().add(outputProcessor1.getClass().getName());
+        outputProcessor6.addBeforeProcessor(outputProcessor1.getClass().getName());
         outputProcessorChain.addProcessor(outputProcessor6);
 
         Assert.assertEquals(outputProcessorChain.getProcessors().get(0), outputProcessor5);
@@ -198,18 +206,18 @@ public class OutputProcessorChainTest {
         AbstractOutputProcessor outputProcessor4 = new AbstractOutputProcessor() {
         };
         outputProcessor4.setPhase(XMLSecurityConstants.Phase.POSTPROCESSING);
-        outputProcessor4.getAfterProcessors().add(outputProcessor3.getClass().getName());
+        outputProcessor4.addAfterProcessor(outputProcessor3.getClass().getName());
         outputProcessorChain.addProcessor(outputProcessor4);
 
         AbstractOutputProcessor outputProcessor5 = new AbstractOutputProcessor() {
         };
         outputProcessor5.setPhase(XMLSecurityConstants.Phase.PREPROCESSING);
-        outputProcessor5.getAfterProcessors().add(outputProcessor2.getClass().getName());
+        outputProcessor5.addAfterProcessor(outputProcessor2.getClass().getName());
         outputProcessorChain.addProcessor(outputProcessor5);
 
         AbstractOutputProcessor outputProcessor6 = new AbstractOutputProcessor() {
         };
-        outputProcessor6.getAfterProcessors().add(outputProcessor1.getClass().getName());
+        outputProcessor6.addAfterProcessor(outputProcessor1.getClass().getName());
         outputProcessorChain.addProcessor(outputProcessor6);
 
         Assert.assertEquals(outputProcessorChain.getProcessors().get(0), outputProcessor2);
@@ -242,14 +250,14 @@ public class OutputProcessorChainTest {
 
         AbstractOutputProcessor outputProcessor5 = new AbstractOutputProcessor() {
         };
-        outputProcessor5.getBeforeProcessors().add("");
-        outputProcessor5.getAfterProcessors().add(outputProcessor3.getClass().getName());
+        outputProcessor5.addBeforeProcessor("");
+        outputProcessor5.addAfterProcessor(outputProcessor3.getClass().getName());
         outputProcessorChain.addProcessor(outputProcessor5);
 
         AbstractOutputProcessor outputProcessor6 = new AbstractOutputProcessor() {
         };
-        outputProcessor6.getBeforeProcessors().add(outputProcessor5.getClass().getName());
-        outputProcessor6.getAfterProcessors().add("");
+        outputProcessor6.addBeforeProcessor(outputProcessor5.getClass().getName());
+        outputProcessor6.addAfterProcessor("");
         outputProcessorChain.addProcessor(outputProcessor6);
 
         Assert.assertEquals(outputProcessorChain.getProcessors().get(0), outputProcessor1);

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/UncategorizedTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/UncategorizedTest.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/UncategorizedTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/UncategorizedTest.java Sun May 13 17:27:10 2012
@@ -35,7 +35,7 @@ public class UncategorizedTest {
     public void testConfigurationLoadFromUrl() throws Exception {
         URL url = this.getClass().getClassLoader().getResource("testdata/c14n/in/31_input.xml");
         try {
-            Init.init(url);
+            Init.init(url.toURI());
             Assert.fail();
         } catch (XMLSecurityException e) {
             Assert.assertEquals(e.getMessage(), "General security error; nested exception is: \n" +

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityEventReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityEventReaderTest.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityEventReaderTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityEventReaderTest.java Sun May 13 17:27:10 2012
@@ -25,8 +25,8 @@ import org.testng.annotations.Test;
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.events.XMLEvent;
+import java.util.ArrayDeque;
 import java.util.Deque;
-import java.util.LinkedList;
 
 /**
  * @author $Author$
@@ -39,7 +39,7 @@ public class XMLSecurityEventReaderTest 
         XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
         XMLEventReader xmlEventReader = xmlInputFactory.createXMLEventReader(this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml"));
 
-        Deque<XMLEvent> xmlEventDeque = new LinkedList<XMLEvent>();
+        Deque<XMLEvent> xmlEventDeque = new ArrayDeque<XMLEvent>();
         while (xmlEventReader.hasNext()) {
             XMLEvent xmlEvent = xmlEventReader.nextEvent();
             xmlEventDeque.push(xmlEvent);
@@ -72,7 +72,7 @@ public class XMLSecurityEventReaderTest 
         XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
         XMLEventReader xmlEventReader = xmlInputFactory.createXMLEventReader(this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml"));
 
-        Deque<XMLEvent> xmlEventDeque = new LinkedList<XMLEvent>();
+        Deque<XMLEvent> xmlEventDeque = new ArrayDeque<XMLEvent>();
         while (xmlEventReader.hasNext()) {
             XMLEvent xmlEvent = xmlEventReader.nextEvent();
             xmlEventDeque.push(xmlEvent);

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamReaderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamReaderTest.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamReaderTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamReaderTest.java Sun May 13 17:27:10 2012
@@ -255,12 +255,19 @@ public class XMLSecurityStreamReaderTest
             xmlEventReader = xmlInputFactory.createXMLEventReader(this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml"));
         }
 
+        public void addBeforeProcessor(Object processor) {
+        }
+
         @Override
         public Set<Object> getBeforeProcessors() {
             return new HashSet<Object>();
         }
 
         @Override
+        public void addAfterProcessor(Object processor) {
+        }
+
+        @Override
         public Set<Object> getAfterProcessors() {
             return new HashSet<Object>();
         }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamWriterTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamWriterTest.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamWriterTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/XMLSecurityStreamWriterTest.java Sun May 13 17:27:10 2012
@@ -196,11 +196,19 @@ public class XMLSecurityStreamWriterTest
         }
 
         @Override
+        public void addBeforeProcessor(Object processor) {
+        }
+
+        @Override
         public Set<Object> getBeforeProcessors() {
             return new HashSet<Object>();
         }
 
         @Override
+        public void addAfterProcessor(Object processor) {
+        }
+
+        @Override
         public Set<Object> getAfterProcessors() {
             return new HashSet<Object>();
         }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/utils/XMLEventNSAllocator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/utils/XMLEventNSAllocator.java?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/utils/XMLEventNSAllocator.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/java/org/swssf/xmlsec/test/utils/XMLEventNSAllocator.java Sun May 13 17:27:10 2012
@@ -111,7 +111,7 @@ public class XMLEventNSAllocator impleme
                 }
 
                 if (!"xml".equals(attrName.getPrefix())) {
-                    if (!"".equals(attrName.getPrefix())) {
+                    if (attrName.getPrefix() != null && !attrName.getPrefix().isEmpty()) {
                         ComparableNamespace comparableNamespace = new ComparableNamespace(attrName.getPrefix(), attrName.getNamespaceURI());
                         comparableNamespaceList.add(comparableNamespace);
                     }

Modified: webservices/wss4j/branches/swssf/streaming-xml-security/src/test/resources/testdata/plain-soap-1.1.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/test/resources/testdata/plain-soap-1.1.xml?rev=1337945&r1=1337944&r2=1337945&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-xml-security/src/test/resources/testdata/plain-soap-1.1.xml (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/test/resources/testdata/plain-soap-1.1.xml Sun May 13 17:27:10 2012
@@ -1,4 +1,3 @@
-<?xml version='1.0' ?>
 <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
     <env:Header>
 



Mime
View raw message