eclipse's default code style

Because the default code style of eclipse is very impractical, this article gives some personalized settings. 
    The unified code style is convenient for project management, establishes a good environment for the entire team, and reduces reading costs; all strong team collaboration is accumulated bit by bit. 
    This article takes eclipse3.6.2_javaee as an example. It is unclear whether other versions are compatible. 
1. [window]/[preferences]/[Java]/[code style]/[formatter]/[edit] 2. Panel [indentation] tab policy = spaces only  indentation size = 4  tab size = 4  his function is to only apply space indentation, not to use table, which can remove txt recognition problems under different platforms  Select align fields in columns  his function is to its class Defined attribute  3 panel [line wrapping] maximum line width = 400  His function is to prevent the code from wrapping automatically  [method declarations]/[Parameters]  line wrapping policy = wrap all elements, exception first element if not necessary  , select force split, even if line shorter than maxmum width  

 








 






The function of indentation policy = indent on column 
is that when a method is declared, one parameter is a line, especially when a method has more than a dozen parameters in spring mvc, it looks very cool 

. 4 Panel [comments] remove Enable line comment formatting  his The meaning is to remove the formatting of single-line comments  

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326951393&siteId=291194637