Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] LTW and pointcut not matched with @target and inheritance

I just tried out your latest code with the current dev build of
AspectJ 5. I made only the following change:

public class LtwTest // extends TestCase 
{

  // added main to drive direct from command line...
  public static void main(String[] args) {
     new LtwTest().testLtw();
  }

  // rest as before

}

and the program output:

**in MyAspect**
in Clazz: hello

which is the expected output.

This test case:

    <ajc-test title="intermediate annotation matching" dir="bugs150">
        <compile files="AnnotationPlusPatternMatchingError.aj" options="-1.5">
            <message kind="warning" line="28" text="matched"/>
        </compile>
        <run class="AnnotationPlusPatternMatchingError">
            <stdout>
                <line text="In advice"/>
            </stdout>
        </run>
    </ajc-test>

with source code as shown below also passes. Is it possible there is
something else going on in your environment?

interface A {
public void a(String s);
}

@Annotation
interface B extends A{}

class C implements B {
   public void a(final String s) {}
}

aspect Aspect{
   pointcut foo(): call(* (@Annotation *)+.*(..));
   declare warning : foo() : "matched"; 
   before() : foo() {
	   System.out.println("In advice");
   }
}

public class AnnotationPlusPatternMatchingError {
	
	public static void main(String[] args) {
		new AnnotationPlusPatternMatchingError().testLtw();
	}
	
	public void testLtw() {
		 B anA = new C();
		 anA.a("hi");
	}
	
}

@interface Annotation {}

On 16/08/05, Valerio Schiavoni <ervalerio@xxxxxxxxxx> wrote:
> a project test case can be downloaded from:
> 
> http://sardes.inrialpes.fr/~valerio/ltwtest.tgz
> 
> it contains all jar files, a build.xml and classes in exams.
> 
> it is not the same in one of my previous posts in this thread.
> 
> hope it helps to spot out the problem.
> 
> 
> Adrian Colyer ha scritto:
> 
> >There wasn't a typo - this one *is* my fault : the parser was failing
> >over on a type pattern of the form (......)+ . I'm just running the
> >suite on a fix and then I'll check it in and the next published dev.
> >build should work as advertised.
> >
> >
> >
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 


-- 
-- Adrian
adrian.colyer@xxxxxxxxx


Back to the top