Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 422259 - [1.8][dom ast] AST Formatter removes blanks around annotations
Summary: [1.8][dom ast] AST Formatter removes blanks around annotations
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: BETA J8   Edit
Assignee: Manoj N Palat CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 417923
  Show dependency tree
 
Reported: 2013-11-21 10:20 EST by Manoj N Palat CLA
Modified: 2013-11-24 03:22 EST (History)
1 user (show)

See Also:
markus.kell.r: review+


Attachments
Test case (3.45 KB, patch)
2013-11-21 10:22 EST, Manoj N Palat CLA
no flags Details | Diff
Proposed Patch (15.70 KB, patch)
2013-11-22 07:43 EST, Manoj N Palat CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manoj N Palat CLA 2013-11-21 10:20:10 EST
int[] @Annot1 [] = new int[1] @Annot1 [2]; gets reduced to
int[]@Annot1[] = new int[1]@Annot1[2];
Comment 1 Manoj N Palat CLA 2013-11-21 10:22:33 EST
Created attachment 237618 [details]
Test case

Ref: bug 417923 comment 9 point 2
Comment 2 Manoj N Palat CLA 2013-11-22 07:43:38 EST
Created attachment 237643 [details]
Proposed Patch

Fix with additional test cases
Comment 3 Markus Keller CLA 2013-11-22 09:31:50 EST
Looks good, thanks!

CodeFormatterVisitor#formatLeadingDimensions(TypeReference, boolean) and CodeFormatterVisitor#formatDimensions(TypeReference, int, int, boolean)
are now always called with spaceBeforeAnnotation=true.

Both method bodies can just use true instead of spaceBeforeAnnotation, and then we can get rid of the parameters (e.g. via Change Method Signature > Remove).
Comment 4 Manoj N Palat CLA 2013-11-24 03:22:00 EST
(In reply to Markus Keller from comment #3)
> Looks good, thanks!
> 
> CodeFormatterVisitor#formatLeadingDimensions(TypeReference, boolean) and
> CodeFormatterVisitor#formatDimensions(TypeReference, int, int, boolean)
> are now always called with spaceBeforeAnnotation=true.

Thanks Markus. Have incorporated this change and released via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=a3e5b898cb4a20a395dd36117ef5b31b39ed2b46