ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1679570 [1/3] - in /webservices/wss4j/trunk: ws-security-common/src/main/java/org/apache/wss4j/common/bsp/ ws-security-common/src/main/java/org/apache/wss4j/common/crypto/ ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey...
Date Fri, 15 May 2015 14:13:50 GMT
Author: coheigea
Date: Fri May 15 14:13:49 2015
New Revision: 1679570

URL: http://svn.apache.org/r1679570
Log:
Reapplying exception refactoring patch

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CertificateStore.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoFactory.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/DERDecoder.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/MerlinDevice.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/X509SubjectPublicKeyInfo.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/AlgoFactory.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/P_SHA1.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/ext/WSSecurityException.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosClientExceptionAction.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosServiceExceptionAction.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLUtil.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/Reference.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/X509Security.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/KeyUtils.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/UsernameTokenUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/CustomTokenAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SAMLTokenSignedAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureDerivedAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/UsernameTokenSignedAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDKSign.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/DerivedKeyTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedAssertionProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/STRParserUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/KerberosTokenValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/SamlAssertionValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/TimestampValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomSamlAssertionValidator.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ConfigurationConverter.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/OutboundWSSec.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSConfigurationException.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSCrypto.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/InboundWSSecurityContextImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/BinarySecurityTokenInputHandler.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DecryptInputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/DerivedKeyTokenInputHandler.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/TimestampInputHandler.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureReferenceVerifyInputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SecurityHeaderReorderProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureEndingOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/EncryptedKeySha1SecurityTokenImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/ExternalSecurityTokenImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosClientSecurityToken.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/KerberosServiceSecurityTokenImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SamlSecurityTokenImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509PKIPathv1SecurityTokenImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/X509V3SecurityTokenImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SecurityContextTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/bsp/BSPEnforcer.java Fri May 15 14:13:49 2015
@@ -54,7 +54,7 @@ public class BSPEnforcer {
         
         if (!ignoredBSPRules.contains(bspRule)) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "empty",
-                "BSP:" + bspRule.name() + ": " + bspRule.getMsg()
+                                          new Object[] {"BSP:" + bspRule.name() + ": " + bspRule.getMsg()}
             );
         } else {
             LOG.debug("BSP:" + bspRule.name() + ": " + bspRule.getMsg());

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CertificateStore.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CertificateStore.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CertificateStore.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CertificateStore.java Fri May 15 14:13:49 2015
@@ -199,7 +199,8 @@ public class CertificateStore extends Cr
                 );
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "certpath", "No trusted certs found"
+                WSSecurityException.ErrorCode.FAILURE, "certpath", 
+                new Object[] {"No trusted certs found"}
             );
         }
         
@@ -252,8 +253,8 @@ public class CertificateStore extends Cr
             | java.security.InvalidAlgorithmParameterException
             | java.security.cert.CertPathValidatorException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath", e,
-                    e.getMessage()
+                    WSSecurityException.ErrorCode.FAILURE, e, "certpath",
+                    new Object[] {e.getMessage()}
                 );
         }
         
@@ -347,7 +348,7 @@ public class CertificateStore extends Cr
             sha = MessageDigest.getInstance("SHA1");
         } catch (NoSuchAlgorithmException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+                WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
             );
         }
         for (X509Certificate trustedCert : trustedCerts) {
@@ -355,7 +356,7 @@ public class CertificateStore extends Cr
                 sha.update(trustedCert.getEncoded());
             } catch (CertificateEncodingException ex) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", ex
+                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, ex, "encodeError"
                 );
             }
             byte[] data = sha.digest();

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoBase.java Fri May 15 14:13:49 2015
@@ -152,11 +152,11 @@ public abstract class CryptoBase impleme
             }
         } catch (CertificateException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "unsupportedCertType", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "unsupportedCertType"
             );
         } catch (NoSuchProviderException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noSecProvider", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "noSecProvider"
             );
         }
         
@@ -176,7 +176,7 @@ public abstract class CryptoBase impleme
             return (X509Certificate) certFactory.generateCertificate(in);
         } catch (CertificateException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "parseError"
             );
         }
     }
@@ -209,8 +209,8 @@ public abstract class CryptoBase impleme
                 return digest.digest(value);
             } catch (Exception ex) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN, "noSKIHandling", ex,
-                    "No SKI certificate extension and no SHA1 message digest available"
+                    WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN, ex, "noSKIHandling",
+                    new Object[] {"No SKI certificate extension and no SHA1 message digest available"}
                 );
             }
         }
@@ -242,11 +242,11 @@ public abstract class CryptoBase impleme
             return path.getEncoded();
         } catch (CertificateEncodingException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "encodeError"
             );
         } catch (CertificateException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "parseError"
             );
         }
     }
@@ -266,7 +266,7 @@ public abstract class CryptoBase impleme
             path = getCertificateFactory().generateCertPath(in);
         } catch (CertificateException | IOException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "parseError"
             );
         }
         

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoFactory.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoFactory.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/CryptoFactory.java Fri May 15 14:13:49 2015
@@ -79,7 +79,7 @@ public abstract class CryptoFactory {
                 LOG.debug("Cannot load Crypto instance as properties object is null");
             }
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "empty", null, "Cannot load Crypto instance as properties object is null");
+                    "empty", new Object[] {"Cannot load Crypto instance as properties object is null"});
         }
         return getInstance(properties, Loader.getClassLoader(CryptoFactory.class), null);
     }
