You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cr...@apache.org on 2006/10/03 23:44:18 UTC
svn commit: r452639 -
/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
Author: crogers
Date: Tue Oct 3 14:44:17 2006
New Revision: 452639
URL: http://svn.apache.org/viewvc?view=rev&rev=452639
Log:
Missed this one in a previous revision... another case where we need to ensure the use of JspException works as expected with the Servlet 2.5 / JSP 2.1 API. Does not effect behavior at runtime with the 2.4 api. (See svn revision 429862, 427226)
tests: NetUI BVT (WinXP pass)
Modified:
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java?view=diff&rev=452639&r1=452638&r2=452639
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/FormatNumber.java Tue Oct 3 14:44:17 2006
@@ -232,9 +232,8 @@
catch (Exception e) {
JspException jspException = new JspException(Bundle.getString("Tags_NumberFormatPatternException", e.getMessage()), e);
- // todo: future cleanup
// The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
- // this will cause an IllegalStateException on the following call.
+ // initCause() throws an IllegalStateException if the cause is already set.
if (jspException.getCause() == null) {
jspException.initCause(e);
}
@@ -251,7 +250,12 @@
}
catch (Exception e) {
JspException jspException = new JspException(Bundle.getString("Tags_NumberFormatParseException", e.getMessage()), e);
- jspException.initCause(e);
+
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // initCause() throws an IllegalStateException if the cause is already set.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}