[jboss-cvs] JBossAS SVN: r79726 - projects/aop/trunk/aop/docs/examples/finally.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 20 01:43:10 EDT 2008


Author: flavia.rainone at jboss.com
Date: 2008-10-20 01:43:10 -0400 (Mon, 20 Oct 2008)
New Revision: 79726

Modified:
   projects/aop/trunk/aop/docs/examples/finally/finally.html
Log:
[JBAOP-388] Updated finally tutorial exemple, to document that @Thrown-annotated
parameters must be of type Throwable when used for finally advice.

Modified: projects/aop/trunk/aop/docs/examples/finally/finally.html
===================================================================
--- projects/aop/trunk/aop/docs/examples/finally/finally.html	2008-10-20 05:40:29 UTC (rev 79725)
+++ projects/aop/trunk/aop/docs/examples/finally/finally.html	2008-10-20 05:43:10 UTC (rev 79726)
@@ -222,7 +222,10 @@
 The finally advice above intercepts <tt>Bank.getAccount(String)</tt> method, that
 throws a <tt>NoSuchAccountException</tt> if the account name is invalid. It prints a
 message telling whether <tt>Bank.getAccount(String)</tt> threw an exception, which
-happened only if <tt>thrownException</tt> is not null.
+happened only if <tt>thrownException</tt> is not null. Notice that the @Thrown-annotated
+advice parameter above is not of type <tt>NoSuchAccountException</tt>, it is of type
+<tt>Throwable</tt>. The reason for this is that <i>@Thrown-annotated parameters must
+always be of type <tt>Throwable</tt> when declared at a finally advice.</i>
 </p><p>
 A second consideration we need to make is that, <i>if a finally advice receives a
 @Return parameter, the use of @Thrown is compulsory</i>. This is so because the




More information about the jboss-cvs-commits mailing list