[jboss-cvs] JBossAS SVN: r58815 - projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 1 22:45:15 EST 2006
Author: flaviarnn
Date: 2006-12-01 22:45:09 -0500 (Fri, 01 Dec 2006)
New Revision: 58815
Modified:
projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceInfo.java
projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceMethodFactory.java
Log:
[JBAOP-37] Bug on assignability degree of return types solved.
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceInfo.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceInfo.java 2006-12-02 03:42:57 UTC (rev 58814)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceInfo.java 2006-12-02 03:45:09 UTC (rev 58815)
@@ -200,7 +200,7 @@
* annotation identified by <code>typeIndex</code>;
* {@link AdviceMethodFactory#NOT_ASSIGNABLE_DEGREE} otherwise.
*/
- public short getReturnAssignabilityDegree(AdviceMethodProperties properties)
+ public final short getReturnAssignabilityDegree(AdviceMethodProperties properties)
{
Class returnType = this.method.getReturnType();
if (returnType == void.class)
@@ -212,7 +212,7 @@
if (degree == AdviceMethodFactory.NOT_ASSIGNABLE_DEGREE)
{
// return type is Object.class and join point return type is not
- // Object is worse than join point return type, but better than -1
+ // Object is worse than join point return type, but better than NOT_ASSIGNABLE
return AdviceMethodFactory.MAX_DEGREE;
}
return degree;
Modified: projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceMethodFactory.java
===================================================================
--- projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceMethodFactory.java 2006-12-02 03:42:57 UTC (rev 58814)
+++ projects/aop/trunk/aop/src/main/org/jboss/aop/advice/annotation/AdviceMethodFactory.java 2006-12-02 03:45:09 UTC (rev 58815)
@@ -45,7 +45,7 @@
public class AdviceMethodFactory
{
/**
- * Rule to be applied for advice return types
+ * Rule to be applied on advice return types
*/
enum ReturnType {VOID, ANY, NOT_VOID};
@@ -402,10 +402,11 @@
{
for (AdviceInfo currentAdvice: greatestRank)
{
- int currentDegree = currentAdvice.getReturnAssignabilityDegree(properties);
+ short currentDegree = currentAdvice.getReturnAssignabilityDegree(properties);
if (currentDegree < bestDegree)
{
bestAdvice = currentAdvice;
+ bestDegree = currentDegree;
}
}
//in case of two or more advices with the same match degree, pick any one of them
More information about the jboss-cvs-commits
mailing list