Top "Findbugs" questions

A program which uses static analysis to look for bugs in Java code.

Write to static field - is FindBugs wrong in this case?

I have a Java class like this: public class Foo { public static int counter = 0; public void bar(int counter) { Foo.…

java static-methods static-members findbugs
What's the advantage of making an inner class as static with Java?

I have an inner class in my Java class. When I run find bugs, it recommends(warns) to make it …

java class findbugs
FindBugs filter file for ignoring JUnit tests

I need to set up a filter file for my findbugs ant script that scans only the src/* files and …

java ant junit findbugs
Using "excludes" config in Findbugs and Checkstyle plugin in Gradle

I have the following Gradle build file: https://github.com/markuswustenberg/jsense/blob/a796055f984ec309db3cc0f3e8340…

gradle checkstyle findbugs
How to suppress multiple FindBugs warnings for the same line of code

I recently discovered FindBugs' @edu.umd.cs.findbugs.annotations.SuppressWarnings annotation which is pretty cool and allows you to basically …

java slf4j findbugs
@Nullable input in Google Guava Function interface triggers FindBugs warning

The com.google.common.base.Function interface (from Google Guava) defines apply as: @Nullable T apply(@Nullable F input); The …

java guava findbugs
FindBugs - how to solve EQ_COMPARETO_USE_OBJECT_EQUALS

I am clueless here... 1: private static class ForeignKeyConstraint implements Comparable<ForeignKeyConstraint> { 2: String tableName; 3: String fkFieldName; 4: 5: public int compareTo(…

java findbugs compareto
Is there a Findbugs and / or PMD equivalent for C/C++?

I was recently asked about alternatives to Coverity Prevent for a code base that includes both C/C++ and Java. …

java c++ c findbugs pmd
Method may fail to clean up stream or resource on checked exception -- FindBugs

I am using Spring JDBCTemplate to access data in database and its working fine. But FindBugs is pointing me a …

java spring jdbctemplate findbugs
Can I tell findbugs to ignore classes I am unable to add?

Findbugs reports this: findbugs: [findbugs] Executing findbugs from ant task [findbugs] Running FindBugs... [findbugs] The following classes needed for analysis …

java findbugs