Community
Participate
Working Groups
Build Identifier: I20091217-0819 This build of Eclipse 3.6 has problem that was not in 3.5.1. Sometimes it remove empty lines between import groups. This happens during formatting. Reproducible: Always Steps to Reproduce: 1. open compilation unit with empty lines between import groups; 2. do formatting, I use Ctrl+Shift+F 3. note that empty lines were removed. What is interesting: 4. If you have save actions configured, including formatting, then after save (after formatting) these empty lines will be restored! 5. But if you don't do manual formatting and instead just save, then "formatting action on save" also will remove empty lines. Weird!
>1. open compilation unit with empty lines between import groups; >2. do formatting, I use Ctrl+Shift+F >3. note that empty lines were removed. Works fine for me using I20091215-1320. Can you please provide more detailed steps. Try to provide a test case that we can apply on a new workspace. >5. But if you don't do manual formatting and instead just save, then >"formatting action on save" also will remove empty lines. Sounds like a different bug. This bug here is about formatting only.
Created attachment 154836 [details] Source with empty lines Open this file and format it.
Created attachment 154837 [details] Formatting profile
This is a regression introduced while fixing bug 199265. The problem occurs only when a profile set no blank line to preserve (i.e. Blank lines to preserve = 0).
Created attachment 154866 [details] Proposed patch Test also if there are some lines to preserve between groups to know whether a call to getPreserveEmptyLines(int) method is necessary or not...
Released for 3.6M5 in HEAD stream.
Verified for 3.6M5 using Build id: I20100122-0800
Verified.