Skip to content
Snippets Groups Projects
  • Dongjoon Hyun's avatar
    d34d6503
    [SPARK-14868][BUILD] Enable NewLineAtEofChecker in checkstyle and fix lint-java errors · d34d6503
    Dongjoon Hyun authored
    ## What changes were proposed in this pull request?
    
    Spark uses `NewLineAtEofChecker` rule in Scala by ScalaStyle. And, most Java code also comply with the rule. This PR aims to enforce the same rule `NewlineAtEndOfFile` by CheckStyle explicitly. Also, this fixes lint-java errors since SPARK-14465. The followings are the items.
    
    - Adds a new line at the end of the files (19 files)
    - Fixes 25 lint-java errors (12 RedundantModifier, 6 **ArrayTypeStyle**, 2 LineLength, 2 UnusedImports, 2 RegexpSingleline, 1 ModifierOrder)
    
    ## How was this patch tested?
    
    After the Jenkins test succeeds, `dev/lint-java` should pass. (Currently, Jenkins dose not run lint-java.)
    ```bash
    $ dev/lint-java
    Using `mvn` from path: /usr/local/bin/mvn
    Checkstyle checks passed.
    ```
    
    Author: Dongjoon Hyun <dongjoon@apache.org>
    
    Closes #12632 from dongjoon-hyun/SPARK-14868.
    d34d6503
    History
    [SPARK-14868][BUILD] Enable NewLineAtEofChecker in checkstyle and fix lint-java errors
    Dongjoon Hyun authored
    ## What changes were proposed in this pull request?
    
    Spark uses `NewLineAtEofChecker` rule in Scala by ScalaStyle. And, most Java code also comply with the rule. This PR aims to enforce the same rule `NewlineAtEndOfFile` by CheckStyle explicitly. Also, this fixes lint-java errors since SPARK-14465. The followings are the items.
    
    - Adds a new line at the end of the files (19 files)
    - Fixes 25 lint-java errors (12 RedundantModifier, 6 **ArrayTypeStyle**, 2 LineLength, 2 UnusedImports, 2 RegexpSingleline, 1 ModifierOrder)
    
    ## How was this patch tested?
    
    After the Jenkins test succeeds, `dev/lint-java` should pass. (Currently, Jenkins dose not run lint-java.)
    ```bash
    $ dev/lint-java
    Using `mvn` from path: /usr/local/bin/mvn
    Checkstyle checks passed.
    ```
    
    Author: Dongjoon Hyun <dongjoon@apache.org>
    
    Closes #12632 from dongjoon-hyun/SPARK-14868.