| Summary: | [formatter] Code formatter adds extra whitespace with nested annotations | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Phillip Webb <pwebb> |
| Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mateusz.matela |
| Version: | 4.5.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
|
Description
Phillip Webb
That should read checkstyles `ParenPad` rule I think changing the `handleAnnotation` method of `SpacePreparator` might fix the problem. The lines: ASTNode parent = node.getParent(); if (!(parent instanceof Annotation) && !(parent instanceof ArrayInitializer)) this.tm.lastTokenIn(node, -1).spaceAfter(); To: ASTNode parent = node.getParent(); if (!(parent instanceof Annotation) && !(parent instanceof MemberValuePair) && !(parent instanceof ArrayInitializer)) this.tm.lastTokenIn(node, -1).spaceAfter(); I'd be happy to submit a pull request unfortunately I can't work out how to build jdt from source. I tried following https://wiki.eclipse.org/JDT_UI/How_to_Contribute but the Maven build fails due to a missing parent POM. I can't work out what I'm supposed to checkout to fix that. (In reply to Phillip Webb from comment #2) > I'd be happy to submit a pull request unfortunately I can't work out how to > build jdt from source. I tried following > https://wiki.eclipse.org/JDT_UI/How_to_Contribute but the Maven build fails > due to a missing parent POM. I can't work out what I'm supposed to checkout > to fix that. Just fixed an older bug that included this problem, but I appreciate the thought. When I was starting with the formatter, I followed https://wiki.eclipse.org/JDT_Core_Committer_FAQ and there were no problems with Maven. Hope this helps. *** This bug has been marked as a duplicate of bug 471203 *** |