[ 
https://issues.apache.org/jira/browse/HADOOP-948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471789
 ] 

David Bowen commented on HADOOP-948:
------------------------------------

The rest of the metrics package also uses 4-space indentation.  It would not be 
useful to change just one method in one class to use the Hadoop 2-space 
indentation convention - the whole package should be changed at once.  At the 
same time, the excess carriage-return characters that got in there should be 
removed, but there shouldn't be any code changes.

Alternatively, we could consider switching hadoop over to the de-facto industry 
standard which is a 4-space indentation.  


> Coding style issues 
> --------------------
>
>                 Key: HADOOP-948
>                 URL: https://issues.apache.org/jira/browse/HADOOP-948
>             Project: Hadoop
>          Issue Type: Bug
>          Components: metrics
>            Reporter: David Bowen
>            Priority: Minor
>         Attachments: hadoop-948.patch
>
>
> I would like to recommend some mainly stylistic changes in the recent fix of 
> http://issues.apache.org/jira/browse/HADOOP-886.  The file in question is 
> CodeFactory.java, and the reasons for the changes are:
>    * It is generally preferable to avoid multiple return statements.
>    * It is nearly always preferable to use curly braces and a newline after 
> an if (condition).
>    * There's no benefit to doing the hash lookup twice in the common case (by 
> calling contains and then get).
> (1) and (2) are commonly found in Java coding style guidelines as they make 
> the code more readable. 
> I'll attach the fix shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to