Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ajdt-dev] ASM hierarchy model




>From a very quick look at the debug files - the gutter stuff is still
missing because the offsets don't match.


In the working case I can see this handle for a piece of advice:

before(): <anonymous pointcut>  [advice]
SingletonAspectBindingsTest2.aj:112::3677

and then this relationship:

Hid:2:(targets=1) SingletonAspectBindingsTest2.aj|112|0|3677 (advises)
SingletonAspectBindingsTest2.aj|45|0|1511

===

In the failing case, I see this handle:

before(JoinPoint.StaticPart): <anonymous pointcut>  [advice]
SingletonAspectBindingsTest.java:113::3742

and then this relationship:

Hid:1:(targets=1) SingletonAspectBindingsTest.java|113|0|3777 (advises)
SingletonAspectBindingsTest.java|45|0|1509

with different offsets there is no match.  i.e. if I use the handle for the
advice (offset 3742) as an index into the relationships, it will return
zero matching entries.

Whether the fix is to get the offsets right for @AJ or make handle
equivalence testing more lenient, I'm not sure.

Andy.





                                                                           
             Alexandre Vasseur                                             
             <avasseur@gmail.c                                             
             om>                                                        To 
             Sent by:                  AspectJ Development Tools developer 
             ajdt-dev-bounces@         discussions <ajdt-dev@xxxxxxxxxxx>  
             eclipse.org                                                cc 
                                                                           
                                                                   Subject 
             04/07/2005 14:35          Re: [ajdt-dev] ASM hierarchy model  
                                                                           
                                                                           
             Please respond to                                             
             Alexandre Vasseur                                             
             <avasseur@gmail.c                                             
                om>; Please                                                
                respond to                                                 
                  AspectJ                                                  
                Development                                                
              Tools developer                                              
                discussions                                                
             <ajdt-dev@eclipse                                             
                   .org>                                                   
                                                                           
                                                                           




Mik, I am not sure to follow.

I have just commited in AspectJ a bunch of fix that makes the
AsmManager...setReporting happy when it encounters @AJ aspect. I had
no more luck with AJDT though (ie showWeaveInfo is fine but no gutter
or cross reference view appears)

If you want to dig further what needs to perhaps be done in AspectJ,
you may check the "AtAjSyntaxTests.testSingletonAspectBindings()" that
runs some simple aspect written in both style (ie 2 run) and dump the
Asm model if you uncomment some lines.
I am also attaching the dump file if in any case you can spot something
obvious.
debug-aj.txt is the one for code style, debug.txt is the one for
annotation style.

Alex



On 6/29/05, Mik Kersten <beatmik@xxxxxxx> wrote:
> Good question.  It definitely feels wrong for them to have the plain Java
> kind, because the programmer and tools should treat them as advice.  But
> there will be cases where the fact that they're annotated as advice needs
to
> be differentiated.  Also, it is feasible that down the road we could want
> the annotation to be a separate program element.  I'm curious to see how
the
> JDT's IJavaModel ends up handling annotations and am not aware of any
> mechanism for going from a declaration to an annotation.  Matt, do you
know?
>
> For now I suggest adding an isAnnotated() method to IProgramElement to
> indicate whether or not this advice/pointcut/etc. is specified as an
> annotation or as code.  Then simply setting the kind to be the AOP kind
not
> the OOP kind.  Not that you may be tempted to put this method and field
on
> the IProgramElement.Kind calss, which would be fine, but that typesafe
enum
> pattern should be switched to a Java 5 enum at some point.  If you agree,
> and would like me to make the change just let me know.
>
> Mik
>
> > -----Original Message-----
> > From: ajdt-dev-bounces@xxxxxxxxxxx
[mailto:ajdt-dev-bounces@xxxxxxxxxxx]
> > On Behalf Of Alexandre Vasseur
> > Sent: Thursday, June 23, 2005 7:59 AM
> > To: AspectJ Development Tools developer discussions
> > Subject: [ajdt-dev] ASM hierarchy model
> >
> > A question for Mik I guess.
> >
> > For IDE support to work correctly, should the Hierarchy and
> > Relationship model output by the weaver have correct "kind" for
> > @AspectJ style member ie be flagged as IProgramElement.Kind.Advice,
> > Aspect, Pointcut etc. ?
> >
> > f.e. with
> >
> >       SingletonAspectBindingsTest  [class]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:30::1063
> >         TestAspect  [aspect]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:74::2495
> >           s  [field]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:76::2530
> >           ...  [initializer]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:78::2555
> >           TestAspect()  [constructor]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:82::2604
> >           aaround(ProceedingJoinPoint)  [method]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:90::2901
> >           around2(ProceedingJoinPoint, Object)  [method]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:101::3273
> >           before(JoinPoint.StaticPart)  [advice]
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java:113::3742
> > ....
> > === RELATIONSHIPS REPORT ========= After a batch build
> > Hid:1:(targets=1)
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java|49|0|1568
> > (advised by)
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java|128|0|4563
> > Hid:2:(targets=1)
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java|90|0|2935
> > (advises)
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java|45|0|1509
> > Hid:3:(targets=1)
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java|101|0|3317
> > (advises)
> >
C:\Temp\ajcSandbox\ajcTest36518.tmp\ataspectj\SingletonAspectBindingsTest.
> > java|45|0|1509
> > ...
> > === Properties of the model and relationships map =====
> > method=13
> > import reference=19
> > aspect=1
> > constructor=1
> > class=2
> > advice=2
> > ...
> > we can see that TestAspect.java is flagged to be an aspect.
> > Same for the method before, flagged to be an advice.
> > But since I am in the middle of doing some changes, you can see that
> > aaround(..) are flagged as methods.
> >
> > Is AJDT supposed to work only from the advised-by / advises info or
> > does this things matters ? (this because it means changing some in the
> > ajdt.core to check if there are the @Aspect, @Before and so on
> > annotations).
> > (BTW with that, AJDT does not show up the markers and the cross
> > cutting structure better, despite the advised by is correct in the
> > problem view (when turned on).
> >
> > Alex
> > _______________________________________________
> > ajdt-dev mailing list
> > ajdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/ajdt-dev
>
> _______________________________________________
> ajdt-dev mailing list
> ajdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ajdt-dev
>
(See attached file: debug.txt)(See attached file: debug-aj.txt)
_______________________________________________
ajdt-dev mailing list
ajdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ajdt-dev

Attachment: debug.txt
Description: Binary data

Attachment: debug-aj.txt
Description: Binary data


Back to the top