Bug 102742 - pointcuts in local and inner classes are not exposed in structure model
Summary: pointcuts in local and inner classes are not exposed in structure model
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5.0M5   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-05 11:58 EDT by Rafal Krzewski CLA
Modified: 2005-11-22 09:26 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Krzewski CLA 2005-07-05 11:58:29 EDT
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]" and "advised"
gutter annotations are not displayed.

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.
Comment 1 Matt Chapman CLA 2005-07-05 12:13:14 EDT
Moving over to AspectJ
Comment 2 Adrian Colyer CLA 2005-10-28 08:29:53 EDT
Hi Helen, Andy says.... please could you take a look at this one?  Thks, A.
Comment 3 Helen Beeken CLA 2005-11-21 12:29:18 EST
I believe this bug has already been fixed. Using the given testcase in AJDT version 20050714091025 (which is close to when this bug was raised) I see exactly the behaviour which was reported. However, trying with a later AJDT 20051019121930 which contains AspectJ 1.5.0.200510141300 I am no longer able to recreate the problem. This is still unrecreatable with the latest AJDT 20051118122350 which contains AspectJ 1.5.0 M5. Possibly, this was fixed as part of bug 77269.

Rafal - are you still seeing the problem?

Comment 4 Rafal Krzewski CLA 2005-11-22 09:12:20 EST
I just tried the 1.3.0.20051121122226 build on Eclipse 3.1.1 and I get the correct behaviour - no warnings, and gutter annotations show up as expected.

I consider it fixed :-)
Comment 5 Helen Beeken CLA 2005-11-22 09:22:10 EST
Rafal - thanks for retrying this and also for the comprehensive testcase :-)
Comment 6 Helen Beeken CLA 2005-11-22 09:26:39 EST
Resolving as fixed (see comment #3 and comment #4)