Community
Participate
Working Groups
Build ID: M20080911-1700 Steps To Reproduce: If "Keep empty array initializer on one line" is checked, then "Insert space" "between empty braces" in "array initializers" works as expected. However, if "Keep empty array initializer on one line" is not checked, the space is never inserted. This is true even if "Brace positions" for "Array initializer" is set to "Same line", which grays out the "Keep empty array initializer on one line" check box. (Toggling the "Keep empty array initializer on one line" check box requires first changing the "Array initializer" setting to "Next line", then toggling the check box, then changing back to "Same line".) Array initializer: Same line Keep empty array initializer on one line: no White Space, Array initializers, between empty braces: yes Preview: int[] array0 = new int[] {}; int[] array1 = new int[] { 1, 2, 3 }; int[] array2 = new int[3]; Array initializer: Same line Keep empty array initializer on one line: yes White Space, Array initializers, between empty braces: yes Preview: int[] array0 = new int[] { }; int[] array1 = new int[] { 1, 2, 3 }; int[] array2 = new int[3]; Expected results: The first preview should look identical to the second preview, since the "Keep empty array initializer on one line" option should have no bearing if "Array initializer" is set to "Same line".
Unfortunately, I surely will not have enough time to fix your bug during the 3.5 development process, hence set its priority to P5. Please provide a patch if you definitely need the bug to be fixed in this version and I'll have a look at it... TIA
Fix is trivial. Released for 3.5M3. Added regression test org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests#test719
Verified for 3.5M3 using I20081026-2000.