[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Annotation pointcut


That is aspectj working as designed.  Constructor patterns really have no return
type and if you specify one you get an error.   What would you be trying to
say with the first variant?  That a constructor returns an @Alien annotated instance?
The second variant says execution of a constructor on an @Alien annotated type -
I guess thats what you want.

Andy.



"Oli B." <boehm@xxxxxxxxxx>
Sent by: aspectj-dev-admin@xxxxxxxxxxx

08/03/2005 21:46

Please respond to
aspectj-dev@xxxxxxxxxxx

To
aspectj-dev@xxxxxxxxxxx
cc
Subject
[aspectj-dev] Annotation pointcut





Hello,

i want to hit all constructors of classes with an @Alien annotation:

                after(Object x) : execution((@Alien *) *.new(..)) && this(x) {

The result of this pointcut is a 'Syntax error on token "(",
"constructor patterns have no return type" expected'. When I modify it a
little bit to

                after(Object x) : execution((@Alien *).new(..)) && this(x) {

it works as expected. The only difference is the missing 2nd "*" in
((@Alien *) *.new(..)) from the first try. Is it a bug (build
20050225125806) or a misunderstanding from me?

regards
Oliver
--
Oliver Böhm
http://www.javatux.de

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