You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2012/02/06 11:38:47 UTC
svn commit: r1240966 -
/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/exceptions/XMLSecurityRuntimeException.java
Author: coheigea
Date: Mon Feb 6 10:38:47 2012
New Revision: 1240966
URL: http://svn.apache.org/viewvc?rev=1240966&view=rev
Log:
[SANTUARIO-297] - Forgot file from last commit
Modified:
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/exceptions/XMLSecurityRuntimeException.java
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/exceptions/XMLSecurityRuntimeException.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/exceptions/XMLSecurityRuntimeException.java?rev=1240966&r1=1240965&r2=1240966&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/exceptions/XMLSecurityRuntimeException.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/exceptions/XMLSecurityRuntimeException.java Mon Feb 6 10:38:47 2012
@@ -61,9 +61,6 @@ public class XMLSecurityRuntimeException
private static final long serialVersionUID = 1L;
- /** Field originalException */
- protected Exception originalException = null;
-
/** Field msgID */
protected String msgID;
@@ -75,7 +72,6 @@ public class XMLSecurityRuntimeException
super("Missing message string");
this.msgID = null;
- this.originalException = null;
}
/**
@@ -87,7 +83,6 @@ public class XMLSecurityRuntimeException
super(I18n.getExceptionMessage(msgID));
this.msgID = msgID;
- this.originalException = null;
}
/**
@@ -100,7 +95,6 @@ public class XMLSecurityRuntimeException
super(MessageFormat.format(I18n.getExceptionMessage(msgID), exArgs));
this.msgID = msgID;
- this.originalException = null;
}
/**
@@ -113,9 +107,7 @@ public class XMLSecurityRuntimeException
+ Constants.exceptionMessagesResourceBundleBase
+ "\". Original Exception was a "
+ originalException.getClass().getName() + " and message "
- + originalException.getMessage());
-
- this.originalException = originalException;
+ + originalException.getMessage(), originalException);
}
/**
@@ -125,10 +117,9 @@ public class XMLSecurityRuntimeException
* @param originalException
*/
public XMLSecurityRuntimeException(String msgID, Exception originalException) {
- super(I18n.getExceptionMessage(msgID, originalException));
+ super(I18n.getExceptionMessage(msgID, originalException), originalException);
this.msgID = msgID;
- this.originalException = originalException;
}
/**
@@ -142,7 +133,6 @@ public class XMLSecurityRuntimeException
super(MessageFormat.format(I18n.getExceptionMessage(msgID), exArgs));
this.msgID = msgID;
- this.originalException = originalException;
}
/**
@@ -168,8 +158,8 @@ public class XMLSecurityRuntimeException
message = s;
}
- if (originalException != null) {
- message = message + "\nOriginal Exception was " + originalException.toString();
+ if (this.getCause() != null) {
+ message = message + "\nOriginal Exception was " + this.getCause().toString();
}
return message;
@@ -182,10 +172,6 @@ public class XMLSecurityRuntimeException
public void printStackTrace() {
synchronized (System.err) {
super.printStackTrace(System.err);
-
- if (this.originalException != null) {
- this.originalException.printStackTrace(System.err);
- }
}
}
@@ -196,10 +182,6 @@ public class XMLSecurityRuntimeException
*/
public void printStackTrace(PrintWriter printwriter) {
super.printStackTrace(printwriter);
-
- if (this.originalException != null) {
- this.originalException.printStackTrace(printwriter);
- }
}
/**
@@ -209,10 +191,6 @@ public class XMLSecurityRuntimeException
*/
public void printStackTrace(PrintStream printstream) {
super.printStackTrace(printstream);
-
- if (this.originalException != null) {
- this.originalException.printStackTrace(printstream);
- }
}
/**
@@ -221,7 +199,10 @@ public class XMLSecurityRuntimeException
* @return the original exception
*/
public Exception getOriginalException() {
- return originalException;
+ if (this.getCause() instanceof Exception) {
+ return (Exception)this.getCause();
+ }
+ return null;
}
}
\ No newline at end of file