Bug 134625 - Code formatter should distinguish between annotation targets
Summary: Code formatter should distinguish between annotation targets
Status: VERIFIED DUPLICATE of bug 122247
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.4 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-03 17:38 EDT by Nick Veys CLA
Modified: 2008-02-05 09:48 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Veys CLA 2006-04-03 17:38:16 EDT
Currently the formatter only has 2 options for newlines in annotations, one for a newline in an empty tagging annotation, and one for a newline after use of an annotation.

This leads to a scenario where a method can be formatted like this:

@Deprecated
@SuppressWarnings("unchecked")
public void setFoo(@NotNull
Foo foo) {
    this.foo = foo;
}

with the @NotNull broken away from its parameter, or like this:

@Deprecated @SuppressWarnings("unchecked") public void setFoo(@NotNull Foo foo) {
    this.foo = foo;
}

All smashed together.  Neither is very pretty.

It would be better to be able to specify Method annotations to have a newline, and Parameter annotations not to have a newline, to stay with their parameters.  Since different annotations are used in different areas of code, this seems logical.
Comment 1 Markus Keller CLA 2006-09-12 05:04:49 EDT

*** This bug has been marked as a duplicate of 122247 ***
Comment 2 Maxime Daniel CLA 2008-02-05 09:48:08 EST
Verified for 3.4M5 using I20080204-0010 build.