Summary: | formatter - please special case empty array init | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | paul moore <moopa06> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | P3 | ||
Version: | 3.0 | ||
Target Milestone: | 3.0 M9 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
paul moore
2004-02-21 17:03:08 EST
What is the problem with the current options? Maybe I am being over fussy. The thing that triggered the request was having this line Object result = (foo == null)? new Object[]{} : foo.toArray(); changed to Object result = (foo == null)? new Object[] {} : foo.toArray(); To me that looked pretty wierd I want to treat the empty array init as a special case So I want this to be untouched (or forced) Foo [] foos = new Foo[] { new Foo(x), new Foo(y), } But I also want this to happen Object res = new Object[]{}; not Object res = new Object[] { } The option FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE has been added. It is false by default to preserve existing behavior. Regression tests added. Fixed and released in HEAD. Verified for 3.0M9 |