@@ -111,7 +111,7 @@ public abstract class CryptoFactory {
                 LOG.debug("Cannot load Crypto instance as properties object is null");
             }
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "empty", null, "Cannot load Crypto instance as properties object is null");
+                    "empty", new Object[] {"Cannot load Crypto instance as properties object is null"});
         }
 
         String cryptoClassName = properties.getProperty("org.apache.wss4j.crypto.provider");
@@ -129,9 +129,8 @@ public abstract class CryptoFactory {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Unable to instantiate Merlin", e);
                 }
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                                              "empty", e, "Cannot create Crypto class "
-                                              + cryptoClassName);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty", 
+                                              new Object[] {"Cannot create Crypto class " + cryptoClassName});
             }
         } else {
             try {
@@ -141,8 +140,8 @@ public abstract class CryptoFactory {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug(ex.getMessage(), ex);
                 }
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                        "empty", ex, cryptoClassName + " Not Found");
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex,
+                        "empty", new Object[] {cryptoClassName + " Not Found"});
             }
         }
         return loadClass(cryptoClass, properties, classLoader);
@@ -231,8 +230,8 @@ public abstract class CryptoFactory {
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Unable to instantiate: " + cryptoClass.getName(), e);
             }
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "empty", e, cryptoClass + " cannot create instance");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+                    "empty", new Object[] {cryptoClass + " cannot create instance"});
         }
     }
     
@@ -267,8 +266,8 @@ public abstract class CryptoFactory {
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Unable to instantiate: " + cryptoClass.getName(), e);
             }
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "empty", e, cryptoClass + " cannot create instance");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+                    "empty", new Object[] {cryptoClass + " cannot create instance"});
         }
     }
     
@@ -290,7 +289,7 @@ public abstract class CryptoFactory {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE, 
                     "resourceNotFound",
-                    propFilename
+                    new Object[] {propFilename}
                 );
             }
             properties.load(url.openStream());
@@ -299,8 +298,8 @@ public abstract class CryptoFactory {
                 LOG.debug("Cannot find resource: " + propFilename, e);
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, 
-                "resourceNotFound", e, propFilename
+                WSSecurityException.ErrorCode.FAILURE, e,
+                "resourceNotFound", new Object[] {propFilename}
             );
         }
         return properties;

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/DERDecoder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/DERDecoder.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/DERDecoder.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/DERDecoder.java Fri May 15 14:13:49 2015
@@ -60,7 +60,7 @@ public class DERDecoder {
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Invalid DER string"
+                    new Object[] {"Invalid DER string"}
             );
         }
         arr = derEncoded;
@@ -86,7 +86,7 @@ public class DERDecoder {
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Unsupported DER format"
+                    new Object[] {"Unsupported DER format"}
             );
         }
         pos += length;
@@ -118,7 +118,7 @@ public class DERDecoder {
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Invalid DER format"
+                    new Object[] {"Invalid DER format"}
             );
         }
         pos++;
@@ -137,7 +137,7 @@ public class DERDecoder {
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Invalid DER format"
+                    new Object[] {"Invalid DER format"}
             );
         }
         return arr[pos] == val;
@@ -165,7 +165,7 @@ public class DERDecoder {
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Invalid DER format"
+                    new Object[] {"Invalid DER format"}
             );
         }
         int len;
@@ -180,7 +180,7 @@ public class DERDecoder {
                 throw new WSSecurityException(
                         WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                         "noSKIHandling",
-                        "Invalid DER format"
+                        new Object[] {"Invalid DER format"}
                 );
             }
             byte[] lenBytes = new byte[nbytes];
@@ -206,13 +206,13 @@ public class DERDecoder {
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Invalid DER format"
+                    new Object[] {"Invalid DER format"}
              );
         } else if (length < 0) {
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Unsupported DER format"
+                    new Object[] {"Unsupported DER format"}
             );
         }
         byte[] value = new byte[length];

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java Fri May 15 14:13:49 2015
@@ -312,7 +312,7 @@ public class Merlin extends CryptoBase {
                 if (DO_DEBUG) {
                     LOG.debug(e.getMessage(), e);
                 }
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "failedCredentialLoad", e);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "failedCredentialLoad");
             }
         }
     }
@@ -341,7 +341,7 @@ public class Merlin extends CryptoBase {
                         LOG.debug(e.getMessage(), e);
                     }
                     throw new WSSecurityException(
-                            WSSecurityException.ErrorCode.FAILURE, "proxyNotFound", e, location
+                            WSSecurityException.ErrorCode.FAILURE, e, "proxyNotFound", new Object[] {location}
                     );
                 }
             }
@@ -374,7 +374,7 @@ public class Merlin extends CryptoBase {
             if (DO_DEBUG) {
                 LOG.debug(e.getMessage(), e);
             }
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "failedCredentialLoad", e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "failedCredentialLoad");
         }
         return ks;
     }
@@ -481,11 +481,11 @@ public class Merlin extends CryptoBase {
             }
         } catch (CertificateException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "unsupportedCertType", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "unsupportedCertType"
             );
         } catch (NoSuchProviderException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noSecProvider", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "noSecProvider"
             );
         }
 
@@ -526,7 +526,7 @@ public class Merlin extends CryptoBase {
                 }
             } catch (KeyStoreException ex) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "keystore", ex
+                    WSSecurityException.ErrorCode.FAILURE, ex, "keystore"
                 );
             } 
         }
