Community
Participate
Working Groups
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.
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.
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.
I am investigating.
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.
Should the fix be in I200403230010 ?
Yes. Do you have a problem with it?
No, just wanted to double check since I tested and earlier build.
Dirk, could you please confirm that it is now working as desired and close as VERIFIED? Thanks.
Verified