Community
Participate
Working Groups
The following program causes a compiler exception for me. public class Test { double foo(double x) { return x; } } aspect Aspect { pointcut foo(int b): args(b); before(Object i) : foo(i) { } }
The bug occurs when AspectJ attempts to weave a runtime instanceof test against a primitive type. We get into this situation when a pointcut matches via an isCoercible() test as opposed to an isAssignable() from test. The following simpler program will also reproduce the bug: public class Test { void foo(double x) {} } aspect Aspect { // double coerced to int pointcut foo(int i) : execution(* foo(..)) && args(i); before() : foo(int) {} } Whereas this variation compiles happily: public class Test { void foo(int x) {} } aspect Aspect { // int assigned to double pointcut foo(double d) : execution(* foo(..)) && args(d); before() : foo(double) {} } Will look into the solution more in the morning...
Fix committed to tree, will close the defect report once it is available in a public build.
Fix now available in latest build.
Fix released as part of AspectJ 1.2.1