@@ -615,10 +615,12 @@ public class Merlin extends CryptoBase {
         CallbackHandler callbackHandler
     ) throws WSSecurityException {
         if (keystore == null) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "The keystore is null");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                          new Object[] {"The keystore is null"});
         }
         if (callbackHandler == null) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "The CallbackHandler is null");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                          new Object[] {"The CallbackHandler is null"});
         }
         
         String identifier = getIdentifier(certificate, keystore);
@@ -627,7 +629,8 @@ public class Merlin extends CryptoBase {
                 String msg = "Cannot find key for alias: [" + identifier + "]";
                 String logMsg = createKeyStoreErrorMessage(keystore);
                 LOG.error(msg + logMsg);
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", msg);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                              new Object[] {msg});
             }
             String password = getPassword(identifier, callbackHandler);
             if (password == null && privatePasswordSet) {
@@ -646,12 +649,13 @@ public class Merlin extends CryptoBase {
                 String msg = "Key is not a private key, alias: [" + identifier + "]";
                 String logMsg = createKeyStoreErrorMessage(keystore);
                 LOG.error(msg + logMsg);
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", msg);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                              new Object[]{msg});
             }
             return (PrivateKey) keyTmp;
         } catch (KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
+                WSSecurityException.ErrorCode.FAILURE, ex, "noPrivateKey", new Object[] {ex.getMessage()}
             );
         }
     }
@@ -668,14 +672,16 @@ public class Merlin extends CryptoBase {
         String password
     ) throws WSSecurityException {
         if (keystore == null) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "The keystore is null");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
+                                          new Object[] {"The keystore is null"});
         }
         try {
             if (identifier == null || !keystore.isKeyEntry(identifier)) {
                 String msg = "Cannot find key for alias: [" + identifier + "]";
                 String logMsg = createKeyStoreErrorMessage(keystore);
                 LOG.error(msg + logMsg);
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", msg);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                              new Object[] {msg});
             }
             if (password == null && privatePasswordSet) {
                 password = properties.getProperty(PREFIX + KEYSTORE_PRIVATE_PASSWORD);
@@ -692,12 +698,13 @@ public class Merlin extends CryptoBase {
                 String msg = "Key is not a private key, alias: [" + identifier + "]";
                 String logMsg = createKeyStoreErrorMessage(keystore);
                 LOG.error(msg + logMsg);
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", msg);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                              new Object[] {msg});
             }
             return (PrivateKey) keyTmp;
         } catch (KeyStoreException | UnrecoverableKeyException | NoSuchAlgorithmException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
+                WSSecurityException.ErrorCode.FAILURE, ex, "noPrivateKey", new Object[] {ex.getMessage()}
             );
         }
     }
@@ -736,7 +743,7 @@ public class Merlin extends CryptoBase {
                     certs[0].checkValidity();
                 } catch (CertificateExpiredException | CertificateNotYetValidException e) {
                     throw new WSSecurityException(
-                        WSSecurityException.ErrorCode.FAILED_CHECK, "invalidCert", e
+                        WSSecurityException.ErrorCode.FAILED_CHECK, e, "invalidCert"
                     );
                 }
                 if (LOG.isDebugEnabled()) {
@@ -770,7 +777,7 @@ public class Merlin extends CryptoBase {
                     );
                 }
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath", "No trusted certs found"
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", new Object[] {"No trusted certs found"}
                 );
             }
             
@@ -848,7 +855,7 @@ public class Merlin extends CryptoBase {
             | java.security.cert.CertPathValidatorException 
             | KeyStoreException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath", e
+                    WSSecurityException.ErrorCode.FAILURE, e, "certpath"
                 );
         }
         
@@ -980,7 +987,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", e
+                WSSecurityException.ErrorCode.FAILURE, e, "keystore"
             );
         }
         return new Certificate[]{};
@@ -1000,7 +1007,7 @@ public class Merlin extends CryptoBase {
             sha = MessageDigest.getInstance("SHA1");
         } catch (NoSuchAlgorithmException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+                WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
             );
         }
         Certificate[] certs = null;
@@ -1054,8 +1061,7 @@ public class Merlin extends CryptoBase {
                         sha.update(x509cert.getEncoded());
                     } catch (CertificateEncodingException ex) {
                         throw new WSSecurityException(
-                            WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError",
-                            ex
+                            WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, ex, "encodeError"
                         );
                     }
                     byte[] data = sha.digest();
@@ -1067,7 +1073,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", e
+                WSSecurityException.ErrorCode.FAILURE, e, "keystore"
             );
         }
         return new Certificate[]{};
@@ -1134,7 +1140,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", e
+                WSSecurityException.ErrorCode.FAILURE, e, "keystore"
             );
         }
         return new Certificate[]{};
@@ -1222,7 +1228,7 @@ public class Merlin extends CryptoBase {
                 return null;
             }
         } catch (KeyStoreException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "keystore", e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "keystore");
         }
 
         X509Certificate[] x509certs = new X509Certificate[certs.length];
@@ -1293,7 +1299,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", e
+                WSSecurityException.ErrorCode.FAILURE, e, "keystore"
             );
         }
         return new Certificate[]{};
@@ -1344,7 +1350,7 @@ public class Merlin extends CryptoBase {
                 }
             }
         } catch (KeyStoreException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "keystore", e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "keystore");
         }
         return null;
     }
