Bug 54431 - ASTParser should honor set compiler options in all cases
Summary: ASTParser should honor set compiler options in all cases
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 52773
  Show dependency tree
 
Reported: 2004-03-11 04:48 EST by Dirk Baeumer CLA
Modified: 2004-03-24 13:11 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 Dirk Baeumer CLA 2004-03-11 04:48:34 EST
I20040310

Refactoring needs to parse compilation units without the nice extra style 
errors. To do so I used the new ASTParser and set it a modified version of the 
compiler options will all additional compiler settings turned to ignore. But 
the parser ignores these settings when parsing CUs (it always takes the 
settings from the project containing the CU). The parser should honor the set 
settings even in this case.
Comment 1 Olivier Thomann CLA 2004-03-11 16:48:03 EST
I released the right code for ASTParse.create... method.
If you set the new compiler options using setCompilerOptions(...) after you set
the ICompilationUnit. It should do it.
I added TODOs for Jim to update the javadoc and explain that
setSource(ICompilationUnit) also sets the java project and the compiler options.
Give it a try and reopen it if your problem is not fixed.
All tests passed.
Comment 2 Dirk Baeumer CLA 2004-03-22 06:00:45 EST
The ASTParser now correctly remembers the options set via setCompilerOptions, 
these options, but they are not passed to the CompilationUnitResolver.resolve 
method. Hence the resolver is again taking the options from the project.

See code CompilationUnitResolver#resolve and its use in 
ASTParser#internalCreateAST.
Comment 3 Olivier Thomann CLA 2004-03-22 08:47:29 EST
I am investigating.
Comment 4 Olivier Thomann CLA 2004-03-22 10:36:55 EST
Changed the code in CompilationUnitResolver to reuse the compiler options set in
the ASTParser.
Fixed and released in HEAD.
I will write a test case for this one.
Comment 5 Dirk Baeumer CLA 2004-03-23 05:10:35 EST
Should the fix be in I200403230010 ?
Comment 6 Olivier Thomann CLA 2004-03-23 09:06:45 EST
Yes. Do you have a problem with it?
Comment 7 Dirk Baeumer CLA 2004-03-23 18:36:15 EST
No, just wanted to double check since I tested and earlier build.
Comment 8 Olivier Thomann CLA 2004-03-24 10:33:47 EST
Dirk, could you please confirm that it is now working as desired and close as
VERIFIED?
Thanks.
Comment 9 Dirk Baeumer CLA 2004-03-24 13:11:59 EST
Verified