Community
Participate
Working Groups
When TestAspect is weaved into TestIF, ClassFormatError occurs in runtime. aspectJ's weaver weaves a implemented method into TestIF in order to hook the event of TestObj's constructor call. [ERROR] java.lang.ClassFormatError: TestIF (Illegal method modifiers:0x1A) [Sample Application] public interface TestIF{ public final String NAME = "TestIF"; public TestObj testObj = new TestObj(); } public class TestObj{ public TestObj(){} } public aspect TestAspect{ Object around() : call(*.new(..)){ System.out.println("before"); Object ret = proceed(); System.out.println("after"); return ret; } } Regards,
this must be fixed in the aj5m3 release
compiles and runs happily with no ClassFormatError using the latest ajc.
not quite... the testcode doesn't actually cause the interface I to be verified when it is run - if it did we would see method bodies have been generated into it. Now I've fixed this so it cant happen, the test is failing with the new xlint I added for bug 163005