@@ -1365,15 +1371,9 @@ public class Merlin extends CryptoBase {
         try {
             Callback[] callbacks = new Callback[]{pwCb};
             cb.handle(callbacks);
-        } catch (IOException e) {
+        } catch (IOException | UnsupportedCallbackException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE,
-                "noPassword", e, identifier
-            );
-        } catch (UnsupportedCallbackException e) {
-            throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE,
-                "noPassword", e, identifier
+                WSSecurityException.ErrorCode.FAILURE, e, "noPassword", new Object[] {identifier}
             );
         }
 

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/MerlinDevice.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/MerlinDevice.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/MerlinDevice.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/MerlinDevice.java Fri May 15 14:13:49 2015
@@ -206,7 +206,7 @@ public class MerlinDevice extends Merlin
                 if (DO_DEBUG) {
                     LOG.debug(e.getMessage(), e);
                 }
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "failedCredentialLoad", e);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "failedCredentialLoad");
             }
         }
     }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/X509SubjectPublicKeyInfo.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/X509SubjectPublicKeyInfo.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/X509SubjectPublicKeyInfo.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/X509SubjectPublicKeyInfo.java Fri May 15 14:13:49 2015
@@ -52,7 +52,7 @@ public class X509SubjectPublicKeyInfo ex
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                 "noSKIHandling",
-                "Support for X.509-encoded public keys only"
+                new Object[] {"Support for X.509-encoded public keys only"}
             );
         }
     }
@@ -86,7 +86,7 @@ public class X509SubjectPublicKeyInfo ex
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Unsupported X.509 public key format"
+                    new Object[] {"Unsupported X.509 public key format"}
             );
         }
         skip(algIDlen);           // AlgorithmIdentifier contents
@@ -97,7 +97,7 @@ public class X509SubjectPublicKeyInfo ex
             throw new WSSecurityException(
                     WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
                     "noSKIHandling",
-                    "Invalid X.509 public key format"
+                    new Object[] {"Invalid X.509 public key format"}
             );
         }
         skip(1);   // number unused bits

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/AlgoFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/AlgoFactory.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/AlgoFactory.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/AlgoFactory.java Fri May 15 14:13:49 2015
@@ -41,7 +41,7 @@ public final class AlgoFactory {
             return new P_SHA1();
         } else {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
-                                          "unknownAlgorithm", algorithm);
+                                          "unknownAlgorithm", new Object[] {algorithm});
         }
     }
 

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/P_SHA1.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/P_SHA1.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/P_SHA1.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/derivedKey/P_SHA1.java Fri May 15 14:13:49 2015
@@ -64,7 +64,7 @@ public class P_SHA1 implements Derivatio
 
             return key;
         } catch (NoSuchAlgorithmException | InvalidKeyException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "errorInKeyDerivation", e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "errorInKeyDerivation");
         }
     }
 

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/ext/WSSecurityException.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/ext/WSSecurityException.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/ext/WSSecurityException.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/ext/WSSecurityException.java Fri May 15 14:13:49 2015
@@ -127,31 +127,13 @@ public class WSSecurityException extends
     }
 
     private ErrorCode errorCode;
