Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] @method @constructor




Hi Oliver,

declare @constructor does match the default constructor - as you've
probably
discovered from running the code.  The xref view in AJDT isn't showing you
the
match though - and that's a bug I'm looking at right now.  It should
indicate
the annotation matches on the type itself when the default ctor doesn't
exist
in the source.


Andy.



                                                                           
             <boehm@xxxxxxxxxx                                             
             >                                                             
             Sent by:                                                   To 
             aspectj-dev-bounc         AspectJ developer discussions       
             es@xxxxxxxxxxx            <aspectj-dev@xxxxxxxxxxx>           
                                                                        cc 
                                       <aspectj-dev@xxxxxxxxxxx>           
             25/04/2005 20:24                                      Subject 
                                       Re: [aspectj-dev] @method           
                                                                           
             Please respond to                                             
             AspectJ developer                                             
                discussions                                                
             <aspectj-dev@ecli                                             
                 pse.org>                                                  
                                                                           
                                                                           





Hello,

please forget my mail before. I don't know why but now it works as
expected. Perhaps I forgot to clean and rebuild the project.

regards
Oliver


boehm@xxxxxxxxxx schrieb am 25.04.2005, 20:24:01:
>
> Hello again,
>
> I attach @Logged to all getter methods in the Rechnung class:
>
>     declare @method: public * Rechnung.get*(..): @Logged;
>
> Depending on this annotation I define a pointcut:
>
>     after() : execution(@Logged * *..*(..)) {
>         log.info(thisJoinPoint);
>     }
>
> It works as expected. But when I try to access the annotation I get a
> null result. Here the access:
>
>     public void testMethodAnnoation() throws SecurityException,
>             NoSuchMethodException {
>         Method m = Rechnung.class.getMethod("getSumme", (Class[]) null);
>         Annotation a = m.getAnnotation(Logged.class);
>         assertNotNull(a);
>     }
>
> When I put the @Logged annotation manually before the getSumme()-method
> I get the Logged-annotation in the test method. Is this normal?
>
> regards
> Oliver
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev




Back to the top