hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-948) Coding style issues
Date Mon, 05 Feb 2007 22:26:06 GMT

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

Doug Cutting commented on HADOOP-948:
-------------------------------------

> Could the "test" target use CheckStyle?

Sure.  We cannot include the checkstyle jar in svn, so it should be optional.

> I notice Apache Jetspeed uses it

Looking at:

http://svn.apache.org/viewvc/portals/jetspeed-1/trunk/build/build.xml?view=markup

Checkstyle looks to be optional and is only used if the developer has independently downloaded
and installed checkstyle.  One could instead make build.xml download checkstyle, but that's
frowned on.

> 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.


Mime
View raw message