Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Xlint:shadowNotInStructure - should I care and why?




That lint warning is an indication that there is a problem building the
'model' of what happened during weaving.  This model is used to give you
the nice gutter annotations and feedback in the UI - it doesn't affect
whether the weaving of the program succeeds.

So... it doesnt affect whether your program will function as expected but
you may not see gutter annotations (on the lines you have marked with <--)
after compilation.

It does indicate something we should fix though, so if you raise a bug with
your sample program in, I'll look at it.

To answer your second question, descriptions of some of the lint warnings
get included in the doc - for example 'adviceDidNotMatch' warnings are
described in the AspectJ5 Notebook.  *But* there is no complete description
of them all - Oliver Boehm wrote some testcases for us that produced many
of the lint warnings, I think that was in preparation for a book he's
writing on AspectJ - so maybe you can find them in there :)  I think we
ought to have a list somewhere in our doc - I would accept that as another
bug...

regards,
Andy.




                                                                           
             Rafal Krzewski                                                
             <Rafal.Krzewski@c                                             
             altha.pl>                                                  To 
             Sent by:                  aspectj-users@xxxxxxxxxxx           
             aspectj-users-bou                                          cc 
             nces@xxxxxxxxxxx                                              
                                                                   Subject 
                                       [aspectj-users]                     
             05/07/2005 11:12          Xlint:shadowNotInStructure - should 
                                       I care and why?                     
                                                                           
             Please respond to                                             
             aspectj-users@ecl                                             
                 ipse.org                                                  
                                                                           
                                                                           




Hello,

consider the following example aspect:

package test;
public aspect Locals {
             static void a() {
             }
             pointcut callOfA() : call(void test.Locals.a());
             after() : callOfA() {
                         System.out.println("a() called at
"+thisJoinPoint.getSourceLocation());
             }
             public static void main(String[] argv) {
                         final class Local implements Runnable {
                                     public void run() {
                                                 a(); // <-- warning here
                                     }
                         }
                         Local local = new Local();
                         local.run();
                         Runnable inner = new Runnable() {
                                     public void run() {
                                                 a(); // <-- and here
                                     }
                         };
                         inner.run();
                         Nested nested = new Nested();
                         nested.run();
             }
             private static class Nested implements Runnable {
                         public void run()
                         {
                                     a();
                         }
             }
}

On the lines marked in the source AJDT compiler reports a warning:
"the shadow for this join point is not exposed in the strucuture model:
method-call(void test.Locals.a()) [Xlint:shadowNotInStructure]"

running the program though displays:
a() called at Locals.aj:12
a() called at Locals.aj:19
a() called at Locals.aj:29

Which means that advice was woven as I would expect it.

My question #1 is then: what does this warning mean, and should I be
concernced?

My question #2 is where do I find description of avaliable Xlint checks?
(I took a quick look at AJ & AJTD docs, and Googled a bit, to no avail)

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




Back to the top