[jboss-cvs] JBossAS SVN: r64269 - projects/aop/trunk/aop/src/main/org/jboss/aop/advice.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 25 08:04:38 EDT 2007


Author: stalep
Date: 2007-07-25 08:04:38 -0400 (Wed, 25 Jul 2007)
New Revision: 64269

Modified:
   projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerVmAdvice.java
Log:
[JBAOP-359] Added simple check if the adviceName is found in the class, if not we throw an informative exception.

Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerVmAdvice.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerVmAdvice.java	2007-07-24 23:58:43 UTC (rev 64268)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/PerVmAdvice.java	2007-07-25 12:04:38 UTC (rev 64269)
@@ -117,6 +117,8 @@
             {
                if (methods[i].getName().equals(adviceName)) matches.add(methods[i]);
             }
+            if(matches.size() == 0)
+               throw new RuntimeException("Class "+aspect.getClass()+" didnt include any method called "+adviceName+", no interceptor will be created.");
 
             // TODO Need to have checks on whether the advice is overloaded and it is an argument type interception
             if (matches.size() == 1)




More information about the jboss-cvs-commits mailing list