Community
Participate
Working Groups
I am working with AspectJ 1.5.2 in JDeveloper and have found that it is not possible to convince the compiler to use JDK 5 constructs. It appears that there is a method on AjcBuildOptions called getJavaOptionsMap() which is currently implemented to return null in all cases. In CompilerAdapter.configureBuildOptions areound line 358 the code tried to access this object to access whether to use JDK 5 constructs or not. Since the return value is always null the project is never properly configured. I notice that the only other implementation of the root interface is CoreBuildOption which appears to directly return a structure from the eclipse class JavaProject. It would appear that this interface is breaking the rules on abstraction, is this the correct read on the situation? If so the solution would either be to implement a CoreBuildOption class to correctly work with the ADJE project adapter class or alter the code in Compiler adapter to correct use the properties in project adapter. I think that the latter is probably the best as BuildOption assumes a depedency on Eclipse which shouldn't be there. We do currently have customer, one in nato, who are currently having to work around this issue so it would be good to get it resolve for 1.5.3 if possible But I know I am a bit late for that now do to a lost email.
Yes, it seems that the default compliance level is 1.4 if this is set by the implementation of BuildOptionsAdapter.getComplianceLevel(). It's not completely ignored if the BuildOptionsAdapter.getSourceLevel() returns 1.5, however, I believe this also doesn't set up the environment correctly. The fix is to update the implementation within CompilerAdapter to cope with 1.5. Regarding your interface comments...as you are probably aware the interface tools are expected to use to invoke the compiler has evolved over time which has meant that it is not as "clean" as it perhaps should be. There is currently an enhancement (bug 148190) to look into this. Please add any comments etc. to that bug.
Created attachment 53745 [details] patch containing proposed fix and testcases Apply this patch to the ajde project. As mentioned, the fix is to update CompilerAdapter.configureBuildOptions() to manage setting the compliance and source level to be 1.5 directly rather than via the javaOptionsMap. The implementation assumes that if compliance level is set to be 1.5 and source level is set to be 1.4 then everything is 1.5 (effectively, the 1.4 is ignored). It may be that we want to police this and provide an error/warning rather than just going ahead and doing the changes. However, this is the way it worked with 1.4/1.3 levels. Moreover, given that we have bug 148190 I don't think it's worth changing this now.
Tested, and verified that fix resolves my bug. I have uncovered another problem with the -1.5 not working for LTW using the class loader on a JDK 6; but I try to will raise another bug for this.
Gerard, thanks for testing out the proposed fix :-)
patches in.
iplog!
fix in latest dev builds