findbugs

Findbugs does not display source code line number

I am using Findbugs 1.3.9 and it displays the source file of the errors but does not identify the source line number. It just says something like "may fail to clean up java.sql.Statement in ", and of course clicking on the bug does not take me to the statement in the source file displayed in the right pane. I have made sure I am compil...

why it returns null password???

In my Generator class ,I make a new password and also I have a SystemManagements class which imports Generator class (it is in the other package) and I have some information like name and family of user and I make an object which its type is SystemManagement but when i call getPassword() on my object it will return null!!!?????? public ...

luntbuild + maven + findbugs = OutOfMemoryException

Hi, I've been trying to get Luntbuild to generate and publish a project site for our project including a Findbugs report. All other reports (Cobertura, Surefire, JavaDoc, Dashboard) work fine, but Findbugs bails out with an OutOfMemoryException. Excluding findbugs from report generation fixes the build --- although obviously without a F...

Is there a way to ignore a single FindBugs warning?

With PMD, if you want to ignore a specific warning, you can use // NOPMD to have that line be ignored. Is there something similar for FindBugs? ...

Intermittent Command CanExecute Firing

Hi, I hope someone can help me with this one... Unfortunately to put all the code in is just not feasible, however.. I am implementing the MVVM pattern, I have a content presenter that displays a UserControl. The UserControl has a number of items on it with some basic CRUD functions, e.g. Edit, Delete, etc. I have set up the Control, ...

Easy way find uninitialized member variables

I am looking for easy way to find uninitialized class member variable. Runtime or compile time both methods OK. Currently breakpoint in class constuctor and watch variable one by one. ...

How do I get Hudson to generate a Findbugs report without failing due to an exception?

Update As of Hudson Findbugs plug-in version 4.3 this is no longer an issue End Update As an example of my problem, I'm trying to build the following project http://www.sonatype.com/books/mvnex-book/reference/multimodule.html I added the following to simple-parent/pom.xml <reporting> <plugins> <plugin> <groupId>org.codeh...

Catching weird C pointer arithmetic bugs

I recently ran into a very sneaky bug, in which I forget to dereference a pointer to a string (char array) and thus sometimes overwrote one byte on the stack. Bad: char ** str; (*str) = malloc(10); ... str[2] = 'a'; //overwrites 3 bytes from the location in which str is stored Corrected: char ** str; (*str) = malloc(10); ... (*str...

Sonar do not use the excludeFilterFile from the projects pom.xml

I have findbugs (and checkstyle) configured in my project pom.xml: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.3</version> <configuration> <xmlOutput>true</xmlOutput> <threshold>Normal</threshold> ...

Findbugs Annotations - Do I need annotation.jar and jsr305.jar in my deployed code?

So, I would like to use the findbugs annotations to suppress warnings we deem ok code. Do we need to deploy the annotation.jar and jsr305.jar into our production runtime, or do we only need these jars in the classpath for our Eclipse project and our unix build environment? ...

What's your worst bug that Findbugs found?

What's the trickiest bug that Findbugs (or similar static analysis tool) has found in your code that you wouldn't have caught without using such tools? Code snippets of offending code would be much appreciated. Has the effort from running such tools and dealing with the false positives been worth it or would alternative methods (code r...

FindBugs and CheckForNull on classes vs. interfaces

Is there any way to let FindBugs check and warn me if a CheckForNull annotation is present on the implementation of a method in a class, but not on the declaration of the method in the interface? import javax.annotation.CheckForNull; interface Foo { public String getBar(); } class FooImpl implements Foo { @CheckForNull @...

Thread Safety framework

Hi, The following class is not thread-safe (as proven in http://stackoverflow.com/questions/2410499/proving-the-following-code-not-thread-safe ) Is there a framework out there that can help with either compile time / run time analysis and tell us that the following is not thread safe? For compile time, ideally in Eclipse the wiggly un...

Java resource management: please help to understand Findbugs results.

Hello, everyone! Findbugs bugs me about a method which opens two Closeable instances, but I can't understand why. Source public static void sourceXmlToBeautifiedXml(File input, File output) throws TransformerException, IOException, JAXBException { FileReader fileReader = new FileReader(input); FileWriter fileWriter = ...

FindBugs controversial description

Am I understanding it wrong, or is the description wrong? Equals checks for noncompatible operand (EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS) This equals method is checking to see if the argument is some incompatible type (i.e., a class that is neither a supertype nor subtype of the class that defines the equals ...

FindBugs: "may fail to close stream" - is this valid in case of InputStream?

In my Java code, I start a new process, then obtain its input stream to read it: BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); FindBugs reports an error here: may fail to close stream Pattern id: OS_OPEN_STREAM, type: OS, category: BAD_PRACTICE Must I close the InputStream of another p...

Is it possible to run FindBugs against only one Java class?

I use the FindBugs Eclipse plug-in and was wondering if I can simply analyze only one class rather than the entire project? I can't seem to figure it out. Simply right-clicking on the target class doesn't seem to do anything. ...

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(ForeignKeyConstraint o) { 6: if (this.tableName.compareTo(o.tableName) == 0) { 7: return this.fkFieldName.compareTo(o.fkFieldName); ...

Ant script generate a findbugs_result.xml, but the hudson can not display on main interface. why?

Findbugs script in build.xml: Findbugs checks Coding... Findbugs checks Coding... genetate a findbugs_result.xml. Download Findbugs plugin for hudson. Enter findbugs_result.xml path for hudson. But hudson can not display on main interface. why? ...

What bugs apply to the different FindBugs reportLevels?

According to the Ant task, the report level is a low/medium/high setting that would look for bugs of different criticallity levels. However, there isn't anything I could find that explains which of the bugs apply to these different reporting levels. Is there somewhere that provides this, even if it is something I need to look at within...