Bug 206911 - java.lang.VerifyError attempting to call super inside ITD method on extension of parameterized class
Summary: java.lang.VerifyError attempting to call super inside ITD method on extension...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 1.6.0 M2   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-19 12:04 EDT by Joshua Caplan CLA
Modified: 2008-02-20 18:38 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Caplan CLA 2007-10-19 12:04:38 EDT
The following code will crash upon execution:

package bugs;

class GenericClass< K > {
          public void f() {}
}
class ExtendsGenericHasITD extends GenericClass< Object > {}

aspect VerifyError {
          public void ExtendsGenericHasITD.f() {
                   super.f();
          }
          public static void main( String[] args ) {
                   new ExtendsGenericHasITD();
          }
}

The error message is:

Exception in thread "main" java.lang.VerifyError: (class: bugs/ExtendsGenericHasITD, method: ajc$superDispatch$bugs_ExtendsGenericHasITD$f signature: ()V) Illegal use of nonvirtual function call
          at bugs.VerifyError.main(ExtendsGenericHasITD.aj:13)

Code runs without error if you change the class declaration to

class ExtendsGenericHasITD extends GenericClass {}
Comment 1 Andrew Clement CLA 2008-01-22 18:49:37 EST
fix committed - thanks for the testcase.  There may be some other bugs lurking in this area but the couple of testcases I've tried are OK...I'm thinking problems will appear when really using type variables in the methods that are being delegated to via super.

The problem here was generating bytecode targetting a parameterized type, when it should have targeted the real type that was being parameterized.

should be in a 1.6.0 dev build shortly.
Comment 2 Andrew Clement CLA 2008-02-20 18:38:12 EST
should of closed this - been fixed for a while!