Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] context with and without annotations

Hi Eric,

Sorry for this mistake but I have simplified my case for writing this message and I made an error.

The call to myMethod is 
			moc.myMethod("sample",mc);
instead of 
			moc.myMethod("sample",moc);

Mickaël Rifflard
Atos Origin

-----Message d'origine-----
De : aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx]De la part de Eric Bodden
Envoyé : vendredi 8 avril 2005 15:34
À : aspectj-users@xxxxxxxxxxx
Objet : 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-----



_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top