You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2015/12/22 17:30:55 UTC

svn commit: r1721425 - in /webservices/wss4j/trunk: build-tools/src/main/resources/ policy/src/main/java/org/apache/wss4j/policy/model/

Author: coheigea
Date: Tue Dec 22 16:30:54 2015
New Revision: 1721425

URL: http://svn.apache.org/viewvc?rev=1721425&view=rev
Log:
More checkstyle fixes

Modified:
    webservices/wss4j/trunk/build-tools/src/main/resources/wss4j-checkstyle.xml
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSecurityAssertion.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSymmetricAsymmetricBinding.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AsymmetricBinding.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Attachments.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/HttpsToken.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/IssuedToken.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/KeyValueToken.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/RequiredElements.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SamlToken.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SymmetricBinding.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/TransportBinding.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust10.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust13.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss10.java
    webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss11.java

Modified: webservices/wss4j/trunk/build-tools/src/main/resources/wss4j-checkstyle.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/build-tools/src/main/resources/wss4j-checkstyle.xml?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/build-tools/src/main/resources/wss4j-checkstyle.xml (original)
+++ webservices/wss4j/trunk/build-tools/src/main/resources/wss4j-checkstyle.xml Tue Dec 22 16:30:54 2015
@@ -81,10 +81,6 @@
         <module name="MethodLength">
             <property name="max" value="200"/>
         </module>
-        <module name="ParameterNumber">
-            <property name="max" value="8"/>
-        </module>
-
 
         <!-- Checks for whitespace                               -->
         <!-- See http://checkstyle.sf.net/config_whitespace.html -->

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSecurityAssertion.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSecurityAssertion.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSecurityAssertion.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSecurityAssertion.java Tue Dec 22 16:30:54 2015
@@ -148,10 +148,14 @@ public abstract class AbstractSecurityAs
         writer.writeStartElement(getName().getPrefix(), getName().getLocalPart(), getName().getNamespaceURI());
         writer.writeNamespace(getName().getPrefix(), getName().getNamespaceURI());
         if (isOptional()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_OPTIONAL, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_OPTIONAL, "true");
         }
         if (isIgnorable()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_IGNORABLE, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_IGNORABLE, "true");
         }
         nestedPolicy.serialize(writer);
         writer.writeEndElement();

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSymmetricAsymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSymmetricAsymmetricBinding.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSymmetricAsymmetricBinding.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AbstractSymmetricAsymmetricBinding.java Tue Dec 22 16:30:54 2015
@@ -24,6 +24,8 @@ import org.apache.wss4j.policy.SPConstan
 
 import java.util.*;
 
