You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2014/01/20 13:15:32 UTC

svn commit: r1559672 - in /webservices/wss4j/trunk: ws-security-common/src/main/java/org/apache/wss4j/common/crypto/ ws-security-common/src/main/java/org/apache/wss4j/common/saml/ ws-security-common/src/main/java/org/apache/wss4j/common/util/ ws-securi...

Author: coheigea
Date: Mon Jan 20 12:15:31 2014
New Revision: 1559672

URL: http://svn.apache.org/r1559672
Log:
Review of Exception throwing

Modified:
    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/Merlin.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/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/message/token/SecurityTokenReference.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/SAMLTokenProcessor.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/str/DerivedKeyTokenSTRParser.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-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/processor/output/DerivedKeyTokenOutputProcessor.java

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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -242,28 +242,28 @@ public class CertificateStore extends Cr
             validator.validate(path, param);
         } catch (java.security.NoSuchProviderException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath",
-                    e.getMessage(), e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e,
+                    e.getMessage()
                 );
         } catch (NoSuchAlgorithmException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath", 
-                    e.getMessage(), e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e,
+                    e.getMessage()
                 );
         } catch (java.security.cert.CertificateException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath", 
-                    e.getMessage(), e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e,
+                    e.getMessage()
                 );
         } catch (java.security.InvalidAlgorithmParameterException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath",
-                    e.getMessage(), e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e,
+                    e.getMessage()
                 );
         } catch (java.security.cert.CertPathValidatorException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath",
-                    e.getMessage(), e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e,
+                    e.getMessage()
                 );
         }
     }
@@ -352,7 +352,7 @@ public class CertificateStore extends Cr
             sha = MessageDigest.getInstance("SHA1");
         } catch (NoSuchAlgorithmException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", null, e
+                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
             );
         }
         for (X509Certificate trustedCert : trustedCerts) {
@@ -360,8 +360,7 @@ public class CertificateStore extends Cr
                 sha.update(trustedCert.getEncoded());
             } catch (CertificateEncodingException ex) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError",
-                    null, ex
+                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", ex
                 );
             }
             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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -161,13 +161,11 @@ public abstract class CryptoBase impleme
                 certFactMap.put(factory.getProvider().getName(), factory);
             } catch (CertificateException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "unsupportedCertType",
-                    null, e
+                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "unsupportedCertType", e
                 );
             } catch (NoSuchProviderException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noSecProvider",
-                    null, e
+                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noSecProvider", e
                 );
             }
         }
@@ -187,8 +185,7 @@ public abstract class CryptoBase impleme
             return (X509Certificate) certFactory.generateCertificate(in);
         } catch (CertificateException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError",
-                null, e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
             );
         }
     }
@@ -221,9 +218,8 @@ public abstract class CryptoBase impleme
                 return digest.digest(value);
             } catch (Exception ex) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN, "noSKIHandling",
-                    "No SKI certificate extension and no SHA1 message digest available",
-                    ex
+                    WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN, "noSKIHandling", ex,
+                    "No SKI certificate extension and no SHA1 message digest available"
                 );
             }
         }
@@ -255,13 +251,11 @@ public abstract class CryptoBase impleme
             return path.getEncoded();
         } catch (CertificateEncodingException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError",
-                null, e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", e
             );
         } catch (CertificateException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError",
-                null, e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
             );
         }
     }
@@ -282,8 +276,7 @@ public abstract class CryptoBase impleme
             path = getCertificateFactory().generateCertPath(in);
         } catch (CertificateException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError",
-                null, e
+                WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "parseError", e
             );
         }
         List<?> l = path.getCertificates();

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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -286,9 +286,7 @@ public abstract class CryptoFactory {
             }
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE, 
-                "resourceNotFound",
-                propFilename,
-                e
+                "resourceNotFound", e, propFilename
             );
         }
         return properties;

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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -367,7 +367,7 @@ public class Merlin extends CryptoBase {
                         LOG.debug(e.getMessage(), e);
                     }
                     throw new WSSecurityException(
-                            WSSecurityException.ErrorCode.FAILURE, "proxyNotFound", location, e
+                            WSSecurityException.ErrorCode.FAILURE, "proxyNotFound", e, location
                     );
                 }
             }
@@ -535,13 +535,11 @@ public class Merlin extends CryptoBase {
                 certFactMap.put(factory.getProvider().getName(), factory);
             } catch (CertificateException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "unsupportedCertType",
-                    null, e
+                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "unsupportedCertType", e
                 );
             } catch (NoSuchProviderException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noSecProvider",
-                    null, e
+                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "noSecProvider", e
                 );
             }
         }
@@ -582,7 +580,7 @@ public class Merlin extends CryptoBase {
                 }
             } catch (KeyStoreException ex) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "keystore", null, ex
+                    WSSecurityException.ErrorCode.FAILURE, "keystore", ex
                 );
             } 
         }
