You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by pb...@apache.org on 2007/12/07 05:42:27 UTC
svn commit: r601987 - in
/struts/struts1/trunk/core/src/main/java/org/apache/struts:
action/DynaActionFormClass.java chain/commands/ExceptionCatcher.java
chain/commands/generic/CopyFormToContext.java validator/ValidatorForm.java
Author: pbenedict
Date: Thu Dec 6 20:42:27 2007
New Revision: 601987
URL: http://svn.apache.org/viewvc?rev=601987&view=rev
Log:
STR-3118: Per Niall's comment, use the JDK 1.4 verbose way of setting the initial cause
Modified:
struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java
struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java
struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java
struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java
Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java?rev=601987&r1=601986&r2=601987&view=diff
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java Thu Dec 6 20:42:27 2007
@@ -250,9 +250,11 @@
try {
beanClass = RequestUtils.applicationClass(config.getType());
} catch (Throwable t) {
- throw new IllegalArgumentException(
+ IllegalArgumentException e = new IllegalArgumentException(
"Cannot instantiate ActionFormBean class '" + config.getType()
- + "'", t);
+ + "'");
+ e.initCause(t);
+ throw e;
}
if (!DynaActionForm.class.isAssignableFrom(beanClass)) {
Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java?rev=601987&r1=601986&r2=601987&view=diff
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java Thu Dec 6 20:42:27 2007
@@ -164,7 +164,9 @@
} catch (Exception e) {
LOG.warn("Exception from exceptionCommand '" + exceptionCommand
+ "'", e);
- throw new IllegalStateException("Exception chain threw exception");
+ IllegalStateException e2 = new IllegalStateException("Exception chain threw exception");
+ e2.initCause(e);
+ throw e2;
}
return (true);
Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java?rev=601987&r1=601986&r2=601987&view=diff
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java Thu Dec 6 20:42:27 2007
@@ -251,8 +251,10 @@
try {
context = (ActionContextBase) ctx;
} catch (ClassCastException e) {
- throw new IllegalStateException("ActionContext [" + ctx + "]"
- + " must be subclass of ActionContextBase", e);
+ IllegalStateException e2 = new IllegalStateException("ActionContext [" + ctx + "]"
+ + " must be subclass of ActionContextBase");
+ e2.initCause(e);
+ throw e2;
}
ActionForm form =
Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java
URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java?rev=601987&r1=601986&r2=601987&view=diff
==============================================================================
--- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java (original)
+++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java Thu Dec 6 20:42:27 2007
@@ -111,10 +111,12 @@
try {
application = getServlet().getServletContext();
} catch (NullPointerException e) {
- throw new IllegalStateException(
+ IllegalStateException e2 = new IllegalStateException(
"Missing ActionServlet instance for bean '" +
mapping.getName() +
"' (created outside of Struts?)");
+ e2.initCause(e);
+ throw e2;
}
Validator validator =