Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse wrong formatting of Override non-Javadoc
Eclipse wrong formatting of Override non-Javadoc [message #1764020] Wed, 24 May 2017 06:40 Go to next message
Sverre Moe is currently offline Sverre MoeFriend
Messages: 57
Registered: September 2012
Member
Eclipse is messing up code with format

Take this piece of code: This is how eclipse would add the non-Javadoc with ALT+SHIFT+J
            /* (non-Javadoc)
             * @see javafx.util.StringConverter#fromString(java.lang.String)
             */
            @Override
            public Number fromString(String string) {


Try formatting this piece of code and it messes it up: CTRL+SHIFT+F
            /*
             * (non-Javadoc)
             * 
             * @see javafx.util.StringConverter#fromString(java.lang.String)
             */
            @Override
            public Number fromString(String string) {


How can I avoid this? The problem is you get unnecessary whitepace that messes up git diff.

[Updated on: Wed, 24 May 2017 06:42]

Report message to a moderator

Re: Eclipse wrong formatting of Override non-Javadoc [message #1764026 is a reply to message #1764020] Wed, 24 May 2017 08:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
You'd have to change Java Formatter preferences on the Comments tab; probably you don't want "Blank line before Javadoc tags" enabled.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Eclipse wrong formatting of Override non-Javadoc [message #1764028 is a reply to message #1764026] Wed, 24 May 2017 08:21 Go to previous message
Sverre Moe is currently offline Sverre MoeFriend
Messages: 57
Registered: September 2012
Member
That did work, but I only want that behaviour on comments with non-Javadoc.

It wouldn't be so bad I at least I could ommit the whitespace on the empty comment lines. There is no option to ommit these whitespace.

[Updated on: Wed, 24 May 2017 08:33]

Report message to a moderator

Previous Topic:Transfering custom @Interfaces from super function to overriden function
Next Topic:LDAP server startup logs
Goto Forum:
  


Current Time: Fri Apr 19 20:06:16 GMT 2024

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

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

Back to the top