My favorite Eclipse coding style settings

Source: Internet
Author: User
Tags java format

When using eclipse, there is usually a certain requirement for coding style, usually the most important is the tab and space in Java and XML files, some of the conventions in Java format, and save your common settings on GitHub. Leave a backup: Workspace settings


windows->preferences->general->workspace text file encoding:utf-8 New text file line Delimiter:unix c1> windows->preferences->general->editors->text Editors Select Insert spaces for tabs select Show Print margin (update pring margin column to) Select Show line numbers select Show whitespace characters Gt Preferences->xml->xml Files->editor

For insert whitespace before closing empty end-tags, select Indent using psaces, change size to 4Windows->preferences->java->code Style->formatterClick New, input profile name Click Edit, change Tab policy to spaces only, set Indentation/tab size to 4Windows->preferences->java->editor->save ActionsSelect Perform the selected actions on save Select Format source code format edited lines to old projects and Format al L Ines for new projects Select Addional Actions, click Configure in Code organizing select Remove trailing whitespace select Correct indentation in the Code Style select blocks in if/while/for/do with Always to single return or except select C Onvert ' for ' loops to enhanced select with parentheses in expressions select Use modifier ' final ' where possible select con Vert Funtional interface instances with the use lambda where possible to member Accesses:select user ' this ' qualifier for Fie LD accesses Select user ' this ' qualifier to method accesses select qualify field access and qualify to access in Unne Cessary Code Select Remove Unused Imports Select Remove unused private members Remove unused local variables

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.