Bug 262517 - [ast rewrite] Whitespace settings in formatter ignored when adding annotation
Summary: [ast rewrite] Whitespace settings in formatter ignored when adding annotation
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-27 04:43 EST by Timothy Mowlem CLA
Modified: 2009-03-10 09:48 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix (4.64 KB, patch)
2009-01-30 06:58 EST, David Audel CLA
no flags Details | Diff
JDTUI tests patch (949 bytes, patch)
2009-02-02 04:38 EST, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Mowlem CLA 2009-01-27 04:43:55 EST
Build ID: 3.4M4

Steps To Reproduce:
1. Open Preferences
2. Create your own format under Java->Code Style->Formatter
3. Click the WhiteSpace tab
4. Under Declarations->Annotations check the before opening parentheses option
5. Save and close
6. Now in the java editor create a statement which produces a warning for say deprecated
7. Choose Cmd+1 for Quick Fix and choose the "Add suppress warnings" autofix option
8. Annotation is added but the whitespace option you set is ignored

More information:
Comment 1 David Audel CLA 2009-01-30 06:58:42 EST
Created attachment 124257 [details]
Proposed fix

With this patch ASTRewriteFormatter#formatNode() is able to format annotations.
Comment 2 David Audel CLA 2009-02-02 04:38:05 EST
Created attachment 124396 [details]
JDTUI tests patch

LocalCorrectionsQuickFixTest#testMissingAnnotationAttributes_bug179316() fails with the fix and should be corrected.
This patch updates this test.
Comment 3 David Audel CLA 2009-02-02 04:53:20 EST
Released for 3.5M6.

Released JDTCore patch and added test
  ASTRewritingTypeDeclTest#testSingleMemberAnnotation1()
Comment 4 Markus Keller CLA 2009-02-02 05:03:18 EST
Released JDT/UI test patch.
Comment 5 Olivier Thomann CLA 2009-03-10 09:48:15 EDT
Verified for 3.5M6 using I20090310-0100.