+import javax.xml.namespace.QName;
+
 public abstract class AbstractSymmetricAsymmetricBinding extends AbstractBinding {
 
     public enum ProtectionOrder {
@@ -54,7 +56,9 @@ public abstract class AbstractSymmetricA
         parseNestedSymmetricAsymmetricBindingBasePolicy(nestedPolicy, this);
     }
 
-    protected void parseNestedSymmetricAsymmetricBindingBasePolicy(Policy nestedPolicy, AbstractSymmetricAsymmetricBinding asymmetricBindingBase) {
+    protected void parseNestedSymmetricAsymmetricBindingBasePolicy(
+        Policy nestedPolicy,  AbstractSymmetricAsymmetricBinding asymmetricBindingBase
+    ) {
         Iterator<List<Assertion>> alternatives = nestedPolicy.getAlternatives();
         //we just process the first alternative
         //this means that if we have a compact policy only the first alternative is visible
@@ -73,24 +77,30 @@ public abstract class AbstractSymmetricA
                     asymmetricBindingBase.setProtectionOrder(protectionOrder);
                     continue;
                 }
-                if (getVersion().getSPConstants().getEncryptSignature().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getEncryptSignature().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName encryptSignature = getVersion().getSPConstants().getEncryptSignature();
+                if (encryptSignature.getLocalPart().equals(assertionName)
+                    && encryptSignature.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBindingBase.isEncryptSignature()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     asymmetricBindingBase.setEncryptSignature(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getProtectTokens().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getProtectTokens().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName protectTokens = getVersion().getSPConstants().getProtectTokens();
+                if (protectTokens.getLocalPart().equals(assertionName)
+                    && protectTokens.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBindingBase.isProtectTokens()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     asymmetricBindingBase.setProtectTokens(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getOnlySignEntireHeadersAndBody().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getOnlySignEntireHeadersAndBody().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName onlySign = getVersion().getSPConstants().getOnlySignEntireHeadersAndBody(); 
+                if (onlySign.getLocalPart().equals(assertionName)
+                    && onlySign.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBindingBase.isOnlySignEntireHeadersAndBody()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AlgorithmSuite.java Tue Dec 22 16:30:54 2015
@@ -218,10 +218,12 @@ public class AlgorithmSuite extends Abst
         private String mgfAlgo;
         private String ns;
 
-        public AlgorithmSuiteType(String name, String digest, String encryption, String symmetricKeyWrap, String asymmetricKeyWrap,
-                           String encryptionKeyDerivation, String signatureKeyDerivation, int encryptionDerivedKeyLength,
-                           int signatureDerivedKeyLength, int minimumSymmetricKeyLength,
-                           int maximumSymmetricKeyLength, int minimumAsymmetricKeyLength, int maximumAsymmetricKeyLength) {
+        public AlgorithmSuiteType(String name, String digest, String encryption, String symmetricKeyWrap, 
+                                  String asymmetricKeyWrap, String encryptionKeyDerivation, 
+                                  String signatureKeyDerivation, int encryptionDerivedKeyLength,
+                                  int signatureDerivedKeyLength, int minimumSymmetricKeyLength,
+                                  int maximumSymmetricKeyLength, int minimumAsymmetricKeyLength, 
+                                  int maximumAsymmetricKeyLength) {
             this.name = name;
             this.digest = digest;
             this.encryption = encryption;

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AsymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AsymmetricBinding.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AsymmetricBinding.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/AsymmetricBinding.java Tue Dec 22 16:30:54 2015
@@ -62,8 +62,10 @@ public class AsymmetricBinding extends A
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getInitiatorToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getInitiatorToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName initiatorToken = getVersion().getSPConstants().getInitiatorToken();
+                if (initiatorToken.getLocalPart().equals(assertionName)
+                    && initiatorToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBinding.getInitiatorToken() != null
                             || asymmetricBinding.getInitiatorSignatureToken() != null
                             || asymmetricBinding.getInitiatorEncryptionToken() != null) {
@@ -74,8 +76,10 @@ public class AsymmetricBinding extends A
                     initiatorToken1.setParentAssertion(asymmetricBinding);
                     continue;
                 }
-                if (getVersion().getSPConstants().getInitiatorSignatureToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getInitiatorSignatureToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName initiatorSigToken = getVersion().getSPConstants().getInitiatorSignatureToken();
+                if (initiatorSigToken.getLocalPart().equals(assertionName)
+                    && initiatorSigToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBinding.getInitiatorToken() != null
                             || asymmetricBinding.getInitiatorSignatureToken() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
@@ -85,8 +89,10 @@ public class AsymmetricBinding extends A
                     initiatorSignatureToken1.setParentAssertion(asymmetricBinding);
                     continue;
                 }
-                if (getVersion().getSPConstants().getInitiatorEncryptionToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getInitiatorEncryptionToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName initiatorEncToken = getVersion().getSPConstants().getInitiatorEncryptionToken();
+                if (initiatorEncToken.getLocalPart().equals(assertionName)
+                    && initiatorEncToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBinding.getInitiatorToken() != null
                             || asymmetricBinding.getInitiatorEncryptionToken() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
@@ -96,8 +102,10 @@ public class AsymmetricBinding extends A
                     initiatorEncryptionToken1.setParentAssertion(asymmetricBinding);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRecipientToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRecipientToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName recipientToken = getVersion().getSPConstants().getRecipientToken();
+                if (recipientToken.getLocalPart().equals(assertionName)
+                    && recipientToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBinding.getRecipientToken() != null
                             || asymmetricBinding.getRecipientSignatureToken() != null
                             || asymmetricBinding.getRecipientEncryptionToken() != null) {
@@ -108,8 +116,10 @@ public class AsymmetricBinding extends A
                     recipientToken1.setParentAssertion(asymmetricBinding);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRecipientSignatureToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRecipientSignatureToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName recipientSigToken = getVersion().getSPConstants().getRecipientSignatureToken();
+                if (recipientSigToken.getLocalPart().equals(assertionName)
+                    && recipientSigToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBinding.getRecipientToken() != null
                             || asymmetricBinding.getRecipientSignatureToken() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
@@ -119,8 +129,10 @@ public class AsymmetricBinding extends A
                     recipientSignatureToken1.setParentAssertion(asymmetricBinding);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRecipientEncryptionToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRecipientEncryptionToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName recipientEncToken = getVersion().getSPConstants().getRecipientEncryptionToken(); 
+                if (recipientEncToken.getLocalPart().equals(assertionName)
+                    && recipientEncToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (asymmetricBinding.getRecipientToken() != null
                             || asymmetricBinding.getRecipientEncryptionToken() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Attachments.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Attachments.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Attachments.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Attachments.java Tue Dec 22 16:30:54 2015
@@ -31,7 +31,8 @@ public class Attachments extends Abstrac
     private boolean contentSignatureTransform;
     private boolean attachmentCompleteSignatureTransform;
 
-    public Attachments(SPConstants.SPVersion version, boolean contentSignatureTransform, boolean attachmentCompleteSignatureTransform) {
+    public Attachments(SPConstants.SPVersion version, boolean contentSignatureTransform, 
+                       boolean attachmentCompleteSignatureTransform) {
         super(version);
 
         this.contentSignatureTransform = contentSignatureTransform;
@@ -53,10 +54,14 @@ public class Attachments extends Abstrac
         writer.writeStartElement(getName().getPrefix(), getName().getLocalPart(), getName().getNamespaceURI());
         writer.writeNamespace(getName().getPrefix(), getName().getNamespaceURI());
         if (!isNormalized() && isOptional()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_OPTIONAL, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_OPTIONAL, "true");
         }
         if (isIgnorable()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_IGNORABLE, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_IGNORABLE, "true");
         }
         if (isContentSignatureTransform()) {
             writer.writeEmptyElement(

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/HttpsToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/HttpsToken.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/HttpsToken.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/HttpsToken.java Tue Dec 22 16:30:54 2015
@@ -68,7 +68,8 @@ public class HttpsToken extends Abstract
     @Override
     protected AbstractSecurityAssertion cloneAssertion(Policy nestedPolicy) {
         boolean requireClientCert = authenticationType == AuthenticationType.RequireClientCertificate;
-        return new HttpsToken(getVersion(), getIncludeTokenType(), getIssuer(), getIssuerName(), getClaims(), nestedPolicy, requireClientCert);
+        return new HttpsToken(getVersion(), getIncludeTokenType(), getIssuer(), getIssuerName(), 
+                              getClaims(), nestedPolicy, requireClientCert);
     }
 
     protected void parseNestedPolicy(Policy nestedPolicy, HttpsToken httpsToken) {

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/IssuedToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/IssuedToken.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/IssuedToken.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/IssuedToken.java Tue Dec 22 16:30:54 2015
@@ -38,7 +38,8 @@ public class IssuedToken extends Abstrac
     private boolean requireInternalReference;
 
     public IssuedToken(SPConstants.SPVersion version, SPConstants.IncludeTokenType includeTokenType,
-                       Element issuer, String issuerName, Element requestSecurityTokenTemplate, Element claims, Policy nestedPolicy) {
+                       Element issuer, String issuerName, Element requestSecurityTokenTemplate, Element claims, 
+                       Policy nestedPolicy) {
         super(version, includeTokenType, issuer, issuerName, claims, nestedPolicy);
         setRequestSecurityTokenTemplate(requestSecurityTokenTemplate);
 
@@ -63,10 +64,14 @@ public class IssuedToken extends Abstrac
             );
         }
         if (!isNormalized() && isOptional()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_OPTIONAL, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_OPTIONAL, "true");
         }
         if (isIgnorable()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_IGNORABLE, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_IGNORABLE, "true");
         }
         if (getIssuer() != null) {
             SPUtils.serialize(getIssuer(), writer);
@@ -113,16 +118,20 @@ public class IssuedToken extends Abstrac
                     issuedToken.setDerivedKeys(derivedKeys);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRequireExternalReference().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireExternalReference().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireExternalRef = getVersion().getSPConstants().getRequireExternalReference();
+                if (requireExternalRef.getLocalPart().equals(assertionName)
+                    && requireExternalRef.getNamespaceURI().equals(assertionNamespace)) {
                     if (issuedToken.isRequireExternalReference()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     issuedToken.setRequireExternalReference(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRequireInternalReference().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireInternalReference().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireInternalRef = getVersion().getSPConstants().getRequireInternalReference();
+                if (requireInternalRef.getLocalPart().equals(assertionName)
+                    && requireInternalRef.getNamespaceURI().equals(assertionNamespace)) {
                     if (issuedToken.isRequireInternalReference()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/KeyValueToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/KeyValueToken.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/KeyValueToken.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/KeyValueToken.java Tue Dec 22 16:30:54 2015
@@ -30,7 +30,8 @@ public class KeyValueToken extends Abstr
 
     private boolean rsaKeyValue;
 
-    public KeyValueToken(SPConstants.SPVersion version, SPConstants.IncludeTokenType includeTokenType, Policy nestedPolicy) {
+    public KeyValueToken(SPConstants.SPVersion version, SPConstants.IncludeTokenType includeTokenType, 
+                         Policy nestedPolicy) {
         super(version, includeTokenType, null, null, null, nestedPolicy);
         setIncludeTokenType(includeTokenType);
 
@@ -58,8 +59,10 @@ public class KeyValueToken extends Abstr
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getRsaKeyValue().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRsaKeyValue().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName rsaKeyValue = getVersion().getSPConstants().getRsaKeyValue();
+                if (rsaKeyValue.getLocalPart().equals(assertionName)
+                    && rsaKeyValue.getNamespaceURI().equals(assertionNamespace)) {
                     if (keyValueToken.isRsaKeyValue()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/RequiredElements.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/RequiredElements.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/RequiredElements.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/RequiredElements.java Tue Dec 22 16:30:54 2015
@@ -57,13 +57,17 @@ public class RequiredElements extends Ab
         writer.writeStartElement(getName().getPrefix(), getName().getLocalPart(), getName().getNamespaceURI());
         writer.writeNamespace(getName().getPrefix(), getName().getNamespaceURI());
         if (!isNormalized() && isOptional()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_OPTIONAL, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_OPTIONAL, "true");
         }
         if (getXPathVersion() != null) {
             writer.writeAttribute(SPConstants.XPATH_VERSION, getXPathVersion());
         }
         if (isIgnorable()) {
-            writer.writeAttribute(Constants.ATTR_WSP, writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), Constants.ATTR_IGNORABLE, "true");
+            writer.writeAttribute(Constants.ATTR_WSP, 
+                                  writer.getNamespaceContext().getNamespaceURI(Constants.ATTR_WSP), 
+                                  Constants.ATTR_IGNORABLE, "true");
         }
         for (int i = 0; i < xPaths.size(); i++) {
             XPath xPath = xPaths.get(i);
@@ -82,7 +86,8 @@ public class RequiredElements extends Ab
                         getVersion().getSPConstants().getXPath2Expression().getNamespaceURI());
                 writer.writeAttribute(SPConstants.FILTER, xPath.getFilter());
             }
-            Iterator<Map.Entry<String, String>> namespaceIterator = xPath.getPrefixNamespaceMap().entrySet().iterator();
+            Iterator<Map.Entry<String, String>> namespaceIterator = 
+                xPath.getPrefixNamespaceMap().entrySet().iterator();
             while (namespaceIterator.hasNext()) {
                 Map.Entry<String, String> namespaceEntry = namespaceIterator.next();
                 writer.writeNamespace(namespaceEntry.getKey(), namespaceEntry.getValue());

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SamlToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SamlToken.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SamlToken.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SamlToken.java Tue Dec 22 16:30:54 2015
@@ -65,7 +65,8 @@ public class SamlToken extends AbstractT
 
     @Override
     protected AbstractSecurityAssertion cloneAssertion(Policy nestedPolicy) {
-        return new SamlToken(getVersion(), getIncludeTokenType(), getIssuer(), getIssuerName(), getClaims(), nestedPolicy);
+        return new SamlToken(getVersion(), getIncludeTokenType(), getIssuer(), getIssuerName(), 
+                             getClaims(), nestedPolicy);
     }
 
     protected void parseNestedPolicy(Policy nestedPolicy, SamlToken samlToken) {
@@ -87,8 +88,11 @@ public class SamlToken extends AbstractT
                     samlToken.setDerivedKeys(derivedKeys);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRequireKeyIdentifierReference().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireKeyIdentifierReference().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireKeyIdentifierRef = 
+                    getVersion().getSPConstants().getRequireKeyIdentifierReference();
+                if (requireKeyIdentifierRef.getLocalPart().equals(assertionName)
+                    && requireKeyIdentifierRef.getNamespaceURI().equals(assertionNamespace)) {
                     if (samlToken.isRequireKeyIdentifierReference()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SupportingTokens.java Tue Dec 22 16:30:54 2015
@@ -93,40 +93,50 @@ public class SupportingTokens extends Ab
                     abstractToken.setParentAssertion(supportingTokens);
                     continue;
                 }
-                if (getVersion().getSPConstants().getAlgorithmSuite().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getAlgorithmSuite().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName algSuite = getVersion().getSPConstants().getAlgorithmSuite();
+                if (algSuite.getLocalPart().equals(assertionName)
+                    && algSuite.getNamespaceURI().equals(assertionNamespace)) {
                     if (supportingTokens.getAlgorithmSuite() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     supportingTokens.setAlgorithmSuite((AlgorithmSuite) assertion);
                     continue;
                 }
-                if (getVersion().getSPConstants().getSignedParts().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getSignedParts().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName signedParts = getVersion().getSPConstants().getSignedParts();
+                if (signedParts.getLocalPart().equals(assertionName)
+                    && signedParts.getNamespaceURI().equals(assertionNamespace)) {
                     if (supportingTokens.getSignedParts() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     supportingTokens.setSignedParts((SignedParts) assertion);
                     continue;
                 }
-                if (getVersion().getSPConstants().getSignedElements().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getSignedElements().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName signedElements = getVersion().getSPConstants().getSignedElements();
+                if (signedElements.getLocalPart().equals(assertionName)
+                    && signedElements.getNamespaceURI().equals(assertionNamespace)) {
                     if (supportingTokens.getSignedElements() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     supportingTokens.setSignedElements((SignedElements) assertion);
                     continue;
                 }
-                if (getVersion().getSPConstants().getEncryptedParts().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getEncryptedParts().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName encryptedParts = getVersion().getSPConstants().getEncryptedParts();
+                if (encryptedParts.getLocalPart().equals(assertionName)
+                    && encryptedParts.getNamespaceURI().equals(assertionNamespace)) {
                     if (supportingTokens.getEncryptedParts() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     supportingTokens.setEncryptedParts((EncryptedParts) assertion);
                     continue;
                 }
-                if (getVersion().getSPConstants().getEncryptedElements().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getEncryptedElements().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName encryptedElements = getVersion().getSPConstants().getEncryptedElements();
+                if (encryptedElements.getLocalPart().equals(assertionName)
+                    && encryptedElements.getNamespaceURI().equals(assertionNamespace)) {
                     if (supportingTokens.getEncryptedElements() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SymmetricBinding.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SymmetricBinding.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SymmetricBinding.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/SymmetricBinding.java Tue Dec 22 16:30:54 2015
@@ -59,24 +59,32 @@ public class SymmetricBinding extends Ab
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getEncryptionToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getEncryptionToken().getNamespaceURI().equals(assertionNamespace)) {
-                    if (symmetricBinding.getEncryptionToken() != null || symmetricBinding.getProtectionToken() != null) {
+                
+                QName encryptionToken = getVersion().getSPConstants().getEncryptionToken();
+                if (encryptionToken.getLocalPart().equals(assertionName)
+                    && encryptionToken.getNamespaceURI().equals(assertionNamespace)) {
+                    if (symmetricBinding.getEncryptionToken() != null 
+                        || symmetricBinding.getProtectionToken() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     symmetricBinding.setEncryptionToken((EncryptionToken) assertion);
                     continue;
                 }
-                if (getVersion().getSPConstants().getSignatureToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getSignatureToken().getNamespaceURI().equals(assertionNamespace)) {
-                    if (symmetricBinding.getSignatureToken() != null || symmetricBinding.getProtectionToken() != null) {
+                
+                QName signatureToken = getVersion().getSPConstants().getSignatureToken();
+                if (signatureToken.getLocalPart().equals(assertionName)
+                    && signatureToken.getNamespaceURI().equals(assertionNamespace)) {
+                    if (symmetricBinding.getSignatureToken() != null 
+                        || symmetricBinding.getProtectionToken() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     symmetricBinding.setSignatureToken((SignatureToken) assertion);
                     continue;
                 }
-                if (getVersion().getSPConstants().getProtectionToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getProtectionToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName protectionToken = getVersion().getSPConstants().getProtectionToken();
+                if (protectionToken.getLocalPart().equals(assertionName)
+                    && protectionToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (symmetricBinding.getProtectionToken() != null
                             || symmetricBinding.getEncryptionToken() != null
                             || symmetricBinding.getSignatureToken() != null) {

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/TransportBinding.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/TransportBinding.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/TransportBinding.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/TransportBinding.java Tue Dec 22 16:30:54 2015
@@ -59,8 +59,10 @@ public class TransportBinding extends Ab
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getTransportToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getTransportToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName transportToken = getVersion().getSPConstants().getTransportToken();
+                if (transportToken.getLocalPart().equals(assertionName)
+                    && transportToken.getNamespaceURI().equals(assertionNamespace)) {
                     if (transportBinding.getTransportToken() != null) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust10.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust10.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust10.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust10.java Tue Dec 22 16:30:54 2015
@@ -82,40 +82,50 @@ public class Trust10 extends AbstractSec
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getMustSupportClientChallenge().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportClientChallenge().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportClientChallenge = getVersion().getSPConstants().getMustSupportClientChallenge();
+                if (mustSupportClientChallenge.getLocalPart().equals(assertionName)
+                    && mustSupportClientChallenge.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust10.isMustSupportClientChallenge()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     trust10.setMustSupportClientChallenge(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getMustSupportServerChallenge().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportServerChallenge().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportServerChallenge = getVersion().getSPConstants().getMustSupportServerChallenge();
+                if (mustSupportServerChallenge.getLocalPart().equals(assertionName)
+                    && mustSupportServerChallenge.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust10.isMustSupportServerChallenge()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     trust10.setMustSupportServerChallenge(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRequireClientEntropy().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireClientEntropy().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireClientEntropy = getVersion().getSPConstants().getRequireClientEntropy();
+                if (requireClientEntropy.getLocalPart().equals(assertionName)
+                    && requireClientEntropy.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust10.isRequireClientEntropy()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     trust10.setRequireClientEntropy(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRequireServerEntropy().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireServerEntropy().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireServerEntropy = getVersion().getSPConstants().getRequireServerEntropy();
+                if (requireServerEntropy.getLocalPart().equals(assertionName)
+                    && requireServerEntropy.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust10.isRequireServerEntropy()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     trust10.setRequireServerEntropy(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getMustSupportIssuedTokens().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportIssuedTokens().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportIssuedTokens = getVersion().getSPConstants().getMustSupportIssuedTokens();
+                if (mustSupportIssuedTokens.getLocalPart().equals(assertionName)
+                    && mustSupportIssuedTokens.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust10.isMustSupportIssuedTokens()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust13.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust13.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust13.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Trust13.java Tue Dec 22 16:30:54 2015
@@ -61,32 +61,41 @@ public class Trust13 extends Trust10 {
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getRequireRequestSecurityTokenCollection().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireRequestSecurityTokenCollection().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireRSTC = getVersion().getSPConstants().getRequireRequestSecurityTokenCollection();
+                if (requireRSTC.getLocalPart().equals(assertionName)
+                    && requireRSTC.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust13.isRequireRequestSecurityTokenCollection()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     trust13.setRequireRequestSecurityTokenCollection(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRequireAppliesTo().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireAppliesTo().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireAppliesTo = getVersion().getSPConstants().getRequireAppliesTo();
+                if (requireAppliesTo.getLocalPart().equals(assertionName)
+                    && requireAppliesTo.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust13.isRequireAppliesTo()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     trust13.setRequireAppliesTo(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getScopePolicy15().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getScopePolicy15().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName scopePolicy15 = getVersion().getSPConstants().getScopePolicy15();
+                if (scopePolicy15.getLocalPart().equals(assertionName)
+                    && scopePolicy15.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust13.isScopePolicy15()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     trust13.setScopePolicy15(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getMustSupportInteractiveChallenge().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportInteractiveChallenge().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName supportInteractiveChallenge = 
+                    getVersion().getSPConstants().getMustSupportInteractiveChallenge();
+                if (supportInteractiveChallenge.getLocalPart().equals(assertionName)
+                    && supportInteractiveChallenge.getNamespaceURI().equals(assertionNamespace)) {
                     if (trust13.isMustSupportInteractiveChallenge()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss10.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss10.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss10.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss10.java Tue Dec 22 16:30:54 2015
@@ -81,32 +81,40 @@ public class Wss10 extends AbstractSecur
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getMustSupportRefKeyIdentifier().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportRefKeyIdentifier().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportRefKeyIdentifier = getVersion().getSPConstants().getMustSupportRefKeyIdentifier();
+                if (mustSupportRefKeyIdentifier.getLocalPart().equals(assertionName)
+                    && mustSupportRefKeyIdentifier.getNamespaceURI().equals(assertionNamespace)) {
                     if (wss10.isMustSupportRefKeyIdentifier()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     wss10.setMustSupportRefKeyIdentifier(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getMustSupportRefIssuerSerial().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportRefIssuerSerial().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportRefIssuerSerial = getVersion().getSPConstants().getMustSupportRefIssuerSerial();
+                if (mustSupportRefIssuerSerial.getLocalPart().equals(assertionName)
+                    && mustSupportRefIssuerSerial.getNamespaceURI().equals(assertionNamespace)) {
                     if (wss10.isMustSupportRefIssuerSerial()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     wss10.setMustSupportRefIssuerSerial(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getMustSupportRefExternalUri().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportRefExternalUri().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportRefExternal = getVersion().getSPConstants().getMustSupportRefExternalUri();
+                if (mustSupportRefExternal.getLocalPart().equals(assertionName)
+                    && mustSupportRefExternal.getNamespaceURI().equals(assertionNamespace)) {
                     if (wss10.isMustSupportRefExternalURI()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     wss10.setMustSupportRefExternalURI(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getMustSupportRefEmbeddedToken().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportRefEmbeddedToken().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportRefEmbedded = getVersion().getSPConstants().getMustSupportRefEmbeddedToken();
+                if (mustSupportRefEmbedded.getLocalPart().equals(assertionName)
+                    && mustSupportRefEmbedded.getNamespaceURI().equals(assertionNamespace)) {
                     if (wss10.isMustSupportRefEmbeddedToken()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }

Modified: webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss11.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss11.java?rev=1721425&r1=1721424&r2=1721425&view=diff
==============================================================================
--- webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss11.java (original)
+++ webservices/wss4j/trunk/policy/src/main/java/org/apache/wss4j/policy/model/Wss11.java Tue Dec 22 16:30:54 2015
@@ -59,24 +59,30 @@ public class Wss11 extends Wss10 {
                 Assertion assertion = assertions.get(i);
                 String assertionName = assertion.getName().getLocalPart();
                 String assertionNamespace = assertion.getName().getNamespaceURI();
-                if (getVersion().getSPConstants().getMustSupportRefThumbprint().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportRefThumbprint().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportRefThumbprint = getVersion().getSPConstants().getMustSupportRefThumbprint();
+                if (mustSupportRefThumbprint.getLocalPart().equals(assertionName)
+                    && mustSupportRefThumbprint.getNamespaceURI().equals(assertionNamespace)) {
                     if (wss11.isMustSupportRefThumbprint()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     wss11.setMustSupportRefThumbprint(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getMustSupportRefEncryptedKey().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getMustSupportRefEncryptedKey().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName mustSupportRefEncryptedKey = getVersion().getSPConstants().getMustSupportRefEncryptedKey();
+                if (mustSupportRefEncryptedKey.getLocalPart().equals(assertionName)
+                    && mustSupportRefEncryptedKey.getNamespaceURI().equals(assertionNamespace)) {
                     if (wss11.isMustSupportRefEncryptedKey()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }
                     wss11.setMustSupportRefEncryptedKey(true);
                     continue;
                 }
-                if (getVersion().getSPConstants().getRequireSignatureConfirmation().getLocalPart().equals(assertionName)
-                        && getVersion().getSPConstants().getRequireSignatureConfirmation().getNamespaceURI().equals(assertionNamespace)) {
+                
+                QName requireSigConf = getVersion().getSPConstants().getRequireSignatureConfirmation();
+                if (requireSigConf.getLocalPart().equals(assertionName)
+                    && requireSigConf.getNamespaceURI().equals(assertionNamespace)) {
                     if (wss11.isRequireSignatureConfirmation()) {
                         throw new IllegalArgumentException(SPConstants.ERR_INVALID_POLICY);
                     }