Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » code formatter behaviour has changed from Luna to Mars(different code formatter behaviour when using Annotations on Enum types)
code formatter behaviour has changed from Luna to Mars [message #1704932] Mon, 10 August 2015 20:44 Go to next message
Ernesto Guimerans is currently offline Ernesto GuimeransFriend
Messages: 1
Registered: August 2015
Junior Member
I'm getting different formatting outputs when defining Enum types with annotations between Luna and Mars. I work with my own code style formatter template, but even with Eclipse default templates (Eclipse built-in or Java Conventions) behaviour is different between Luna and Mars.

Sample code in Luna:

public enum TestFormatterEnum {

@Translate("Element Type One")
ElementTypeOne,

@Translate("Element Type Two")
ElementTypeTwo,

@Translate("Element Type Three")
ElementTypeThree;

}


Same code in Mars after formatting:

public enum TestFormatterEnum {

@Translate("Element Type One") ElementTypeOne,

@Translate("Element Type Two") ElementTypeTwo,

@Translate("Element Type Three") ElementTypeThree;

}

I'm not able to find an option to customize this with the template editor...

Any advice (different than using comment // at the end of line or disable formatter) appreciated.

Cheers,



Re: code formatter behaviour has changed from Luna to Mars [message #1705341 is a reply to message #1704932] Thu, 13 August 2015 22:04 Go to previous message
Mateusz Matela is currently offline Mateusz MatelaFriend
Messages: 14
Registered: July 2009
Junior Member
The setting you need is New Lines -> Annotations -> Insert new line after type annotations.
In Luna the formatter probably didn't remove the line breaks because of the "Never join already wrapped lines" setting. Now this behavior changed - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=372801 for more details.
Previous Topic:Behavior change when formatting else-if blocks
Next Topic:Cannot use Lambda expressions
Goto Forum:
  


Current Time: Fri Dec 27 03:21:41 GMT 2024

Powered by FUDForum. Page generated in 0.03944 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top