Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 481587

Summary: Unconfigurable settings on Java formatter
Product: [Eclipse Project] JDT Reporter: Jorge Cara <jorgecara88>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, mateusz.matela, Olivier_Thomann
Version: 4.5.1   
Target Milestone: 4.6 M3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Jorge Cara CLA 2015-11-06 08:46:52 EST
I can“t find any configurable option to avoid the insertion of a blankspace between two closing parenthesis for nested annotations:

This code:

@Entity
@Table(name = "PERSON")
public class Person implements Serializable {

    private static final long serialVersionUID = -5902684694675966307L;

    @Column(name = "NAME", nullable = false)
    private String name;

    @Embedded
    @AttributeOverrides({
            @AttributeOverride(name = "city", column = @Column(name = "CITY", nullable = false)),
            @AttributeOverride(name = "country", column = @Column(name = "COUNTRY", nullable = true)),
            @AttributeOverride(name = "houseNo", column = @Column(name = "HOUSE_NO", nullable = true)),
            @AttributeOverride(name = "street", column = @Column(name = "STREET", nullable = true)),
            @AttributeOverride(name = "zipCode", column = @Column(name = "ZIP_CODE", nullable = true))})
    private Address address;
}


Gets formatted like:

@Entity
@Table(name = "PERSON")
public class Person implements Serializable {

    private static final long serialVersionUID = -5902684694675966307L;

    @Column(name = "NAME", nullable = false)
    private String name;

    @Embedded
    @AttributeOverrides({
            @AttributeOverride(name = "city", column = @Column(name = "CITY", nullable = false) ),
            @AttributeOverride(name = "country", column = @Column(name = "COUNTRY", nullable = true) ),
            @AttributeOverride(name = "houseNo", column = @Column(name = "HOUSE_NO", nullable = true) ),
            @AttributeOverride(name = "street", column = @Column(name = "STREET", nullable = true) ),
            @AttributeOverride(name = "zipCode", column = @Column(name = "ZIP_CODE", nullable = true) ) })
    private Address address;
}
Comment 1 Olivier Thomann CLA 2015-11-06 10:27:56 EST
This looks like a bug, not something that should be configurable. Please specify what version of jdt you are using.
Comment 2 Jorge Cara CLA 2015-11-06 10:36:04 EST
(In reply to Olivier Thomann from comment #1)
> This looks like a bug, not something that should be configurable. Please
> specify what version of jdt you are using.

      Eclipse Java Development Tools	3.11.1.v20150904-0015	org.eclipse.jdt.feature.group	Eclipse.org
Comment 3 Jay Arthanareeswaran CLA 2015-11-06 11:03:47 EST
Mateusz, is this something that we changed recently? Please comment on this.
Comment 4 Jorge Cara CLA 2015-11-06 11:17:13 EST
(In reply to Jay Arthanareeswaran from comment #3)
> Mateusz, is this something that we changed recently? Please comment on this.

If it is of any help this used to work on the Eclipse Luna we used before. We moved from Luna to Mars on the 5th of October
Comment 5 Mateusz Matela CLA 2015-11-07 12:37:13 EST
(In reply to Jay Arthanareeswaran from comment #3)
> Mateusz, is this something that we changed recently? Please comment on this.
Not recently, it occurs in 4.5.0 too.

*** This bug has been marked as a duplicate of bug 479819 ***
Comment 6 Mateusz Matela CLA 2015-11-07 14:13:59 EST
Turns out it was fixed in M3

*** This bug has been marked as a duplicate of bug 471203 ***