@@ -704,15 +702,15 @@ public class Merlin extends CryptoBase {
             return (PrivateKey) keyTmp;
         } catch (KeyStoreException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", new Object[]{ex.getMessage()}, ex
+                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
             );
         } catch (UnrecoverableKeyException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", new Object[]{ex.getMessage()}, ex
+                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
             );
         } catch (NoSuchAlgorithmException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", new Object[]{ex.getMessage()}, ex
+                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
             );
         }
     }
@@ -758,15 +756,15 @@ public class Merlin extends CryptoBase {
             return (PrivateKey) keyTmp;
         } catch (KeyStoreException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", new Object[]{ex.getMessage()}, ex
+                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
             );
         } catch (UnrecoverableKeyException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", new Object[]{ex.getMessage()}, ex
+                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
             );
         } catch (NoSuchAlgorithmException ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", new Object[]{ex.getMessage()}, ex
+                WSSecurityException.ErrorCode.FAILURE, "noPrivateKey", ex, ex.getMessage()
             );
         }
     }
@@ -908,40 +906,33 @@ public class Merlin extends CryptoBase {
             validator.validate(path, param);
         } catch (NoSuchProviderException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath",
-                    e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e
                 );
         } catch (NoSuchAlgorithmException e) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE,
-                    "certpath", new Object[] { e.getMessage() },
-                    e
+                    "certpath", e, e.getMessage()
                 );
         } catch (CertificateException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath", 
-                    e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e
                 );
         } catch (java.security.InvalidAlgorithmParameterException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath",
-                    e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e
                 );
         } catch (java.security.cert.CertPathValidatorException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILED_AUTHENTICATION, "certpath",
-                    e
+                    WSSecurityException.ErrorCode.FAILED_AUTHENTICATION, "certpath", e
                 );
         } catch (KeyStoreException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath",
-                    e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e
                 );
         } catch (NullPointerException e) {
                 // NPE thrown by JDK 1.7 for one of the test cases
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "certpath",
-                    e
+                    WSSecurityException.ErrorCode.FAILURE, "certpath", e
                 );
         }
     }
@@ -1058,7 +1049,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", null, e
+                WSSecurityException.ErrorCode.FAILURE, "keystore", e
             );
         }
         return new Certificate[]{};
@@ -1078,7 +1069,7 @@ public class Merlin extends CryptoBase {
             sha = MessageDigest.getInstance("SHA1");
         } catch (NoSuchAlgorithmException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", null, e
+                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
             );
         }
         Certificate[] certs = null;
@@ -1136,7 +1127,7 @@ public class Merlin extends CryptoBase {
                     } catch (CertificateEncodingException ex) {
                         throw new WSSecurityException(
                             WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError",
-                            null, ex
+                            ex
                         );
                     }
                     byte[] data = sha.digest();
@@ -1148,7 +1139,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", null, e
+                WSSecurityException.ErrorCode.FAILURE, "keystore", e
             );
         }
         return new Certificate[]{};
@@ -1218,7 +1209,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", null, e
+                WSSecurityException.ErrorCode.FAILURE, "keystore", e
             );
         }
         return new Certificate[]{};
@@ -1306,7 +1297,7 @@ public class Merlin extends CryptoBase {
                 return null;
             }
         } catch (KeyStoreException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "keystore", null, e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "keystore", e);
         }
 
         X509Certificate[] x509certs = new X509Certificate[certs.length];
@@ -1386,7 +1377,7 @@ public class Merlin extends CryptoBase {
             }
         } catch (KeyStoreException e) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "keystore", null, e
+                WSSecurityException.ErrorCode.FAILURE, "keystore", e
             );
         }
         return new Certificate[]{};
@@ -1442,7 +1433,7 @@ public class Merlin extends CryptoBase {
                 }
             }
         } catch (KeyStoreException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "keystore", null, e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "keystore", e);
         }
         return null;
     }
@@ -1466,16 +1457,12 @@ public class Merlin extends CryptoBase {
         } catch (IOException e) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
-                "noPassword",
-                new Object[]{identifier}, 
-                e
+                "noPassword", e, identifier
             );
         } catch (UnsupportedCallbackException e) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
-                "noPassword",
-                new Object[]{identifier}, 
-                e
+                "noPassword", e, identifier
             );
         }
 

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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -284,8 +284,8 @@ public final class SAMLUtil {
             }
         } catch (Exception ex) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
-                new Object[]{"cannot get certificate or key"}, ex
+                WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity", ex,
+                "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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -711,11 +711,11 @@ public class SamlAssertionWrapper {
                 return xmlSignature.getSignatureValue();
             } catch (XMLSignatureException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity", null, e
+                    WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity", e
                 );
             } catch (XMLSecurityException e) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity", null, e