-
-    /**
-     * Constructor.
-     * <p/>
-     *
-     * @param errorCode
-     * @param msgId
-     * @param exception
-     * @param arguments
-     */
-    public WSSecurityException(ErrorCode errorCode, String msgId, Exception exception, Object... arguments) {
-        super(msgId, arguments, exception);
-        this.errorCode = errorCode;
+    
+    public WSSecurityException(ErrorCode errorCode) {
+        this(errorCode, errorCode.name());
     }
-
-    /**
-     * Constructor.
-     * <p/>
-     *
-     * @param errorCode
-     * @param msgId
-     * @param exception
-     */
-    public WSSecurityException(ErrorCode errorCode, String msgId, Exception exception) {
-        super(msgId, exception);
+    
+    public WSSecurityException(ErrorCode errorCode, String msgId) {
+        super(msgId, new Object[]{});
         this.errorCode = errorCode;
     }
 
@@ -160,28 +142,19 @@ public class WSSecurityException extends
         this.errorCode = errorCode;
     }
 
-    /**
-     * Constructor.
-     * <p/>
-     *
-     * @param errorCode
-     * @param msgId
-     * @param arguments
-     */
-    public WSSecurityException(ErrorCode errorCode, String msgId, Object... arguments) {
-        super(msgId, arguments);
+    public WSSecurityException(ErrorCode errorCode, Exception exception, String msgId) {
+        super(msgId, exception);
         this.errorCode = errorCode;
     }
-
-
-    /**
-     * Constructor.
-     * <p/>
-     *
-     * @param errorCode
-     */
-    public WSSecurityException(ErrorCode errorCode) {
-        this(errorCode, errorCode.name());
+    
+    public WSSecurityException(ErrorCode errorCode, Exception exception, String msgId, Object[] arguments) {
+        super(msgId, arguments, exception);
+        this.errorCode = errorCode;
+    }
+    
+    public WSSecurityException(ErrorCode errorCode, String msgId, Object[] arguments) {
+        super(msgId, arguments);
+        this.errorCode = errorCode;
     }
 
     /**

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosClientExceptionAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosClientExceptionAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosClientExceptionAction.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosClientExceptionAction.java Fri May 15 14:13:49 2015
@@ -132,14 +132,10 @@ public class KerberosClientExceptionActi
 
                 krbCtx.setSecretKey(key);
             }
-            catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException e) {
+            catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
+                | InvocationTargetException e) {
                 throw new WSSecurityException(
-                    ErrorCode.FAILURE, "kerberosServiceTicketError", e
-                );
-            }
-            catch (InvocationTargetException e) {
-                throw new WSSecurityException(
-                    ErrorCode.FAILURE, "kerberosServiceTicketError", e.getCause()
+                    ErrorCode.FAILURE, e, "kerberosServiceTicketError"
                 );
             }
         }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosServiceExceptionAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosServiceExceptionAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosServiceExceptionAction.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/kerberos/KerberosServiceExceptionAction.java Fri May 15 14:13:49 2015
@@ -124,14 +124,10 @@ public class KerberosServiceExceptionAct
 
                     krbServiceCtx.setSessionKey(key);
                 }
-                catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException e) {
+                catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException
+                    | InvocationTargetException e) {
                     throw new WSSecurityException(
-                        ErrorCode.FAILURE, KERBEROS_TICKET_VALIDATION_ERROR_MSG_ID, e
-                    );
-                }
-                catch (InvocationTargetException e) {
-                    throw new WSSecurityException(
-                        ErrorCode.FAILURE, KERBEROS_TICKET_VALIDATION_ERROR_MSG_ID, e.getCause()
+                        ErrorCode.FAILURE, e, KERBEROS_TICKET_VALIDATION_ERROR_MSG_ID
                     );
                 }
             }            

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java Fri May 15 14:13:49 2015
@@ -110,17 +110,20 @@ public final class OpenSAMLUtil {
     public static XMLObject fromDom(Element root) throws WSSecurityException {
         if (root == null) {
             LOG.debug("Attempting to unmarshal a null element!");
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "Error unmarshalling a SAML assertion");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                          new Object[] {"Error unmarshalling a SAML assertion"});
         }
         Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(root);
         if (unmarshaller == null) {
             LOG.debug("Unable to find an unmarshaller for element: " + root.getLocalName());
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "Error unmarshalling a SAML assertion");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                                          new Object[] {"Error unmarshalling a SAML assertion"});
         }
         try {
             return unmarshaller.unmarshall(root);
         } catch (UnmarshallingException ex) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", ex, "Error unmarshalling a SAML assertion");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, "empty", 
+                                          new Object[] {"Error unmarshalling a SAML assertion"});
         }
     }
 
@@ -169,7 +172,8 @@ public final class OpenSAMLUtil {
                     element = marshaller.marshall(xmlObject, doc);
                 } 
             } catch (MarshallingException ex) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", ex, "Error marshalling a SAML assertion");
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, "empty", 
+                                              new Object[] {"Error marshalling a SAML assertion"});
             }
     
             if (signObject) {
@@ -242,7 +246,8 @@ public final class OpenSAMLUtil {
                 Thread.currentThread().setContextClassLoader(SignerProvider.class.getClassLoader());
                 Signer.signObject(signature);
             } catch (SignatureException ex) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", ex, "Error signing a SAML assertion");
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, "empty", 
+                                              new Object[] {"Error signing a SAML assertion"});
             } finally {
                 Thread.currentThread().setContextClassLoader(loader);
             }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLUtil.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLUtil.java Fri May 15 14:13:49 2015
@@ -274,7 +274,7 @@ public final class SAMLUtil {
                             if (certs == null || certs.length < 1) {
                                 throw new WSSecurityException(
                                     WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
-                                    "cannot get certificate or key"
+                                    new Object[] {"cannot get certificate or key"}
                                 );
                             }
                             return new SAMLKeyInfo(certs);
@@ -284,8 +284,8 @@ public final class SAMLUtil {
             }
         } catch (Exception ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity", ex,
-                "cannot get certificate or key"
+                WSSecurityException.ErrorCode.FAILURE, ex, "invalidSAMLsecurity",
+                new Object[] {"cannot get certificate or key"}
             );
         }
         return null;

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java Fri May 15 14:13:49 2015
@@ -528,8 +528,8 @@ public class SamlAssertionWrapper {
         X509Certificate[] issuerCerts = issuerCrypto.getX509Certificates(cryptoType);
         if (issuerCerts == null || issuerCerts.length == 0) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
-                    "No issuer certs were found to sign the SAML Assertion using issuer name: "
-                            + issuerKeyName);
+                new Object[] {"No issuer certs were found to sign the SAML Assertion using issuer name: "
+                                              + issuerKeyName});
         }
 
         String sigAlgo = signatureAlgorithm;
@@ -552,7 +552,7 @@ public class SamlAssertionWrapper {
         }
         if (privateKey == null) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
-                    "No private key was found using issuer name: " + issuerKeyName);
+                new Object[] {"No private key was found using issuer name: " + issuerKeyName});
         }
 
         signature.setSignatureAlgorithm(sigAlgo);
@@ -572,8 +572,8 @@ public class SamlAssertionWrapper {
             KeyInfo keyInfo = kiFactory.newInstance().generate(signingCredential);
             signature.setKeyInfo(keyInfo);
         } catch (org.opensaml.security.SecurityException ex) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", ex,
-                    "Error generating KeyInfo from signing credential");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, "empty",
+                new Object[] {"Error generating KeyInfo from signing credential"});
         }
 
         // add the signature to the assertion
@@ -594,7 +594,7 @@ public class SamlAssertionWrapper {
             if (keyInfo == null) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
-                    "cannot get certificate or key"
+                    new Object[] {"cannot get certificate or key"}
                 );
             }
             SAMLKeyInfo samlKeyInfo = 
@@ -617,7 +617,7 @@ public class SamlAssertionWrapper {
             if (samlKeyInfo == null) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
-                    "cannot get certificate or key"
+                    new Object[] {"cannot get certificate or key"}
                 );
             }
 
@@ -629,7 +629,7 @@ public class SamlAssertionWrapper {
             } else {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
-                    "cannot get certificate or key"
+                    new Object[] {"cannot get certificate or key"}
                 );
             }
             ClassLoader loader = Thread.currentThread().getContextClassLoader();
@@ -637,8 +637,8 @@ public class SamlAssertionWrapper {
                 Thread.currentThread().setContextClassLoader(SignerProvider.class.getClassLoader());
                 SignatureValidator.validate(sig, credential);
             } catch (SignatureException ex) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                        "empty", ex, "SAML signature validation failed");
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, 
+                        "empty", new Object[] {"SAML signature validation failed"});
             } finally {
                 Thread.currentThread().setContextClassLoader(loader);
             }
@@ -660,8 +660,8 @@ public class SamlAssertionWrapper {
             try {
                 validator.validate(sig);
             } catch (SignatureException ex) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
-                    "empty", ex, "SAML signature validation failed");
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex,
+                    "empty", new Object[] { "SAML signature validation failed"});
             }
         }
     }
@@ -773,7 +773,7 @@ public class SamlAssertionWrapper {
                         return Base64.decode(signatureValueElement);
                     } catch (Base64DecodingException ex) {
                         throw new WSSecurityException(
-                            WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity", ex
+                            WSSecurityException.ErrorCode.FAILURE, ex, "invalidSAMLsecurity"
                         );
                     }
                 }
@@ -1063,8 +1063,8 @@ public class SamlAssertionWrapper {
                     saml1.setAdvice(advice);
                 }
             } catch (org.opensaml.security.SecurityException ex) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", ex,
-                        "Error generating KeyInfo from signing credential"
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, "empty",
+                    new Object[] {"Error generating KeyInfo from signing credential"}
                 );
             }
 
@@ -1105,8 +1105,8 @@ public class SamlAssertionWrapper {
                     SAML2ComponentBuilder.createSaml2Subject(samlCallback.getSubject());
                 saml2.setSubject(subject);
             } catch (org.opensaml.security.SecurityException ex) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", ex,
-                        "Error generating KeyInfo from signing credential"
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex, "empty",
+                    new Object[] {"Error generating KeyInfo from signing credential"}
                 );
             }
             

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java Fri May 15 14:13:49 2015
@@ -125,10 +125,8 @@ public class SpnegoTokenContext {
                 LOG.debug(ex.getMessage(), ex);
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE,
-                "kerberosLoginError", 
-                ex,
-                ex.getMessage());
+                WSSecurityException.ErrorCode.FAILURE, ex, "kerberosLoginError", 
+                new Object[] {ex.getMessage()});
         }
         if (LOG.isDebugEnabled()) {
             LOG.debug("Successfully authenticated to the TGT");
@@ -140,7 +138,7 @@ public class SpnegoTokenContext {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE, 
                 "kerberosLoginError",
-                "No Client principals found after login");
+                new Object[] {"No Client principals found after login"});
         }
         
         // Get the service ticket
@@ -182,7 +180,7 @@ public class SpnegoTokenContext {
                     throw (WSSecurityException) cause;
                 } else {
                     throw new WSSecurityException(
-                         ErrorCode.FAILURE, "kerberosServiceTicketError", cause
+                         ErrorCode.FAILURE, new Exception(cause), "kerberosServiceTicketError"
                     );
                 }
             }
@@ -239,10 +237,8 @@ public class SpnegoTokenContext {
                 LOG.debug(ex.getMessage(), ex);
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE,
-                "kerberosLoginError", 
-                ex,
-                ex.getMessage());
+                WSSecurityException.ErrorCode.FAILURE, ex, "kerberosLoginError", 
+                new Object[] {ex.getMessage()});
         }
         if (LOG.isDebugEnabled()) {
             LOG.debug("Successfully authenticated to the TGT");
@@ -257,7 +253,7 @@ public class SpnegoTokenContext {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE, 
                     "kerberosLoginError",
-                    "No Client principals found after login");
+                    new Object[] {"No Client principals found after login"});
             }
             service = principals.iterator().next().getName();
         }
@@ -293,7 +289,7 @@ public class SpnegoTokenContext {
                     throw (WSSecurityException) cause;
                 } else {
                     throw new WSSecurityException(
-                         ErrorCode.FAILURE, "kerberosServiceTicketError", cause
+                         ErrorCode.FAILURE, new Exception(cause), "kerberosServiceTicketError"
                     );
                 }
             }
@@ -340,7 +336,7 @@ public class SpnegoTokenContext {
                 LOG.debug("Error in cleaning up a GSS context", e);
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "spnegoKeyError", e
+                WSSecurityException.ErrorCode.FAILURE, e, "spnegoKeyError"
             );
         }
     }
@@ -357,7 +353,7 @@ public class SpnegoTokenContext {
                 LOG.debug("Error in cleaning up a GSS context", e);
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "spnegoKeyError", e
+                WSSecurityException.ErrorCode.FAILURE, e, "spnegoKeyError"
             );
         }
     }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java Fri May 15 14:13:49 2015
@@ -61,7 +61,7 @@ public class BinarySecurity {
         if (!(el.equals(TOKEN_BST) || el.equals(TOKEN_KI))) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, 
-                "unhandledToken", el);
+                "unhandledToken", new Object[] {el});
         }
         String encoding = getEncodingType();
         if (encoding == null || "".equals(encoding)) {

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/Reference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/Reference.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/Reference.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/Reference.java Fri May 15 14:13:49 2015
@@ -49,7 +49,7 @@ public class Reference {
         QName el = new QName(element.getNamespaceURI(), element.getLocalName());
         if (!el.equals(TOKEN)) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "badElement", TOKEN, el
+                WSSecurityException.ErrorCode.FAILURE, "badElement", new Object[] {TOKEN, el}
             );
         }
 

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java Fri May 15 14:13:49 2015
@@ -30,7 +30,6 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
-
 import org.apache.wss4j.common.WSS4JConstants;
 import org.apache.wss4j.common.bsp.BSPEnforcer;
 import org.apache.wss4j.common.bsp.BSPRule;
@@ -78,7 +77,8 @@ public class SecurityTokenReference {
         element = elem;
         QName el = new QName(element.getNamespaceURI(), element.getLocalName());
         if (!STR_QNAME.equals(el)) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "badElement", STR_QNAME, el);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "badElement", 
+                                          new Object[] {STR_QNAME, el});
         }
         
         checkBSPCompliance(bspEnforcer);
@@ -189,7 +189,7 @@ public class SecurityTokenReference {
             data = cert.getEncoded();
         } catch (CertificateEncodingException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "encodeError"
             );
         }
         Text text = doc.createTextNode(Base64.encode(data));
@@ -214,7 +214,7 @@ public class SecurityTokenReference {
         if (cert.getVersion() != 3) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
-                "invalidCertForSKI", cert.getVersion());
+                "invalidCertForSKI", new Object[] {cert.getVersion()});
         }
         
         Document doc = element.getOwnerDocument();
@@ -246,7 +246,7 @@ public class SecurityTokenReference {
             encodedCert = cert.getEncoded();
         } catch (CertificateEncodingException e1) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", e1
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e1, "encodeError"
             );
         }
         try {
@@ -255,7 +255,7 @@ public class SecurityTokenReference {
             createKeyIdentifier(doc, THUMB_URI, text, true);
         } catch (WSSecurityException e1) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e1
+                WSSecurityException.ErrorCode.FAILURE, e1, "decoding.general"
             );
         }
     }
@@ -340,7 +340,7 @@ public class SecurityTokenReference {
                     thumb = Base64.decode(text);
                 } catch (Base64DecodingException e) {
                     throw new WSSecurityException(
-                        WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+                        WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
                     );
                 }
                 CryptoType cryptoType = new CryptoType(CryptoType.TYPE.THUMBPRINT_SHA1);

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/X509Security.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/X509Security.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/X509Security.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/X509Security.java Fri May 15 14:13:49 2015
@@ -90,14 +90,14 @@ public class X509Security extends Binary
         byte[] data = getToken();
         if (data == null) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "invalidCertData", 0);
+                WSSecurityException.ErrorCode.FAILURE, "invalidCertData", new Object[] {"0"});
         }
         try (InputStream in = new ByteArrayInputStream(data)) {
             cachedCert = certCrypto.loadCertificate(in);
             return cachedCert;
         } catch (IOException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "parseError"
             );
         }
 
@@ -121,7 +121,7 @@ public class X509Security extends Binary
             setToken(cert.getEncoded());
         } catch (CertificateEncodingException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "encodeError"
             );
         }
     }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/KeyUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/KeyUtils.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/KeyUtils.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/KeyUtils.java Fri May 15 14:13:49 2015
@@ -135,8 +135,8 @@ public final class KeyUtils {
             return Cipher.getInstance(keyAlgorithm, provider);
         } catch (NoSuchPaddingException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "unsupportedKeyTransp", 
-                ex, "No such padding: " + cipherAlgo);
+                WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, ex, "unsupportedKeyTransp", 
+                new Object[] {"No such padding: " + cipherAlgo});
         } catch (NoSuchAlgorithmException ex) {
             // Check to see if an RSA OAEP MGF-1 with SHA-1 algorithm was requested
             // Some JDKs don't support RSA/ECB/OAEPPadding
@@ -145,18 +145,18 @@ public final class KeyUtils {
                     return Cipher.getInstance("RSA/ECB/OAEPWithSHA1AndMGF1Padding");
                 } catch (Exception e) {
                     throw new WSSecurityException(
-                        WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "unsupportedKeyTransp",
-                        e, "No such algorithm: " + cipherAlgo);
+                        WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, e, "unsupportedKeyTransp",
+                        new Object[] {"No such algorithm: " + cipherAlgo});
                 }
             } else {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "unsupportedKeyTransp",
-                    ex, "No such algorithm: " + cipherAlgo);
+                    WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, ex, "unsupportedKeyTransp",
+                    new Object[] {"No such algorithm: " + cipherAlgo});
             }
         } catch (NoSuchProviderException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "unsupportedKeyTransp",
-                ex, "No such provider " + JCEMapper.getProviderId() + " for: " + cipherAlgo);
+                WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, ex, "unsupportedKeyTransp",
+                new Object[] {"No such provider " + JCEMapper.getProviderId() + " for: " + cipherAlgo});
         }
     }
     
@@ -174,8 +174,8 @@ public final class KeyUtils {
             }
             return digest.digest(inputBytes);
         } catch (Exception e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", e,
-                    "Error in generating digest"
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty",
+                                          new Object[] {"Error in generating digest"}
             );
         }
     }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/UsernameTokenUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/UsernameTokenUtil.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/UsernameTokenUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/UsernameTokenUtil.java Fri May 15 14:13:49 2015
@@ -67,7 +67,7 @@ public final class UsernameTokenUtil {
                 LOG.debug(e.getMessage(), e);
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+                WSSecurityException.ErrorCode.FAILURE, e, "decoding.general"
             );
         }
         //
@@ -105,8 +105,8 @@ public final class UsernameTokenUtil {
             if (LOG.isDebugEnabled()) {
                 LOG.debug(e.getMessage(), e);
             }
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "empty", e, "Unable to convert password to UTF-8");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+                    "empty", new Object[] {"Unable to convert password to UTF-8"});
         }
     }
     
@@ -144,9 +144,8 @@ public final class UsernameTokenUtil {
         try {
             return XMLSecurityConstants.generateBytes(length);
         } catch (Exception ex) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "empty", ex,
-                    "Error in generating nonce of length " + length
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex,
+                    "empty", new Object[] {"Error in generating nonce of length " + length}
             );
         }
     }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java Fri May 15 14:13:49 2015
@@ -414,12 +414,12 @@ public class WSSConfig {
         if (actionObject instanceof Class<?>) {
             try {
                 return (Action)((Class<?>)actionObject).newInstance();
-            } catch (Throwable t) {
+            } catch (Exception ex) {
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug(t.getMessage(), t);
+                    LOG.debug(ex.getMessage(), ex);
                 }
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                        "unableToLoadClass", t, ((Class<?>)actionObject).getName());
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex,
+                        "unableToLoadClass", new Object[] {((Class<?>)actionObject).getName()});
             }
         } else if (actionObject instanceof Action) {
             return (Action)actionObject;
@@ -506,12 +506,12 @@ public class WSSConfig {
         if (validatorObject instanceof Class<?>) {
             try {
                 return (Validator)((Class<?>)validatorObject).newInstance();
-            } catch (Throwable t) {
+            } catch (Exception ex) {
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug(t.getMessage(), t);
+                    LOG.debug(ex.getMessage(), ex);
                 }
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "unableToLoadClass", t, ((Class<?>)validatorObject).getName());
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex,
+                    "unableToLoadClass", new Object[] {((Class<?>)validatorObject).getName()});
             }
         } else if (validatorObject instanceof Validator) {
             return (Validator)validatorObject;
@@ -532,12 +532,12 @@ public class WSSConfig {
         if (processorObject instanceof Class<?>) {
             try {
                 return (Processor)((Class<?>)processorObject).newInstance();
-            } catch (Throwable t) {
+            } catch (Exception ex) {
                 if (LOG.isDebugEnabled()) {
-                    LOG.debug(t.getMessage(), t);
+                    LOG.debug(ex.getMessage(), ex);
                 }
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                        "unableToLoadClass", t, ((Class<?>)processorObject).getName());
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex,
+                        "unableToLoadClass", new Object[] {((Class<?>)processorObject).getName()});
             }
         } else if (processorObject instanceof Processor) {
             return (Processor)processorObject;

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/CustomTokenAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/CustomTokenAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/CustomTokenAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/CustomTokenAction.java Fri May 15 14:13:49 2015
@@ -24,7 +24,6 @@ import javax.security.auth.callback.Call
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-
 import org.apache.wss4j.common.SecurityActionToken;
 import org.apache.wss4j.common.ext.WSPasswordCallback;
 import org.apache.wss4j.common.ext.WSSecurityException;
@@ -53,14 +52,14 @@ public class CustomTokenAction implement
         try {
             callbackHandler.handle(new Callback[]{wsPasswordCallback});
         } catch (Exception e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "empty", e, "WSHandler: password callback failed");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+                    "empty", new Object[] {"WSHandler: password callback failed"});
         }
         
         Element customToken = wsPasswordCallback.getCustomToken();
         if (customToken == null) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "resourceNotFound", "CustomToken"
+                WSSecurityException.ErrorCode.FAILURE, "resourceNotFound", new Object[] {"CustomToken"}
             );
         }
         

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionAction.java Fri May 15 14:13:49 2015
@@ -110,7 +110,8 @@ public class EncryptionAction implements
         try {
             wsEncrypt.build(doc, encryptionToken.getCrypto(), reqData.getSecHeader());
         } catch (WSSecurityException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", e, "Error during encryption: ");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty", 
+                                          new Object[] {"Error during encryption: "});
         }
     }
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/EncryptionDerivedAction.java Fri May 15 14:13:49 2015
@@ -120,8 +120,8 @@ public class EncryptionDerivedAction ext
             }
             
         } catch (WSSecurityException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
-                                          "empty", e, "Error during Encryption: ");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
+                                          "empty", new Object[] {"Error during Encryption: "});
         }
     }
     

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SAMLTokenSignedAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SAMLTokenSignedAction.java?rev=1679570&r1=1679569&r2=1679570&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SAMLTokenSignedAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SAMLTokenSignedAction.java Fri May 15 14:13:49 2015
@@ -130,8 +130,8 @@ public class SAMLTokenSignedAction imple
                     reqData.getSecHeader());
             reqData.getSignatureValues().add(wsSign.getSignatureValue());
         } catch (WSSecurityException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", e, 
-                                          "Error when signing the SAML token: ");
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e, "empty", 
+                                          new Object[] {"Error when signing the SAML token: "});
         }
     }
 



Mime
View raw message