ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1336562 - in /webservices/wss4j/trunk/src/main/java/org/apache/ws/security: ./ action/ components/crypto/ conversation/ conversation/dkalgo/ handler/ message/token/ processor/ saml/ saml/ext/ saml/ext/builder/ spnego/ str/ transform/ util/...
Date Thu, 10 May 2012 09:38:27 GMT
Author: coheigea
Date: Thu May 10 09:38:25 2012
New Revision: 1336562

URL: http://svn.apache.org/viewvc?rev=1336562&view=rev
Log:
More cleanup

Modified:
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSConstants.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/UsernameTokenAction.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/Merlin.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/MerlinDevice.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/X509Util.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerFactory.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLUtil.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1Constants.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2ComponentBuilder.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2Constants.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/spnego/SpnegoTokenContext.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransformUtil.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Base64.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/DOM2Writer.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Loader.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/NSStack.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/StringUtil.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/UUIDGenerator.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/XMLUtils.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/JAASUsernameTokenValidator.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/KerberosTokenValidator.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/SamlAssertionValidator.java

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSConstants.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSConstants.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSConstants.java Thu May 10 09:38:25 2012
@@ -24,7 +24,7 @@ import javax.xml.namespace.QName;
 /**
  * Constants in WS-Security spec.
  */
-public class WSConstants {
+public final class WSConstants {
     
     /*
      * Standard constants used in WSS4J
@@ -455,4 +455,8 @@ public class WSConstants {
     public static final int WSE_DERIVED_KEY_LEN = 16;
     public static final String LABEL_FOR_DERIVED_KEY = "WS-Security";
     
+    private WSConstants() {
+        // Complete
+    }
+    
 }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/UsernameTokenAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/UsernameTokenAction.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/UsernameTokenAction.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/UsernameTokenAction.java Thu May 10 09:38:25 2012
@@ -46,11 +46,11 @@ public class UsernameTokenAction impleme
 
         if (reqData.getUtElements() != null && reqData.getUtElements().length > 0) {
             for (int j = 0; j < reqData.getUtElements().length; j++) {
-                reqData.getUtElements()[j].trim();
-                if (reqData.getUtElements()[j].equals("Nonce")) {
+                String utElement = reqData.getUtElements()[j].trim();
+                if (utElement.equals("Nonce")) {
                     builder.addNonce();
                 }
-                if (reqData.getUtElements()[j].equals("Created")) {
+                if (utElement.equals("Created")) {
                     builder.addCreated();
                 }
                 reqData.getUtElements()[j] = null;

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java Thu May 10 09:38:25 2012
@@ -37,7 +37,7 @@ import java.util.Properties;
 public abstract class CryptoFactory {
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(CryptoFactory.class);
-    private static final Class<? extends Crypto> defaultCryptoClass = 
+    private static final Class<? extends Crypto> DEFAULT_CRYPTO_CLASS = 
         org.apache.ws.security.components.crypto.Merlin.class;
 
     /**
@@ -102,7 +102,7 @@ public abstract class CryptoFactory {
         Class<? extends Crypto> cryptoClass = null;
         if (cryptoClassName == null 
             || cryptoClassName.equals("org.apache.ws.security.components.crypto.Merlin")) {
-            cryptoClass = defaultCryptoClass;
+            cryptoClass = DEFAULT_CRYPTO_CLASS;
         } else {
             try {
                 // instruct the class loader to load the crypto implementation
@@ -254,7 +254,8 @@ public abstract class CryptoFactory {
             throw new WSSecurityException(
                 WSSecurityException.FAILURE, 
                 "resourceNotFound",
-                new Object[]{propFilename}
+                new Object[]{propFilename},
+                e
             );
         }
         return properties;

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/Merlin.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/Merlin.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/Merlin.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/Merlin.java Thu May 10 09:38:25 2012
@@ -116,7 +116,7 @@ public class Merlin extends CryptoBase {
     
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(Merlin.class);
-    private static final boolean doDebug = LOG.isDebugEnabled();
+    private static final boolean DO_DEBUG = LOG.isDebugEnabled();
 
     protected static CertificateFactory certFact;
     protected Properties properties = null;
@@ -188,7 +188,7 @@ public class Merlin extends CryptoBase {
                     type = type.trim();
                 }
                 keystore = load(is, passwd, provider, type);
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(
                         "The KeyStore " + keyStoreLocation + " of type " + type 
                         + " has been loaded"
@@ -204,7 +204,7 @@ public class Merlin extends CryptoBase {
                 }
             }
         } else {
-            if (doDebug) {
+            if (DO_DEBUG) {
                 LOG.debug("The KeyStore is not loaded as KEYSTORE_FILE is null");
             }
         }
@@ -227,7 +227,7 @@ public class Merlin extends CryptoBase {
                     type = type.trim();
                 }
                 truststore = load(is, passwd, provider, type);
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(
                         "The TrustStore " + trustStoreLocation + " of type " + type 
                         + " has been loaded"
@@ -256,7 +256,7 @@ public class Merlin extends CryptoBase {
                         cacertsPasswd = cacertsPasswd.trim();
                     }
                     truststore = load(is, cacertsPasswd, null, KeyStore.getDefaultType());
-                    if (doDebug) {
+                    if (DO_DEBUG) {
                         LOG.debug("CA certs have been loaded");
                     }
                     loadCACerts = true;
@@ -293,13 +293,13 @@ public class Merlin extends CryptoBase {
                             provider
                         );
                 }
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(
                         "The CRL " + crlLocation + " has been loaded"
                     );
                 }
             } catch (Exception e) {
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(e.getMessage(), e);
                 }
                 throw new CredentialException(CredentialException.IO_ERROR, "ioError00", e);
@@ -331,7 +331,7 @@ public class Merlin extends CryptoBase {
                 try {
                     is = new FileInputStream(location);
                 } catch (Exception e) {
-                    if (doDebug) {
+                    if (DO_DEBUG) {
                         LOG.debug(e.getMessage(), e);
                     }
                     throw new CredentialException(
@@ -365,17 +365,17 @@ public class Merlin extends CryptoBase {
             ks.load(input, (storepass == null || storepass.length() == 0) 
                 ? new char[0] : storepass.toCharArray());
         } catch (IOException e) {
-            if (doDebug) {
+            if (DO_DEBUG) {
                 LOG.debug(e.getMessage(), e);
             }
             throw new CredentialException(CredentialException.IO_ERROR, "ioError00", e);
         } catch (GeneralSecurityException e) {
-            if (doDebug) {
+            if (DO_DEBUG) {
                 LOG.debug(e.getMessage(), e);
             }
             throw new CredentialException(CredentialException.SEC_ERROR, "secError00", e);
         } catch (Exception e) {
-            if (doDebug) {
+            if (DO_DEBUG) {
                 LOG.debug(e.getMessage(), e);
             }
             throw new CredentialException(CredentialException.FAILURE, "error00", e);

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/MerlinDevice.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/MerlinDevice.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/MerlinDevice.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/components/crypto/MerlinDevice.java Thu May 10 09:38:25 2012
@@ -39,7 +39,7 @@ public class MerlinDevice extends Merlin
     
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(MerlinDevice.class);
-    private static final boolean doDebug = LOG.isDebugEnabled();
+    private static final boolean DO_DEBUG = LOG.isDebugEnabled();
 
     
     @Override
@@ -86,7 +86,7 @@ public class MerlinDevice extends Merlin
 
             try {
                 keystore = load(is, keyStorePassword, provider, keyStoreType);
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(
                         "The KeyStore " + keyStoreLocation + " of type " + keyStoreType 
                         + " has been loaded"
@@ -123,7 +123,7 @@ public class MerlinDevice extends Merlin
 
             try {
                 truststore = load(is, trustStorePassword, provider, trustStoreType);
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(
                         "The TrustStore " + trustStoreLocation + " of type " + trustStoreType 
                         + " has been loaded"
@@ -147,7 +147,7 @@ public class MerlinDevice extends Merlin
                     cacertsPasswd = cacertsPasswd.trim();
                 }
                 truststore = load(is, cacertsPasswd, null, KeyStore.getDefaultType());
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug("CA certs have been loaded");
                 }
                 loadCACerts = true;
@@ -185,13 +185,13 @@ public class MerlinDevice extends Merlin
                             provider
                         );
                 }
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(
                         "The CRL " + crlLocation + " has been loaded"
                     );
                 }
             } catch (Exception e) {
-                if (doDebug) {
+                if (DO_DEBUG) {
                     LOG.debug(e.getMessage(), e);
                 }
                 throw new CredentialException(CredentialException.IO_ERROR, "ioError00", e);

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java Thu May 10 09:38:25 2012
@@ -24,7 +24,7 @@ import javax.xml.namespace.QName;
 /**
  * Class ConversationConstants
  */
-public class ConversationConstants {
+public final class ConversationConstants {
 
     public static final int VERSION_05_02 = 1;
     
@@ -163,6 +163,10 @@ public class ConversationConstants {
      */
     public static final String KEY_CONTEXT_MAP = "contextMap";
     
+    private ConversationConstants() {
+        // Complete
+    }
+    
     public interface DerivationAlgorithm {
         String P_SHA_1 = 
             "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java Thu May 10 09:38:25 2012
@@ -26,7 +26,11 @@ import org.apache.ws.security.conversati
  * @author Ruchith Fernando
  */
 
-public class AlgoFactory {
+public final class AlgoFactory {
+    
+    private AlgoFactory() {
+        // Complete
+    }
 
     /**
      * This gives a DerivationAlgorithm instance from the default set of algorithms provided

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/handler/WSHandlerConstants.java Thu May 10 09:38:25 2012
@@ -30,12 +30,16 @@ import java.util.Map;
  *  
  * @author Werner Dittmann (werner@apache.org)
  */
-public class WSHandlerConstants {
+public final class WSHandlerConstants {
     
     //
     // Action configuration tags
     //
     
+    private WSHandlerConstants() {
+        // Complete
+    }
+    
     /**
      * The action parameter. The handlers use the value of this parameter to determine how
      * to process the SOAP Envelope. It is a blank separated list of actions to perform.

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/KerberosSecurity.java Thu May 10 09:38:25 2012
@@ -138,7 +138,8 @@ public class KerberosSecurity extends Bi
             throw new WSSecurityException(
                 WSSecurityException.FAILURE,
                 "kerberosLoginError", 
-                new Object[] {ex.getMessage()}
+                new Object[] {ex.getMessage()},
+                ex
             );
         }
         if (log.isDebugEnabled()) {

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/EncryptedKeyProcessor.java Thu May 10 09:38:25 2012
@@ -357,7 +357,8 @@ public class EncryptedKeyProcessor imple
             symmetricKey = WSSecurityUtil.prepareSecretKey(symEncAlgo, decryptedData);
         } catch (IllegalArgumentException ex) {
             throw new WSSecurityException(
-                WSSecurityException.UNSUPPORTED_ALGORITHM, "badEncAlgo", new Object[]{symEncAlgo}
+                WSSecurityException.UNSUPPORTED_ALGORITHM, "badEncAlgo", 
+                new Object[]{symEncAlgo}, ex
             );
         }
 

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/X509Util.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/X509Util.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/X509Util.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/X509Util.java Thu May 10 09:38:25 2012
@@ -33,9 +33,13 @@ import javax.security.auth.callback.Call
 import javax.security.auth.callback.UnsupportedCallbackException;
 import java.io.IOException;
 
-public class X509Util {
+public final class X509Util {
     private static org.apache.commons.logging.Log log = 
         org.apache.commons.logging.LogFactory.getLog(X509Util.class);
+    
+    private X509Util() {
+        // Complete
+    }
 
     public static boolean isContent(Node encBodyData) {
         if (encBodyData != null) {

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerFactory.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerFactory.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerFactory.java Thu May 10 09:38:25 2012
@@ -36,7 +36,7 @@ import java.util.Properties;
 public abstract class SAMLIssuerFactory {
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(SAMLIssuerFactory.class);
-    private static final Class<? extends SAMLIssuer> defaultSAMLClass = 
+    private static final Class<? extends SAMLIssuer> DEFAULT_SAML_CLASS = 
         org.apache.ws.security.saml.SAMLIssuerImpl.class;
 
     /**
@@ -104,7 +104,7 @@ public abstract class SAMLIssuerFactory 
         Class<? extends SAMLIssuer> samlIssuerClass = null;
         if (samlClassName == null 
             || samlClassName.equals("org.apache.ws.security.saml.SAMLIssuerImpl")) {
-            samlIssuerClass = defaultSAMLClass;
+            samlIssuerClass = DEFAULT_SAML_CLASS;
         } else {
             try {
                 // instruct the class loader to load the crypto implementation
@@ -170,7 +170,8 @@ public abstract class SAMLIssuerFactory 
             throw new WSSecurityException(
                 WSSecurityException.FAILURE, 
                 "resourceNotFound",
-                new Object[]{propFilename}
+                new Object[]{propFilename},
+                e
             );
         }
         return properties;

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java Thu May 10 09:38:25 2012
@@ -57,12 +57,16 @@ import java.util.List;
 /**
  * Utility methods for SAML stuff
  */
-public class SAMLUtil {
+public final class SAMLUtil {
     
     private static final QName BINARY_SECRET = 
         new QName(WSConstants.WST_NS, "BinarySecret");
     private static final QName BINARY_SECRET_05_12 = 
         new QName(WSConstants.WST_NS_05_12, "BinarySecret");
+    
+    private SAMLUtil() {
+        // Complete
+    }
 
     /**
      * Get an AssertionWrapper object from parsing a SecurityTokenReference that uses

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java Thu May 10 09:38:25 2012
@@ -662,9 +662,13 @@ public class AssertionWrapper {
                 XMLSignature xmlSignature = new XMLSignature(signatureElement, "");
                 return xmlSignature.getSignatureValue();
             } catch (XMLSignatureException e) {
-                throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
+                throw new WSSecurityException(
+                    WSSecurityException.FAILURE, "invalidSAMLsecurity", null, e
+                );
             } catch (XMLSecurityException e) {
-                throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
+                throw new WSSecurityException(
+                    WSSecurityException.FAILURE, "invalidSAMLsecurity", null, e
+                );
             }
         }
         return null;

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLUtil.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLUtil.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLUtil.java Thu May 10 09:38:25 2012
@@ -36,7 +36,7 @@ import org.w3c.dom.Element;
  * <p/>
  * Created on May 18, 2009
  */
-public class OpenSAMLUtil {
+public final class OpenSAMLUtil {
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(OpenSAMLUtil.class);
 
@@ -44,6 +44,10 @@ public class OpenSAMLUtil {
     private static MarshallerFactory marshallerFactory;
     private static UnmarshallerFactory unmarshallerFactory;
     private static boolean samlEngineInitialized = false;
+    
+    private OpenSAMLUtil() {
+        // Complete
+    }
 
     /**
      * Initialise the SAML library

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java Thu May 10 09:38:25 2012
@@ -72,7 +72,7 @@ import java.util.List;
  * <p/>
  * Created on May 18, 2009
  */
-public class SAML1ComponentBuilder {
+public final class SAML1ComponentBuilder {
     
     private static volatile SAMLObjectBuilder<Assertion> assertionV1Builder;
     
@@ -109,6 +109,10 @@ public class SAML1ComponentBuilder {
     
     private static volatile SAMLObjectBuilder<SubjectLocality> subjectLocalityBuilder;
 
+    private SAML1ComponentBuilder() {
+        // Complete
+    }
+    
     /**
      * Create a new SAML 1.1 assertion
      *

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1Constants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1Constants.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1Constants.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1Constants.java Thu May 10 09:38:25 2012
@@ -26,7 +26,7 @@ package org.apache.ws.security.saml.ext.
  * <p/>
  * Created on May 18, 2009
  */
-public class SAML1Constants {
+public final class SAML1Constants {
     
     //
     // NAME ID FORMAT
@@ -142,4 +142,8 @@ public class SAML1Constants {
      */
     public static final String AUTH_METHOD_UNSPECIFIED = 
         "urn:oasis:names:tc:SAML:1.0:am:unspecified";
+    
+    private SAML1Constants() {
+        // Complete
+    }
 }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2ComponentBuilder.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2ComponentBuilder.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2ComponentBuilder.java Thu May 10 09:38:25 2012
@@ -75,7 +75,7 @@ import java.util.List;
  * <p/>
  * Created on May 18, 2009
  */
-public class SAML2ComponentBuilder {
+public final class SAML2ComponentBuilder {
     private static volatile SAMLObjectBuilder<Assertion> assertionBuilder;
     
     private static volatile SAMLObjectBuilder<Issuer> issuerBuilder;
@@ -116,6 +116,10 @@ public class SAML2ComponentBuilder {
     
     private static volatile SAMLObjectBuilder<SubjectLocality> subjectLocalityBuilder;
 
+    private SAML2ComponentBuilder() {
+        // Complete
+    }
+    
     /**
      * Create a SAML 2 assertion
      *

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2Constants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2Constants.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2Constants.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML2Constants.java Thu May 10 09:38:25 2012
@@ -26,7 +26,7 @@ package org.apache.ws.security.saml.ext.
  * <p/>
  * Created on May 18, 2009
  */
-public class SAML2Constants {
+public final class SAML2Constants {
     //
     // NAME ID FORMAT
     //
@@ -159,4 +159,8 @@ public class SAML2Constants {
     
     public static final String ATTRNAME_FORMAT_BASIC = 
         "urn:oasis:names:tc:SAML:2.0:attrname-format:basic";
+    
+    private SAML2Constants() {
+        // Complete
+    }
 }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/spnego/SpnegoTokenContext.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/spnego/SpnegoTokenContext.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/spnego/SpnegoTokenContext.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/spnego/SpnegoTokenContext.java Thu May 10 09:38:25 2012
@@ -75,7 +75,8 @@ public class SpnegoTokenContext {
             throw new WSSecurityException(
                 WSSecurityException.FAILURE,
                 "kerberosLoginError", 
-                new Object[] {ex.getMessage()}
+                new Object[] {ex.getMessage()},
+                ex
             );
         }
         if (LOG.isDebugEnabled()) {
@@ -139,7 +140,8 @@ public class SpnegoTokenContext {
             throw new WSSecurityException(
                 WSSecurityException.FAILURE,
                 "kerberosLoginError", 
-                new Object[] {ex.getMessage()}
+                new Object[] {ex.getMessage()},
+                ex
             );
         }
         if (LOG.isDebugEnabled()) {
@@ -209,7 +211,7 @@ public class SpnegoTokenContext {
                 LOG.debug("Error in cleaning up a GSS context", e);
             }
             throw new WSSecurityException(
-                WSSecurityException.FAILURE, "spnegoKeyError"
+                WSSecurityException.FAILURE, "spnegoKeyError", null, e
             );
         }
     }
@@ -226,7 +228,7 @@ public class SpnegoTokenContext {
                 LOG.debug("Error in cleaning up a GSS context", e);
             }
             throw new WSSecurityException(
-                WSSecurityException.FAILURE, "spnegoKeyError"
+                WSSecurityException.FAILURE, "spnegoKeyError", null, e
             );
         }
     }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java Thu May 10 09:38:25 2012
@@ -306,7 +306,7 @@ public class SignatureSTRParser implemen
     private Principal createPrincipalFromSAML(
         AssertionWrapper assertion
     ) {
-        SAMLTokenPrincipal principal = new SAMLTokenPrincipal(assertion);
+        SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipal(assertion);
         String confirmMethod = null;
         List<String> methods = assertion.getConfirmationMethods();
         if (methods != null && methods.size() > 0) {
@@ -315,7 +315,7 @@ public class SignatureSTRParser implemen
         if (OpenSAMLUtil.isMethodHolderOfKey(confirmMethod) && assertion.isSigned()) {
             trustedCredential = true;
         }
-        return principal;
+        return samlPrincipal;
     }
     
     /**

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransformUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransformUtil.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransformUtil.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransformUtil.java Thu May 10 09:38:25 2012
@@ -36,10 +36,10 @@ import org.w3c.dom.Text;
 /**
  * Utility class exposing the dereferencing logic of the {@link STRTransform} implementation.
  */
-public class STRTransformUtil {
+public final class STRTransformUtil {
     private static org.apache.commons.logging.Log log = 
         org.apache.commons.logging.LogFactory.getLog(STRTransformUtil.class);
-
+    
     /**
      * Retrieves the element representing the referenced content of a STR.
      * 

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Base64.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Base64.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Base64.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Base64.java Thu May 10 09:38:25 2012
@@ -225,11 +225,12 @@ public final class Base64 {
             if (!isData((d1 = base64Data[dataIndex++]))
                     || !isData((d2 = base64Data[dataIndex++]))
                     || !isData((d3 = base64Data[dataIndex++]))
-                    || !isData((d4 = base64Data[dataIndex++])))
+                    || !isData((d4 = base64Data[dataIndex++]))) {
                 throw new WSSecurityException("decoding.general");// if found
                                                                   // "no data"
                                                                   // just return
                                                                   // null
+            }
 
             b1 = BASE_64_ALPHABET[d1];
             b2 = BASE_64_ALPHABET[d2];
@@ -288,7 +289,6 @@ public final class Base64 {
             decodedData[encodedIndex++] = (byte)(b1 << 2 | b2 >> 4);
             decodedData[encodedIndex++] = (byte)(((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
             decodedData[encodedIndex++] = (byte)(b3 << 6 | b4);
-
         }
 
         return decodedData;

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/DOM2Writer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/DOM2Writer.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/DOM2Writer.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/DOM2Writer.java Thu May 10 09:38:25 2012
@@ -38,10 +38,14 @@ import java.io.Writer;
  * @author Matthew J. Duftler (duftler@us.ibm.com)
  * @author Joseph Kesselman
  */
-public class DOM2Writer {
+public final class DOM2Writer {
     public static final char NL = '\n';
     public static final String LS = System.getProperty("line.separator",
             (Character.valueOf(NL)).toString());
+    
+    private DOM2Writer() {
+        // Complete
+    }
 
     /**
      * Return a string containing this node serialized as XML.

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Loader.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Loader.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Loader.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/Loader.java Thu May 10 09:38:25 2012
@@ -30,9 +30,13 @@ import java.security.PrivilegedAction;
  *
  * @author Davanum Srinivas (dims@yahoo.com).
  */
-public class Loader {
+public final class Loader {
     private static org.apache.commons.logging.Log log = 
         org.apache.commons.logging.LogFactory.getLog(Loader.class);
+    
+    private Loader() {
+        // Complete
+    }
 
     /**
      * This method will search for <code>resource</code> in different

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/NSStack.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/NSStack.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/NSStack.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/NSStack.java Thu May 10 09:38:25 2012
@@ -71,8 +71,9 @@ public class NSStack {
             System.arraycopy(stack, 0, newstack, 0, stack.length);
             stack = newstack;
         }
-        if (traceEnabled)
+        if (traceEnabled) {
             log.trace("NSPush (" + stack.length + ")");
+        }
         stack[top] = null;
     }
 
@@ -90,14 +91,16 @@ public class NSStack {
             currentDefaultNS = top;
             while (currentDefaultNS > 0) {
                 if (stack[currentDefaultNS] != null &&
-                        stack[currentDefaultNS].getPrefix().length() == 0)
+                        stack[currentDefaultNS].getPrefix().length() == 0) {
                     break;
+                }
                 currentDefaultNS--;
             }
         }
         if (top == 0) {
-            if (traceEnabled)
+            if (traceEnabled) {
                 log.trace("NSPop (empty)");
+            }
             return;
         }
         if (traceEnabled) {
@@ -109,7 +112,9 @@ public class NSStack {
      * Return a copy of the current frame.  Returns null if none are present.
      */
     public List<Mapping> cloneFrame() {
-        if (stack[top] == null) return null;
+        if (stack[top] == null) {
+            return null;
+        }
         List<Mapping> clone = new ArrayList<Mapping>();
         for (Mapping map = topOfFrame(); map != null; map = next()) {
             clone.add(map);
@@ -196,33 +201,44 @@ public class NSStack {
      * find one because "pre" is actually mapped to "otherNamespace"
      */
     public String getPrefix(String namespaceURI, boolean noDefault) {
-        if ((namespaceURI == null) || (namespaceURI.equals("")))
+        if ((namespaceURI == null) || (namespaceURI.equals(""))) {
             return null;
+        }
         int hash = namespaceURI.hashCode();
 
         // If defaults are OK, and the given NS is the current default,
         // return "" as the prefix to favor defaults where possible.
         if (!noDefault && currentDefaultNS > 0 && stack[currentDefaultNS] != null &&
-                namespaceURI.equals(stack[currentDefaultNS].getNamespaceURI()))
+                namespaceURI.equals(stack[currentDefaultNS].getNamespaceURI())) {
             return "";
+        }
         for (int cursor = top; cursor > 0; cursor--) {
             Mapping map = stack[cursor];
-            if (map == null) continue;
+            if (map == null) {
+                continue;
+            }
             if (map.getNamespaceHash() == hash &&
                     map.getNamespaceURI().equals(namespaceURI)) {
                 String possiblePrefix = map.getPrefix();
-                if (noDefault && possiblePrefix.length() == 0) continue;
+                if (noDefault && possiblePrefix.length() == 0) {
+                    continue;
+                }
 
                 // now make sure that this is the first occurance of this 
                 // particular prefix
                 int ppHash = possiblePrefix.hashCode();
                 for (int cursor2 = top; true; cursor2--) {
-                    if (cursor2 == cursor) return possiblePrefix;
+                    if (cursor2 == cursor) {
+                        return possiblePrefix;
+                    }
                     map = stack[cursor2];
-                    if (map == null) continue;
+                    if (map == null) {
+                        continue;
+                    }
                     if (ppHash == map.getPrefixHash() &&
-                            possiblePrefix.equals(map.getPrefix()))
+                            possiblePrefix.equals(map.getPrefix())) {
                         break;
+                    }
                 }
             }
         }
@@ -241,14 +257,18 @@ public class NSStack {
      * Given a prefix, return the associated namespace (if any).
      */
     public String getNamespaceURI(String prefix) {
-        if (prefix == null)
+        if (prefix == null) {
             prefix = "";
+        }
         int hash = prefix.hashCode();
         for (int cursor = top; cursor > 0; cursor--) {
             Mapping map = stack[cursor];
-            if (map == null) continue;
-            if (map.getPrefixHash() == hash && map.getPrefix().equals(prefix))
+            if (map == null) {
+                continue;
+            }
+            if (map.getPrefixHash() == hash && map.getPrefix().equals(prefix)) {
                 return map.getNamespaceURI();
+            }
         }
         return null;
     }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/StringUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/StringUtil.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/StringUtil.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/StringUtil.java Thu May 10 09:38:25 2012
@@ -22,11 +22,11 @@ package org.apache.ws.security.util;
 import java.util.ArrayList;
 import java.util.List;
 
-public class StringUtil {
-    /**
-     * An empty immutable <code>String</code> array.
-     */
-    public static final String[] EMPTY_STRING_ARRAY = new String[0];
+public final class StringUtil {
+    
+    private StringUtil() {
+        // Complete
+    }
 
     /**
      * Tests if this string starts with the specified prefix (Ignoring whitespaces)
@@ -58,8 +58,9 @@ public class StringUtil {
             index1++;
             index2++;
         }
-        if (index1 < length1 && index2 >= length2)
+        if (index1 < length1 && index2 >= length2) {
             return false;
+        }
         return true;
     }
 
@@ -93,7 +94,7 @@ public class StringUtil {
         }
         int len = str.length();
         if (len == 0) {
-            return EMPTY_STRING_ARRAY;
+            return new String[0];
         }
         List<String> list = new ArrayList<String>();
         int i = 0, start = 0;

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/UUIDGenerator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/UUIDGenerator.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/UUIDGenerator.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/UUIDGenerator.java Thu May 10 09:38:25 2012
@@ -28,7 +28,7 @@ import java.util.Random;
 /**
  * UUID generator (taken from Axis2)
  */
-public class UUIDGenerator {
+public final class UUIDGenerator {
 
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(UUIDGenerator.class);
@@ -38,6 +38,10 @@ public class UUIDGenerator {
 
 
     private static Random myRand = null;
+    
+    private UUIDGenerator() {
+        // Complete
+    }
 
     /**
      * MD5 a random string with localhost/date etc will return 128 bits
@@ -50,7 +54,7 @@ public class UUIDGenerator {
             getInitialUUID();
         }
         long i = ++incrementingValue;
-        if(i >= Long.MAX_VALUE || i < 0){
+        if (i >= Long.MAX_VALUE || i < 0) {
             incrementingValue = 0;
             i = 0;
         }
@@ -92,7 +96,9 @@ public class UUIDGenerator {
             sb2.append(Integer.toHexString(b));
         }
         int begin = myRand.nextInt();
-        if (begin < 0) begin = begin * -1;
+        if (begin < 0) {
+            begin = begin * -1;
+        }
         begin = begin % 8;
         baseUUID = sb2.toString().substring(begin, begin + 18).toUpperCase();
     }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/WSSecurityUtil.java Thu May 10 09:38:25 2012
@@ -60,7 +60,7 @@ import java.util.Set;
  * 
  * @author Davanum Srinivas (dims@yahoo.com).
  */
-public class WSSecurityUtil {
+public final class WSSecurityUtil {
     private static org.apache.commons.logging.Log log = 
         org.apache.commons.logging.LogFactory.getLog(WSSecurityUtil.class);
 
@@ -77,6 +77,10 @@ public class WSSecurityUtil {
      */
     private static MessageDigest digest = null;
     
+    private WSSecurityUtil() {
+        // Complete
+    }
+    
     /**
      * Returns the first WS-Security header element for a given actor. Only one
      * WS-Security header is allowed for an actor.
@@ -542,7 +546,7 @@ public class WSSecurityUtil {
                 Attr a = (Attr) attrs.item(n);
                 String name = a.getName();
                 if (name.startsWith("xmlns:") && a.getNodeValue().equals(uri)) {
-                    return name.substring(6);
+                    return name.substring("xmlns:".length());
                 }
             }
             e = e.getParentNode();

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/XMLUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/XMLUtils.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/XMLUtils.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/util/XMLUtils.java Thu May 10 09:38:25 2012
@@ -35,11 +35,15 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 
-public class XMLUtils {
+public final class XMLUtils {
     
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(XMLUtils.class);
-    private static final boolean doDebug = LOG.isDebugEnabled();
+    private static final boolean DO_DEBUG = LOG.isDebugEnabled();
+    
+    private XMLUtils() {
+        // Complete
+    }
     
     public static String PrettyDocumentToString(Document doc) {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -55,7 +59,7 @@ public class XMLUtils {
             Transformer transformer = transFactory.newTransformer();
             transformer.transform(source, result);
         } catch (Exception ex) {
-            if (doDebug) {
+            if (DO_DEBUG) {
                 LOG.debug(ex.getMessage(), ex);
             }
         }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/JAASUsernameTokenValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/JAASUsernameTokenValidator.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/JAASUsernameTokenValidator.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/JAASUsernameTokenValidator.java Thu May 10 09:38:25 2012
@@ -94,8 +94,8 @@ public class JAASUsernameTokenValidator 
         }
         
         if (!(user != null && user.length() > 0 && password != null && password.length() > 0)) {
-        	log.warn("User or password empty");
-        	throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
+            log.warn("User or password empty");
+            throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
         }
         
         try {
@@ -106,7 +106,9 @@ public class JAASUsernameTokenValidator 
 
         } catch (LoginException ex) {
             log.info("Authentication failed", ex);
-            throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);
+            throw new WSSecurityException(
+                WSSecurityException.FAILED_AUTHENTICATION, null, null, ex
+            );
         }
         
         return credential;

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/KerberosTokenValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/KerberosTokenValidator.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/KerberosTokenValidator.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/KerberosTokenValidator.java Thu May 10 09:38:25 2012
@@ -175,7 +175,8 @@ public class KerberosTokenValidator impl
             throw new WSSecurityException(
                 WSSecurityException.FAILURE,
                 "kerberosLoginError", 
-                new Object[] {ex.getMessage()}
+                new Object[] {ex.getMessage()},
+                ex
             );
         }
         if (log.isDebugEnabled()) {

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/SamlAssertionValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/SamlAssertionValidator.java?rev=1336562&r1=1336561&r2=1336562&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/SamlAssertionValidator.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/validate/SamlAssertionValidator.java Thu May 10 09:38:25 2012
@@ -166,7 +166,9 @@ public class SamlAssertionValidator exte
                 specValidators.validate(assertion.getSaml1());
             } catch (ValidationException e) {
                 LOG.debug("Saml Validation error: " + e.getMessage(), e);
-                throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
+                throw new WSSecurityException(
+                    WSSecurityException.FAILURE, "invalidSAMLsecurity", null, e
+                );
             }
         } else if (assertion.getSaml2() != null) {
             ValidatorSuite schemaValidators = 
@@ -178,7 +180,9 @@ public class SamlAssertionValidator exte
                 specValidators.validate(assertion.getSaml2());
             } catch (ValidationException e) {
                 LOG.debug("Saml Validation error: " + e.getMessage(), e);
-                throw new WSSecurityException(WSSecurityException.FAILURE, "invalidSAMLsecurity");
+                throw new WSSecurityException(
+                    WSSecurityException.FAILURE, "invalidSAMLsecurity", null, e
+                );
             }
         }
     }



Mime
View raw message