Bug 90213

Summary: [Formatter] Redundant space in multidimensional array literals
Product: [Eclipse Project] JDT Reporter: Alexander Staubo <zaphod>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Formatter preferences none

Description Alexander Staubo CLA 2005-04-04 15:19:04 EDT
For example:

      int[] a = new int[][] {{1}};

is formatted as:

      int[] a = new int[][] { {1}};

even when no such formatting preference has been set.

Confirmed in Eclipse 3.1M5a, 3.1M6.
Comment 1 Alexander Staubo CLA 2005-04-04 15:20:08 EDT
Created attachment 19520 [details]
Formatter preferences
Comment 2 Olivier Thomann CLA 2005-04-05 10:29:45 EDT
The problem comes from the fact that the option to insert a space before the
opening brace in the array initializer is colliding with the option that inserts
a space after opening brace in array initializer.
They collide for the inner array initializer.
Comment 3 Olivier Thomann CLA 2005-04-05 10:32:39 EDT
Fixed and released in HEAD.
Regression tests added in FormatterRegressionTests.test572/573.
Comment 4 Alexander Staubo CLA 2005-04-05 10:52:12 EDT
That was quick. Thank you.
Comment 5 Olivier Thomann CLA 2005-04-05 10:58:53 EDT
Let me know if you find any problems once you use a build that contains this fix.
Comment 6 Maxime Daniel CLA 2005-05-13 06:25:48 EDT
Verified for 3.1 M7 using build I20050512-2035 + jdt.core HEAD.