Bug 93727 - Code Formatter fails with Method Parameter Annotations
Summary: Code Formatter fails with Method Parameter Annotations
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-04 17:43 EDT by Geoffrey Wiseman CLA
Modified: 2005-05-12 13:41 EDT (History)
0 users

See Also:


Attachments
Apply on HEAD on CodeFormatterVisitor (1.26 KB, patch)
2005-05-11 15:17 EDT, Olivier Thomann CLA
no flags Details | Diff
Apply on HEAD on org.eclipse.jdt.core.tests.model (3.24 KB, patch)
2005-05-11 15:18 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Wiseman CLA 2005-05-04 17:43:55 EDT
The eclipse code formatter doesn't seem to work when you have methods with
parameter annotations.  It fails silently, and I don't see an error in
<Workspace>/.metadata/.log.

Example:
import org.drools.semantics.annotation.DroolsParameter;

public class Test
{
  public Object passthrough( @DroolsParameter("parameter") Object parameter ) {
    return parameter;
  }
}
Comment 1 Tom Hofmann CLA 2005-05-05 04:56:33 EDT
moving to core
Comment 2 Olivier Thomann CLA 2005-05-11 15:14:52 EDT
Now we would format like this:

public class Test
{
  public Object passthrough(@DroolsParameter("parameter")
  Object parameter ) {
    return parameter;
  }
}

The default option is to add a new line after an annotation.
Comment 3 Olivier Thomann CLA 2005-05-11 15:17:12 EDT
Created attachment 21001 [details]
Apply on HEAD on CodeFormatterVisitor
Comment 4 Olivier Thomann CLA 2005-05-11 15:18:39 EDT
Created attachment 21002 [details]
Apply on HEAD on org.eclipse.jdt.core.tests.model

Corresponding regression test
Comment 5 Olivier Thomann CLA 2005-05-11 22:45:34 EDT
Fixed and released in HEAD.
Regression test added in
org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test575.
Comment 6 David Audel CLA 2005-05-12 13:41:41 EDT
Verified in N200505120010