Skip to content

Findbugs in Travis CI#262

Closed
mureinik wants to merge 6 commits intoapache:masterfrom
mureinik:findbugs
Closed

Findbugs in Travis CI#262
mureinik wants to merge 6 commits intoapache:masterfrom
mureinik:findbugs

Conversation

@mureinik
Copy link
Copy Markdown
Contributor

@mureinik mureinik commented Apr 1, 2017

This PR adds FindBugs to Travis CI so it can be used to automatically evaluate new patches instead of having to do so retroactively.

It contains a series of patches that either fix existing FindBugs errors or excludes them (either because the violation is intentional or because FindBugs cannot properly assess the code) - individual commit messages explain individual decisions.
At the end of that series of patches is a patch that adds the findbugs:check goal to Travis CI, so it would now be applied on any new PR.

mureinik added 6 commits April 1, 2017 11:44
Exclude ES_COMPARING_PARAMETER_STRING_WITH_EQ FindBugs warnings from
StringUtils methods compare(String, String, boolean) and
compareIgnoreCase(String, String, boolean).

The usages of the == operator seem to be intentional optimizations
similar to the usage in indexOfDifference. If this reasoning is ever
overruled, this suppression should be removed.
FastDateParser#simpleQuote uses a switch case that actually has a
default branch in it, but doesn't use break statements.

SF_SWITCH_NO_DEFAULT unfortunately cannot recognize this pattern, and
leave us with no choice but to suppress it.
FastDatePrinter#appendFullDigits uses a switch statement that
intentionally falls through the cases.
This patch adds a FindBugs suppression for it.
FastDatePrinter#appendFullDigits uses a switch case without break
statements.

SF_SWITCH_NO_DEFAULT unfortunately cannot recognize this pattern, and
leave us with no choice but to suppress it.
This patch copies the FindBugs configuration in pom.xml from the
reporting section to the build section so findbugs can be used as part
of the build process (by using the maven goal findbugs:check).

It then adds this goal to the Travis CI build so that FindBugs
becomes part of the CI, and new patches would be prevented from
introducing new FindBugs errors.
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 1, 2017

Coverage Status

Coverage decreased (-0.006%) to 94.554% when pulling ea0b56f on mureinik:findbugs into 5d3a208 on apache:master.

@asfgit asfgit closed this in 9ceaaeb Apr 19, 2017
@PascalSchumacher
Copy link
Copy Markdown
Contributor

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants