Community
Participate
Working Groups
The "Default" profile should not be the default. This profile isn't helpful. We need good out of the box formatter settings. Suggestions: * out of the box use the Java Conventions profile * can we remove the "Default" profile? (CCing Dirk since changing the default formatter settings affects the refactoring junit tests)
The default profile uses the previous default settings. This was done to keep some settings from the previous formatter. From my point of view, it is too late to change this now. Most of the refactoring tests would be affected. This should be reported earlier in the process.
Both Dirk and I agree that this change is important for an improved out of the box experience. Dirk even considers it critical and he would be willing to update the test cases. Please consider it for RC2
I don't see why this is suddenly critical. This has been like this since M6. So why this is critical? I will try to see how many failures I get by changing this. Note that the changes could be done only on the UI side. If you set a set of options the default one is not used. You can set the default options to be the Java conventions settings.
Ok, the default JavaCore options are affected by this. So at least the JavaCore default options need to be updated if we want to change this.
Add CC'
Created attachment 11546 [details] Failures in JDT/Core tests This is a list of the failures in JDT/Core tests (mostly AST rewriting tests). I will run the latest JDT/UI tests.
Created attachment 11550 [details] Failures in the JDT/UI refactoring tests We have 187 failures in the JDT/UI refactorings tests. I am clearly against such a change that late in the game.
Created attachment 11551 [details] Failures in JDT/UI tests 29 failures in the JDT/UI tests.
Created attachment 11555 [details] Patch to apply on HEAD
Wonder if #getDefaultSettings() shouldn't be renamed then, if this isn't the default anymore... I approve the change, though agree it is a bit late in the game, but reasonable if broken clients are requesting it.
getDefaultSettings() is an API. Not sure we can change that.
Created attachment 11567 [details] Patch for the formatter tests There are more than 200 tests to fix.
I made some changes to the Java convention settings. this.keep_guardian_clause_on_one_line = false; this.keep_simple_if_on_one_line = false; These were set to true before.
I also would like to change: this.blank_lines_before_first_class_body_declaration = 1; to: this.blank_lines_before_first_class_body_declaration = 0; This looks nicer for anonymous classes. This concerns some JDT/UI tests. Checking the code conventions, this is not clearly specified. I should also add a blank like before all block and line commments, but this would require too many changes.
With these changes we might need to update less tests. Let me know what you want.
Created attachment 11594 [details] Apply on top of version v_436 That patch sets the Java conventions to be the default for the Java Code options. It also the three changes.
*** Bug 51959 has been marked as a duplicate of this bug. ***
Created attachment 11659 [details] Also fixed javadoc for 3.0.
The class in question, DefaultCodeFormatterConstants, also has a number of deprecated constants and methods. Since this class was new for 3.0, there is no good reason why it should be released with extraneous API. In addition to renaming getDefaultOptions() to getEclipse21Options() to better reflect what it does, the deadwood should also be trimmed.
Created attachment 11664 [details] Patch to apply on HEAD Last set of changes for this bug. - Renamed getDefaultSettings() to getEclipse21Settings() - Updated some javadoc - Removed all deprecated constants that were added for 3.0 I will attach another patch for the test suite.
Jim, It is not getEclipse21Options(), but getEclipse21Settings().
The likelihood of a party other than JDT and its test suites using this class is low. API cleanup of DefaultCodeFormatterConstants approved for 3.0 RC2.
Ok for RC2.
Fixed and released in HEAD. Updated test cases.
Olivier, I hope this doesn't go into the build yet. We agreed on last Friday that we have to coordinate the release since otherwise JDT/UI test cases will fail. I am currently fixing our tests.
I simply released the code in HEAD. That doesn't mean it will go inside next build.
Adapted the JDT/UI test cases to new default settings. The test cases are now independent from the default settings (they create their own default test settings; see bug 66048). The adapted test cases go into build I20040608_1200.
Verified for 3.0RC2