Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 478287

Summary: Formatter: Missing Space in Annotation Type Element for Array Type
Product: [Eclipse Project] JDT Reporter: Robert Reiner <rr>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: mateusz.matela
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Robert Reiner CLA 2015-09-24 05:51:38 EDT
1. Overview
I have a problem formatting an annotation type element of an array type. I'd like to instruct the Eclipse Formatter to insert a space between the type and the name of the element.

So this is what I want:

String[] value();

But all I get is this (no space between the closing square bracket and the element name):

String[]value();

Everything works fine if the type is not an array.


2. Steps to reproduce

Create a Java Annotation with 

String[] value();

Run Autoformat (both Eclipse configurations)


3. Actual Result

String[]value();

(no space between the type and the identifier)


4. Expected Result

String[] value();

(with a space between the type and the identifier)


5. Build Date & Hardware

Mars Release (4.5.0), Build id: 20150621-1200 


7. Additional Builds and Platforms

Reported that it does not fail on 20130919-0819.

See: http://stackoverflow.com/questions/32745485/eclipse-formatter-issue-annotation-type-element-of-array-type


8. Additional Information
This relates to Bug 472962, which is already closed. That issue already mentions the missing space.
Comment 1 Mateusz Matela CLA 2015-09-27 16:51:04 EDT
(In reply to Robert Reiner from comment #0)
> 8. Additional Information
> This relates to Bug 472962, which is already closed. That issue already
> mentions the missing space.

Is there a reason we should look at this again, then? Bug 472962 comment 5 clearly states that missing space in annotation definition issue was solved in that bug. The fix is in 4.5.1, which will be released around next week.
Comment 2 Robert Reiner CLA 2015-09-28 04:09:31 EDT
(In reply to Mateusz Matela from comment #1)
> (In reply to Robert Reiner from comment #0)
> > 8. Additional Information
> > This relates to Bug 472962, which is already closed. That issue already
> > mentions the missing space.
> 
> Is there a reason we should look at this again, then? Bug 472962 comment 5
> clearly states that missing space in annotation definition issue was solved
> in that bug. The fix is in 4.5.1, which will be released around next week.

Sorry! My fault!

I have read that it is fixed in 4.5, but it is obviously fixed in 4.5.1.
Comment 3 Robert Reiner CLA 2015-09-28 04:10:43 EDT

*** This bug has been marked as a duplicate of bug 472962 ***