Skip to content

Minor: Address Error prone warnings#749

Merged
regisd merged 21 commits intojflex-de:masterfrom
regisd:error-prone
Mar 28, 2020
Merged

Minor: Address Error prone warnings#749
regisd merged 21 commits intojflex-de:masterfrom
regisd:error-prone

Conversation

@regisd
Copy link
Member

@regisd regisd commented Mar 28, 2020

regisd added 17 commits March 28, 2020 19:50
```
jflex/src/main/java/jflex/generator/Emitter.java:1173: error: [UnnecessaryParentheses] Unnecessary use of grouping parentheses
          println("            case " + (++last) + ": break;");
                                        ^
    (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
  Did you mean 'println("            case " + ++last + ": break;");'?
```
Bump DefaultCharset to error
https://errorprone.info/bugpattern/DefaultCharset

LexScan was already fixed in jflex-de#470
Fix violations when possible
SuppressWarnings otherwise
it's quite controversial and there are tons of violations.
https://errorprone.info/bugpattern/Var
Do not use C-style array declaration.
@regisd regisd requested a review from sarowe as a code owner March 28, 2020 20:32
@regisd regisd self-assigned this Mar 28, 2020
@regisd regisd added the code quality Code health and clean-up label Mar 28, 2020
@regisd regisd merged commit 48787cf into jflex-de:master Mar 28, 2020
regisd pushed a commit that referenced this pull request Mar 28, 2020
commit 48787cf
Author:     Régis Décamps <regisd@google.com>
AuthorDate: Sat Mar 28 21:50:42 2020 +0100
Commit:     GitHub <noreply@github.com>
CommitDate: Sat Mar 28 21:50:42 2020 +0100

    Minor: Address Error prone warnings (#749)

    * Exclude all generated code from error-prone.

    * Remove cup from the XepExcludedPaths
    Follow-up of #734

    * Make fields final.
      https://errorprone.info/bugpattern/FieldCanBeFinal

    * Remove reference equality
      https://errorprone.info/bugpattern/ReferenceEquality

    * Keep UnnecessaryParentheses disabled

    ```
    jflex/src/main/java/jflex/generator/Emitter.java:1173: error: [UnnecessaryParentheses] Unnecessary use of grouping parentheses
              println("            case " + (++last) + ": break;");
                                            ^
        (see https://errorprone.info/bugpattern/UnnecessaryParentheses)
      Did you mean 'println("            case " + ++last + ": break;");'?
    ```

    https://errorprone.info/bugpattern/UnnecessaryParentheses

    * Reenable CatchAndPrintStackTrace

    Nothing to fix

    * Fix DefaultCharset
    Also Replace guava Charsets by java StandardCharsets

    https://errorprone.info/bugpattern/DefaultCharset

    LexScan was already fixed in #470

    * Fix ConstructorInvokesOverridable

    make methods final.
    https://errorprone.info/bugpattern/ConstructorInvokesOverridable

    SuppressWarnings for OptionsDialog.java

    * Add default case to switch statements

    https://errorprone.info/bugpattern/MissingDefault

    * Enable Unused  at ERROR

    Suppress warnings on WIP ucd_generator

    https://errorprone.info/bugpattern/Unused

    * Enable UnusedException as ERROR

    Fix violations when possible
    SuppressWarnings otherwise

    https://errorprone.info/bugpattern/UnusedException

    * Keep Var OFF

    it's quite controversial and there are tons of violations.
    https://errorprone.info/bugpattern/Var

    * Fix MixedArrayDimensions

    Rewrite C-style array declaration.

    https://errorprone.info/bugpattern/MixedArrayDimensions

    * Fix MethodCanBeStatic

    https://errorprone.info/bugpattern/MixedArrayDimensions

    * Fix WildcardImport

    List imports  explicitly

    https://errorprone.info/bugpattern/WildcardImport

Updated from target/jflex-parent-1.9.0-SNAPSHOT-sources.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Code health and clean-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant