Bug 90213 - [Formatter] Redundant space in multidimensional array literals
Summary: [Formatter] Redundant space in multidimensional array literals
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-04 15:19 EDT by Alexander Staubo CLA
Modified: 2005-05-13 09:18 EDT (History)
0 users

See Also:


Attachments
Formatter preferences (25.60 KB, text/xml)
2005-04-04 15:20 EDT, Alexander Staubo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.