Community
Participate
Working Groups
Following small program fails with Exception in thread "main" java.lang.IncompatibleClassChangeError at ....main(MyAnonTester.java:14) --------------snippet-------- import java.lang.annotation.*; import java.lang.reflect.Method; public class MyAnonTester { public static void main(String[] args) { Object o = new MyAnonTester(); for (Method m : o.getClass().getMethods()) { if (m.isAnnotationPresent(MyAnon.class)) { System.out.println(m.getAnnotation(MyAnon.class).c()); } } } @MyAnon(c = MyAnonTester.class) public void foo() {} @Retention(RetentionPolicy.RUNTIME) public @interface MyAnon { Class c(); } }
I will investigate.
The problem came from the invocation of the annotation type member declaration. It requires an invokeinterface bytecode and not an invokevirtual. Fixed and released in HEAD. Regression test added in AnnotationTest.test099()
erified for 3.1 M4 using build I200412142000.