Bug 80571 - ClassFormatError due to implementing methods in Interface
Summary: ClassFormatError due to implementing methods in Interface
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.0 M3   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-09 00:42 EST by Masashi Takeichi CLA
Modified: 2008-10-30 13:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Masashi Takeichi CLA 2004-12-09 00:42:39 EST
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,
Comment 1 Adrian Colyer CLA 2005-03-23 09:08:11 EST
this must be fixed in the aj5m3 release
Comment 2 Adrian Colyer CLA 2005-08-20 05:29:44 EDT
compiles and runs happily with no ClassFormatError using the latest ajc.
Comment 3 Andrew Clement CLA 2008-10-30 13:46:50 EDT
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