+                    WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity", e
                 );
             }
         }

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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -63,7 +63,7 @@ public final class UsernameTokenUtil {
                 LOG.debug(e.getMessage(), e);
             }
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", e
+                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
             );
         }
         //

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=1559672&r1=1559671&r2=1559672&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 Mon Jan 20 12:15:31 2014
@@ -625,7 +625,7 @@ public class WSSConfig {
                     LOG.debug(t.getMessage(), t);
                 }
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                        "unableToLoadClass", t, new Object[] { ((Class<?>)actionObject).getName() });
+                        "unableToLoadClass", t, ((Class<?>)actionObject).getName());
             }
         } else if (actionObject instanceof Action) {
             return (Action)actionObject;
@@ -717,7 +717,7 @@ public class WSSConfig {
                     LOG.debug(t.getMessage(), t);
                 }
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                    "unableToLoadClass", t, new Object[] { ((Class<?>)validatorObject).getName() });
+                    "unableToLoadClass", t, ((Class<?>)validatorObject).getName());
             }
         } else if (validatorObject instanceof Validator) {
             return (Validator)validatorObject;
@@ -743,7 +743,7 @@ public class WSSConfig {
                     LOG.debug(t.getMessage(), t);
                 }
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                        "unableToLoadClass", t, new Object[] { ((Class<?>)processorObject).getName() });
+                        "unableToLoadClass", t, ((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/message/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java Mon Jan 20 12:15:31 2014
@@ -408,7 +408,7 @@ public class SecurityTokenReference {
             createKeyIdentifier(doc, THUMB_URI, text, true);
         } catch (WSSecurityException e1) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", e1
+                WSSecurityException.ErrorCode.FAILURE, "decoding.general", e1
             );
         }
     }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java Mon Jan 20 12:15:31 2014
@@ -219,7 +219,7 @@ public class UsernameToken {
                 } catch (IllegalArgumentException e) {
                     throw new WSSecurityException(
                         WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN,
-                        "badUsernameToken",
+                        "badUsernameToken", e,
                         "Error parsing UsernameToken Created value"
                     );
                 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java Mon Jan 20 12:15:31 2014
@@ -175,7 +175,7 @@ public class SAMLTokenProcessor implemen
                 } catch (MarshalException ex) {
                     throw new WSSecurityException(
                         WSSecurityException.ErrorCode.FAILED_CHECK, "invalidSAMLsecurity", 
-                        new Object[]{"cannot get certificate or key"}, ex
+                        ex, "cannot get certificate or key"
                     );
                 }
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java Mon Jan 20 12:15:31 2014
@@ -90,7 +90,7 @@ public class WSSSAMLKeyInfoProcessor imp
                         return new SAMLKeyInfo(Base64.decode(txt.getData()));
                     } catch (Exception e) {
                         throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
-                                "empty", e, "decoding.general");
+                                "decoding.general", e);
                     }
                 } else if (SecurityTokenReference.STR_QNAME.equals(el)) {
                     STRParser strParser = new SignatureSTRParser();

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java Mon Jan 20 12:15:31 2014
@@ -223,8 +223,7 @@ public class DerivedKeyTokenSTRParser im
         } catch (Exception e) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
-                "noPassword", 
-                e, id);
+                "noPassword", e, id);
         }
 
         return null;

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java Mon Jan 20 12:15:31 2014
@@ -253,8 +253,7 @@ public class SecurityTokenRefSTRParser i
         } catch (Exception e) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
-                "noPassword", 
-                e, id);
+                "noPassword", e, id);
         }
 
         return null;

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java Mon Jan 20 12:15:31 2014
@@ -320,8 +320,7 @@ public class SignatureSTRParser implemen
         } catch (Exception e) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
-                "noPassword", 
-                e, id);
+                "noPassword", e, id);
         }
 
         return null;
@@ -431,8 +430,7 @@ public class SignatureSTRParser implemen
                                 }
                             } catch (CertificateEncodingException ex) {
                                 throw new WSSecurityException(
-                                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError",
-                                    ex
+                                    WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, "encodeError", ex
                                 );
                             }
                         }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/ext/WSSUtils.java Mon Jan 20 12:15:31 2014
@@ -120,7 +120,7 @@ public class WSSUtils extends XMLSecurit
             sha.update(b4);
             return new String(Base64.encodeBase64(sha.digest()));
         } catch (NoSuchAlgorithmException e) {
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noSHA1availabe", e);
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "decoding.general", e);
         } catch (UnsupportedEncodingException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
         }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java?rev=1559672&r1=1559671&r2=1559672&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java Mon Jan 20 12:15:31 2014
@@ -97,7 +97,7 @@ public class DerivedKeyTokenOutputProces
                 String defaultLabel = WSSConstants.WS_SecureConversation_DEFAULT_LABEL + WSSConstants.WS_SecureConversation_DEFAULT_LABEL;
                 label = defaultLabel.getBytes("UTF-8");
             } catch (UnsupportedEncodingException e) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", "UTF-8 encoding is not supported", e);
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", e, "UTF-8 encoding is not supported");
             }
 
             byte[] nonce = new byte[16];