Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-948

Coding style issues

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 0.12.0
    • Component/s: metrics
    • Labels:
      None

      Description

      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.

        Attachments

        1. hadoop-948.patch
          3 kB
          David Bowen

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dbowen David Bowen
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: