[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] context with and without annotations
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Rifflard Mickaël wrote:
> This one doesn't match : (value of type MyAnnotation)
>
> pointcut myMethodInvocation(String key,MyAnnotation
> value) : call(public void
> MyOtherClass.myMethod(..)) &&
> args(key,value);
You write...
public class MyOtherClass {
public void myMethod(String arg1,MyAnnotation arg2) {...}
public static void main(String[] args) {
...
MyClass mc = new MyClass();
MyOtherClass moc = new MyOtherClass();
moc.myMethod("sample",moc);
...
}
}
How does this even compile? myMethod requires a MyAnnotation a
ssecond argument. You however pass is a MyOtherClass object "moc".
This is no valid type for this argument. Since "moc" is not of type
MyAnnotation, the above pc does not match. I still don't understand,
however, why your code compiles...
Eric
- --
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3
iQA/AwUBQlaILMwiFCm7RlWCEQL5fgCdGtPfCw28ia6AMG1dNn7m3M9/g6MAnjsJ
Tkh2JYZJ7ZIY4to/sEknv0Jh
=0hVF
-----END PGP SIGNATURE-----