Community
Participate
Working Groups
Build ID: M20080911-1700 Steps To Reproduce: 1. Enter the following code to a class @ManyToOne @JoinColumns ({ @JoinColumn (name = "join1", referencedColumnName = "column1"), @JoinColumn (name = "join2", referencedColumnName = "column2") }) private Foo foo; 2. Run code formatter, all formatting is lost. More information: There is no way (that I can see) of setting up the code formatter to format the code to look like this. Can an Annotation section be added to 'Line Wrapping' with options "Keep original wrapping", "Wrap when necessary"? Also, a subsection "Annotations -> Array initializers" with options "Keep original wrapping", "Wrap when necessary", "Wrap first, others when necessary" ... and all others currently under "Expressions -> Array Initializers". Another subsection "Annotations -> String concatenation" with approriate wrapping policies would be useful to format queries embedded within @NamedQuery
Using Eclipse [built-in] profile, the formatter output does not break the formatting of your snippet, it just indent the lines and replace the spaces with tabulations. Could you provide your profile and the corresponding formatter output showing that the formatting is lost? Thanks
Created attachment 126009 [details] Formatter Preferences The attached preferences changes my code to @ManyToOne @JoinColumns ( {@JoinColumn (name = "join1", referencedColumnName = "column1"), @JoinColumn (name = "join2", referencedColumnName = "column2")})
I think the 'Never join lines' would fix your problem (you'll find it on the 'Line Wrapping' preferences tab. Using it on top of your profile, I get the following output for the comment 0 snippet: @ManyToOne @JoinColumns ({ @JoinColumn (name = "join1", referencedColumnName = "column1"), @JoinColumn (name = "join2", referencedColumnName = "column2")}) private String foo; So, I set this bug as duplicate of bug 198074, please reopen if you disagree, thx *** This bug has been marked as a duplicate of bug 198074 ***
Verified for 3.6M1 using I20090803-1800
Verified.