| Summary: | NPE when weaving java.lang.Object at org.aspectj.weaver.bcel.BcelTypeMunger.createAnyBridgeMethodsForCovariance(BcelTypeMunger.java:1251) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] AspectJ | Reporter: | Owen Stephens <owen> | ||||||||
| Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | aclement | ||||||||
| Version: | 1.6.11 | ||||||||||
| Target Milestone: | 1.6.12 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 191424 [details]
Test class
Created attachment 191425 [details]
Aspect with inter-type declaration causing NPE.
Note that this only happens if the compliance level is set to 1.6 or 1.5. The example test case I gave doesn't require this level, but my original code will not compile without it, since it uses generics. I wasn't able to build the sources, but I was able to manually modify the class file, within the jar. I added a null reference check for the createAnyBridgeMethodsForCovariance method, around line 1250 of BcelTypeMunger.java. ajc now compiles the test example correctly. Hi, Sorry I didn't reply sooner. I've put in the null check, I think I've done the same as you have tried out. I don't have a test harness for checking weaving against JDK classes so haven't added a regression test. I've never heard anyone weave into Object like that either, but I guess it is working for you :) Fix will be in 1.6.12. |
Created attachment 191423 [details] AJ core dump I'm trying to add a method to Object using a inter-type declaration. When calling ajc, I encounter a NPE. From a cursory glance, it would appear that the code is looking for the parents classes of Object, which presumably is null. I've attached the dump and a simple example that causes it.