Bug 164288 - Can no longer compile JDK 1.5 projects with apsectj for JDeveloper
Summary: Can no longer compile JDK 1.5 projects with apsectj for JDeveloper
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.5.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 1.5.3   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL: http://jdeveloperaop.dev.java.net
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-13 04:04 EST by Gerard Davison CLA
Modified: 2012-04-03 15:28 EDT (History)
1 user (show)

See Also:


Attachments
patch containing proposed fix and testcases (8.46 KB, patch)
2006-11-13 10:06 EST, Helen Beeken CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerard Davison CLA 2006-11-13 04:04:24 EST
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.
Comment 1 Helen Beeken CLA 2006-11-13 06:41:35 EST
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.
Comment 2 Helen Beeken CLA 2006-11-13 10:06:00 EST
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.
Comment 3 Gerard Davison CLA 2006-11-13 14:45:40 EST
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.
Comment 4 Helen Beeken CLA 2006-11-14 03:33:51 EST
Gerard, thanks for testing out the proposed fix :-)
Comment 5 Andrew Clement CLA 2006-11-17 08:51:07 EST
patches in.
Comment 6 Andrew Clement CLA 2006-11-17 08:51:40 EST
iplog!
Comment 7 Andrew Clement CLA 2006-11-20 10:40:06 EST
fix in latest dev builds