Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-432

Enforce writing space after if statement

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.0, 1.4.0-incubating
    • Fix Version/s: 1.4.1-incubating
    • Component/s: None
    • Labels:
      None

      Description

      We're currently not enforcing (=~ "ant checkstyle" is not enforcing) writing space after if statement even though we're using such code policy in the code. Would be nice if the policy would be enforced to be consistent across entire code base.

      1. SQOOP-432.patch
        13 kB
        Joseph Boyd

        Activity

        Hide
        jboyd963 Joseph Boyd added a comment -

        Almost have a patch ready for this.

        Show
        jboyd963 Joseph Boyd added a comment - Almost have a patch ready for this.
        Hide
        jboyd963 Joseph Boyd added a comment -

        Attached patch adds WhitespaceAround module [1] config to checkstyle, configured only to enforce space around if literals.

        Patch also updates 30 or so checkstyle failures from this new rule.

        [1] http://checkstyle.sourceforge.net/config_whitespace.html

        Show
        jboyd963 Joseph Boyd added a comment - Attached patch adds WhitespaceAround module [1] config to checkstyle, configured only to enforce space around if literals. Patch also updates 30 or so checkstyle failures from this new rule. [1] http://checkstyle.sourceforge.net/config_whitespace.html
        Hide
        jboyd963 Joseph Boyd added a comment -

        patch adding checkstyle rule.

        Show
        jboyd963 Joseph Boyd added a comment - patch adding checkstyle rule.
        Hide
        bleeapache Bilung Lee added a comment -

        Thanks for the patch, Joseph! Could you please submit your patch through review board (http://reviews.apache.org) for review? Thanks!

        Show
        bleeapache Bilung Lee added a comment - Thanks for the patch, Joseph! Could you please submit your patch through review board ( http://reviews.apache.org ) for review? Thanks!
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Hi Joseph,
        thank you very much for taking care of this issue. Would you mind to upload your patch to review board for review?

        Jarcec

        Show
        jarcec Jarek Jarcec Cecho added a comment - Hi Joseph, thank you very much for taking care of this issue. Would you mind to upload your patch to review board for review? Jarcec
        Hide
        jiraposter@reviews.apache.org jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/3645/
        -----------------------------------------------------------

        Review request for Bilung Lee and Jarek Cecho.

        Summary
        -------

        Patch for SQOOP-432

        https://issues.apache.org/jira/browse/SQOOP-432

        This addresses bug SQOOP-432.
        https://issues.apache.org/jira/browse/SQOOP-432

        Diffs


        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/cli/SqoopParser.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/hive/TableDefWriter.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBConfiguration.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBInputFormat.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBRecordReader.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBRecordReader.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/OracleDBRecordReader.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/ClassWriter.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/ImportTool.java 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/checkstyle.xml 1236344
        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java 1236344

        Diff: https://reviews.apache.org/r/3645/diff

        Testing
        -------

        'ant checkstyle' returns no errors after the changes in the patch.

        Thanks,

        Joseph

        Show
        jiraposter@reviews.apache.org jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/3645/ ----------------------------------------------------------- Review request for Bilung Lee and Jarek Cecho. Summary ------- Patch for SQOOP-432 https://issues.apache.org/jira/browse/SQOOP-432 This addresses bug SQOOP-432 . https://issues.apache.org/jira/browse/SQOOP-432 Diffs http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/cli/SqoopParser.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/hive/TableDefWriter.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBConfiguration.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBInputFormat.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBRecordReader.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBRecordReader.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/OracleDBRecordReader.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/ClassWriter.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/ImportTool.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/checkstyle.xml 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java 1236344 Diff: https://reviews.apache.org/r/3645/diff Testing ------- 'ant checkstyle' returns no errors after the changes in the patch. Thanks, Joseph
        Hide
        jboyd963 Joseph Boyd added a comment -
        Show
        jboyd963 Joseph Boyd added a comment - Up for review at https://reviews.apache.org/r/3645/
        Hide
        jiraposter@reviews.apache.org jiraposter@reviews.apache.org added a comment -

        -----------------------------------------------------------
        This is an automatically generated e-mail. To reply, visit:
        https://reviews.apache.org/r/3645/#review4642
        -----------------------------------------------------------

        Ship it!

        • Bilung

        On 2012-01-26 22:01:20, Joseph Boyd wrote:

        -----------------------------------------------------------

        This is an automatically generated e-mail. To reply, visit:

        https://reviews.apache.org/r/3645/

        -----------------------------------------------------------

        (Updated 2012-01-26 22:01:20)

        Review request for Bilung Lee and Jarek Cecho.

        Summary

        -------

        Patch for SQOOP-432

        https://issues.apache.org/jira/browse/SQOOP-432

        This addresses bug SQOOP-432.

        https://issues.apache.org/jira/browse/SQOOP-432

        Diffs

        -----

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/cli/SqoopParser.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/hive/TableDefWriter.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBConfiguration.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBInputFormat.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBRecordReader.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBRecordReader.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/OracleDBRecordReader.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/ClassWriter.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/ImportTool.java 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/checkstyle.xml 1236344

        http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java 1236344

        Diff: https://reviews.apache.org/r/3645/diff

        Testing

        -------

        'ant checkstyle' returns no errors after the changes in the patch.

        Thanks,

        Joseph

        Show
        jiraposter@reviews.apache.org jiraposter@reviews.apache.org added a comment - ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/3645/#review4642 ----------------------------------------------------------- Ship it! Bilung On 2012-01-26 22:01:20, Joseph Boyd wrote: ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/3645/ ----------------------------------------------------------- (Updated 2012-01-26 22:01:20) Review request for Bilung Lee and Jarek Cecho. Summary ------- Patch for SQOOP-432 https://issues.apache.org/jira/browse/SQOOP-432 This addresses bug SQOOP-432 . https://issues.apache.org/jira/browse/SQOOP-432 Diffs ----- http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/cli/SqoopParser.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/hive/TableDefWriter.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBConfiguration.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBInputFormat.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBRecordReader.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBRecordReader.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/OracleDBRecordReader.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/ClassWriter.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/ImportTool.java 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/checkstyle.xml 1236344 http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java 1236344 Diff: https://reviews.apache.org/r/3645/diff Testing ------- 'ant checkstyle' returns no errors after the changes in the patch. Thanks, Joseph
        Hide
        bleeapache Bilung Lee added a comment -

        Thanks, Joseph! Patch committed.

        Show
        bleeapache Bilung Lee added a comment - Thanks, Joseph! Patch committed.
        Hide
        hudson Hudson added a comment -

        Integrated in Sqoop-ant-jdk-1.6 #80 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6/80/)
        SQOOP-432. Enforce writing space after if statement

        blee : http://svn.apache.org/viewvc/?view=rev&rev=1236496
        Files :

        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/cli/SqoopParser.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/hive/TableDefWriter.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBConfiguration.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBInputFormat.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBRecordReader.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBRecordReader.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/OracleDBRecordReader.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/ClassWriter.java
        • /incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/ImportTool.java
        • /incubator/sqoop/trunk/src/test/checkstyle.xml
        • /incubator/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java
        Show
        hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6 #80 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6/80/ ) SQOOP-432 . Enforce writing space after if statement blee : http://svn.apache.org/viewvc/?view=rev&rev=1236496 Files : /incubator/sqoop/trunk/src/java/org/apache/sqoop/cli/SqoopParser.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/hive/TableDefWriter.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/DataDrivenImportJob.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBConfiguration.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBInputFormat.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBOutputFormat.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DBRecordReader.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBRecordReader.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/mapreduce/db/OracleDBRecordReader.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/AvroSchemaGenerator.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/orm/ClassWriter.java /incubator/sqoop/trunk/src/java/org/apache/sqoop/tool/ImportTool.java /incubator/sqoop/trunk/src/test/checkstyle.xml /incubator/sqoop/trunk/src/test/com/cloudera/sqoop/TestAvroImport.java

          People

          • Assignee:
            jboyd963 Joseph Boyd
            Reporter:
            jarcec Jarek Jarcec Cecho
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development