Menu

#1906 [PATCH] Added missing final for variable with anonymous class

Latest SVN
closed
RBRi
None
5
2017-07-29
2017-07-29
Richard
No

This patch is being created because of violations found in CheckStyle's regression of HtmlUnit during implementation of a bug fix.
PR: https://github.com/checkstyle/checkstyle/pull/4736
Issue: https://github.com/checkstyle/checkstyle/issues/4727

A bug was found in FinalLocalVariable where variables assigned anonymous classes were incorrectly being skipped for detection of this check. The change produced new violations in HtmlUnit as seen below:

[INFO] --- maven-checkstyle-plugin:2.17:check (default-cli) @ htmlunit ---
[INFO] Starting audit...
[ERROR] /pipeline/source/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Promise.java:209:25: Variable 'thenAction' should be declared final. [FinalLocalVariable]
Audit done.

You can either accept this patch and not have an issue when you upgrade CS with this fix in the future,
or make your own change/fix later when you do upgrade CS.
Please let us know which way you intend to go.

Feel free to ask any questions.
Thanks.

1 Attachments

Discussion

  • RBRi

    RBRi - 2017-07-29
    • status: open --> closed
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2017-07-29

    applied, hope that hepls

     

Log in to post a comment.

MongoDB Logo MongoDB