[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] reopen https://bugs.eclipse.org/bugs/show_bug.cgi?id=98901 ?

Hello,

 

I stumbled across a problem is would categorize into test cases

8 and 9 described here:

 

Must copy annotations to *public* intertype declarations

 

https://bugs.eclipse.org/bugs/show_bug.cgi?id=98901

 

8.  public method on an Interface with declare @method
9.  public annotated method on an Interface

 

With the following test files:

 

// source 1

@Retention(RetentionPolicy.RUNTIME)

@Target(ElementType.METHOD)

public @interface TestAnnotation {

 

            public boolean value() default true;

}

// source 2

public aspect TestAspect {

 

            declare parents: TestClass implements TestInterface;

 

// this also does not work (even when removing annotation in the following ITD)

//          declare @method: public void TestInterface.foo(): @TestAnnotation;

           

            @TestAnnotation

            public void TestInterface.foo() {

                        System.err.println("foo");

            }

}

// source 3

public interface TestInterface {

 

            public void foo();

}

// source 4

public class TestClass {

 

            public static void main(String[] args) throws Exception {

                        // returns null

                        System.err.println(TestClass.class.getMethod("foo").getAnnotation(TestAnnotation.class));

            }

}

 

Declaring the method directly on TestClass works fine. Is this a bug?
Should I reopen 98901?

 

Thank you very much,

Vincenz