Community
Participate
Working Groups
It seems that something is wrong with space 'after opening brace', 'before closing brace' and 'between empty braces'. Here's the initial test case I wrote: public class Bug49361 { public static void main(String [ ] args) { int[] table = new int [] {1,2,3}; int[] empty = new int [] {}; } } which is the same than with the three options unset. 1) Format with (fix of the bug 49361): 'after opening brace' = OFF 'before closing brace' = OFF 'between empty braces' = ON I got one changed line: int[] empty = new int[] { }; => OK 2) Format with: 'after opening brace' = OFF 'before closing brace' = ON 'between empty braces' = OFF I got two changed lines: int[] table = new int[] {1,2,3 }; int[] empty = new int[] { }; => OK? 3) Format with: 'after opening brace' = ON 'before closing brace' = OFF 'between empty braces' = OFF I got only one changed line: int[] table = new int[] { 1,2,3}; => KO? If we consider that 2nd format is correct, then I would expect for the 3rd one: int[] empty = new int[] { }; instead of: int[] empty = new int[] {}; The other possibility is that 2nd format was incorrect and should have produced: int[] empty = new int[] {}; instead of: int[] empty = new int[] { }; Then 3rd one would be correct... At least it seems that there's some inconsistency here, isn't there?
This is trivial to fix.
The second case is incorrect. The empty array initializer should not have a whitespace. The third case is correct.
Fix is ready. Regression tests added.
Fixed and released in HEAD. Regression tests added.
Verified in 200402121200.