Bug 310448

Summary: [formatter] Annotation arguments do not wrap.
Product: [Eclipse Project] JDT Reporter: Maarten Billemont <lhunath>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, jarthana, satyam.kandula
Version: 3.6   
Target Milestone: 3.6 M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Maarten Billemont CLA 2010-04-26 09:34:21 EDT
Build Identifier: 

Declare an annotation on a piece of java syntax, for instance, a type:

@NamedQuery(name = RegistrationUserEntity.listRegUsersWithStatus, query = "SELECT ru FROM RegistrationUserEntity ru WHERE ru.status = :status")
public class RegistrationUserEntity {


When the annotation declaration exceeds the margin, it does not wrap.  I would expect to see this instead:

@NamedQuery(name = RegistrationUserEntity.listRegUsersWithStatus,
            query = "SELECT ru FROM RegistrationUserEntity ru WHERE ru.status = :status")
public class RegistrationUserEntity {

Presumably, a new section should be added to the "Line Wrapping" tab of Formatter Profile settings that deals specifically with annotations.  This section should allow configuration of where to wrap arguments and how to indent them.  I'm uncertain whether the fact that annotation arguments can take an assignment too qualifies it for special treatment.

Reproducible: Always
Comment 1 Frederic Fusier CLA 2010-04-26 10:19:12 EDT
What is your build id? It definitely sounds like a duplicate of bug 282030...
Comment 2 Maarten Billemont CLA 2010-04-27 04:19:32 EDT
Build is I20100129-1300, will try M6.
Comment 3 Frederic Fusier CLA 2010-05-12 07:26:41 EDT
Closing as duplicate, please reopen if you think it's another issue, thx

*** This bug has been marked as a duplicate of bug 282030 ***
Comment 4 Satyam Kandula CLA 2010-05-17 06:17:30 EDT
By setting "Wrap where necessary" for Annotations->Element-value pairs, this works good. 
Verified for 3.6RC1 using build I20100513-150
Comment 5 Jay Arthanareeswaran CLA 2010-05-17 06:20:23 EDT
Verified.