Bug 216541 - [preferences] add support to handle parameter annotations
Summary: [preferences] add support to handle parameter annotations
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Benno Baumgartner CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 122247
Blocks:
  Show dependency tree
 
Reported: 2008-01-25 01:04 EST by Eric Jodet CLA
Modified: 2008-02-04 04:13 EST (History)
1 user (show)

See Also:


Attachments
[patch] - proposed fix (3.25 KB, patch)
2008-01-25 01:04 EST, Eric Jodet CLA
no flags Details | Diff
fix (10.05 KB, patch)
2008-02-04 04:11 EST, Benno Baumgartner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Jodet CLA 2008-01-25 01:04:44 EST
Created attachment 87835 [details]
[patch] - proposed fix

Version: 3.4.0
Build id: I20080122-1600

jdt.ui side of bug 122247.

Please be aware that fix for bug is about to be integrated into HEAD stream.
New formatting preference (DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ARG_ANNOTATION)
is to be added and should be picked-up in the Code Formatter pref page (new line tab).

Attached is a contributed proposal patch in order to add the new pref.
Comment 1 Eric Jodet CLA 2008-01-25 04:40:14 EST
fix for bug 122247 released in HEAD
Comment 2 Dani Megert CLA 2008-01-25 04:44:01 EST
Benno, please take care of this.
Comment 3 Benno Baumgartner CLA 2008-01-25 08:58:41 EST
Eric, I don't understand, what are the expected results? Here is what I get

Given:
@Deprecated public void bar(@SuppressWarnings("unused") int i) {
}

1. 
New line after annotation= true
New line after parameter annotation= true
Is:
@Deprecated 
public void bar(@SuppressWarnings("unused") 
int i) {
}
Expected:
as expected

2. 
New line after annotation= true
New line after parameter annotation= false
Is:
@Deprecated 
public void bar(@SuppressWarnings("unused") 
int i) {
}
Expected:
?

3.
New line after annotation= false
New line after parameter annotation= true
Is:
@Deprecated public void bar(@SuppressWarnings("unused") int i) {
}
Expected:
?

4.
New line after annotation= false
New line after parameter annotation= false
Is:
@Deprecated public void bar(@SuppressWarnings("unused") int i) {
}
Expected:
as expected
Comment 4 Eric Jodet CLA 2008-01-28 00:59:55 EST
(In reply to comment #3)
> 2. 
> New line after annotation= true
> New line after parameter annotation= false
> Is:
> @Deprecated 
> public void bar(@SuppressWarnings("unused") 
> int i) {
> }
> Expected:
public class X {
  @Deprecated
  public void bar(@SuppressWarnings("unused") int i) {
  }
}
> 3.
> New line after annotation= false
> New line after parameter annotation= true
> Is:
> @Deprecated public void bar(@SuppressWarnings("unused") int i) {
> }
> Expected:
public class X {
   @Deprecated public void bar(@SuppressWarnings("unused")
   int i) {
 }
}
Comment 5 Eric Jodet CLA 2008-01-28 01:01:57 EST
(In reply to comment #3)
Benno,
as per expected behavior for settings 2 and 3, fix for bug 122247 will be modified this morning.
I'll let you know when done.
Thanks for pointing out these gaps.
Comment 6 Eric Jodet CLA 2008-01-28 11:12:30 EST
(In reply to comment #5)
Benno: new code for bug 122247 uploaded to HEAD.
New constant is now: FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER
Comment 7 Benno Baumgartner CLA 2008-02-04 04:11:46 EST
Created attachment 88743 [details]
fix
Comment 8 Benno Baumgartner CLA 2008-02-04 04:13:29 EST
fixed > I20080129-1400