Summary: | Declare parents fails on interfaces on the inpath depending on directory structure | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Jaime Metcher <jmetcher> | ||||
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | aclement | ||||
Version: | 1.7.0 | ||||||
Target Milestone: | 1.8.9 | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Jaime Metcher
2014-04-23 22:43:15 EDT
Created attachment 242263 [details]
testcase
I actually dug into this a bit and distilled out the first of the issues. I have these files (thanks for the test code!): InterfaceProj1.java ==== package test; public interface InterfaceProj1<T> { public abstract int aMethod(); } ==== Extender.aj ==== package test.extender; import test.*; public aspect Extender { declare parents: InterfaceProj1 extends InterfaceProj2; } ==== InterfaceProj2.java ==== package test.extender; public interface InterfaceProj2<T> { public abstract int bMethod(); } ==== I compile a jar: ajc -1.5 InterfaceProj1.java -outjar code.jar I then apply the aspect: ajc -1.5 -showWeaveInfo Extender.aj InterfaceProj2.java -inpath code.jar -d output 1.6.10 produces: Extending interface set for type 'test.InterfaceProj1' (InterfaceProj1.java) to include 'test.extender.InterfaceProj2' (Extender.aj) 1.7 does not produce that message, and neither does 1.8. And this does not happen if InterfaceProj1 is not generic. This pointed me to the problem and I just committed a fix. I think there are further issues so am continuing to look at it. Two more issues came out of the test code. Both related to ordering and whether the weaver was processing ClassProj1 before InterfaceProj1. If it saw ClassProj1 first it would see InterfaceProj1<T> as the super type, process it (badly) and then fail to do the right thing for the real InterfaceProj1 (raw type). I have fixes for these things but they are a bit serious and I don't want to damage 1.8.1 unnecessarily since that release is primarily about improving the java8 support. So I'll stuff them in a branch until i get a chance to revisit (bug433351 branch). After Jaime reminded me, I've dug up the branch and moved the test cases and fixes from it into the mainline, will be in 1.8.9. I'm still a *little* nervous since it disturbs a key hierarchy weaving algorithm, but these changes pass all the existing tests and the new tests. |