Community
Participate
Working Groups
Formatter does not handle nicely the following method source: [public static Compiler getCompiler() { if (compiler == null) { CompilerOptions options = new CompilerOptions(); options.handleImportProblemAsError(false); compiler = new Compiler( null, DefaultErrorHandlingPolicies.proceedWithAllProblems(), options.getConfigurableOptions(Locale.getDefault()), new ICompilerRequestor() { private CompilationResult compilationResult; public void acceptResult(CompilationResult compilationResult) { this.compilationResult = compilationResult; } public CompilationResult retrieveCompilationResult() { return compilationResult; } }, compilerProblemFactory); } return compiler; }] NOTES: OT (7/18/00 2:50:30 PM) What is the expected formatted string of this example? What we get now is: [public static Compiler getCompiler() { if (compiler == null) { CompilerOptions options = new CompilerOptions(); options.handleImportProblemAsError(false); compiler = new Compiler( null, DefaultErrorHandlingPolicies.proceedWithAllProblems(), options.getConfigurableOptions(Locale.getDefault()), new ICompilerRequestor() { private CompilationResult compilationResult; public void acceptResult(CompilationResult compilationResult) { this.compilationResult = compilationResult; } public CompilationResult retrieveCompilationResult() { return compilationResult; } }, compilerProblemFactory); } return compiler; }] This problem is due to the fact that the outputLine methods doesn't remember the number of indentation performed. The following code is considered as a single line which needs to be split. compiler = new Compiler( null, DefaultErrorHandlingPolicies.proceedWithAllProblems(), options.getConfigurableOptions(Locale.getDefault()), new ICompilerRequestor() { But while spitting it, two indentations are performed, and these two identations are not propagate when returning from the outputLine method. Which means that the next input will be indented according to the current indentation of the previous line. Therefore the following block missed two indentations. [private CompilationResult compilationResult; public void acceptResult(CompilationResult compilationResult) { this.compilationResult = compilationResult; } public CompilationResult retrieveCompilationResult() { return compilationResult; } }, compilerProblemFactory);]
Defer
Resurrecting formatter issues in 2.1 stream.
Clearing resolution
*** Bug 11232 has been marked as a duplicate of this bug. ***
We need to clear 2.1 bug reports that won't be addressed before 2.1. The new implementation is still in the works. Therefore we cannot include it for 2.1. Not enough testing and we need to polish the preferences. This will be address for 2.2 as stated in the JDT/Core plan.
*** Bug 37609 has been marked as a duplicate of this bug. ***
Resurrecting for 3.0
Fixed and released in the new formatter. Regression test added.
Verified