score:2
this may be obvious, but i think your issues are with eclipse (perhaps the findbugs plugin in particular), not findbugs itself.
you might consider running findbugs from the command line to eliminate any eclipse issues and ensure that you have findbugs running correctly in its own. knowing how to run findbugs in a standalone mode will give you a fallback when your ide is not configured properly.
i saved your source code in a file named findbugsannotationstest.java
, added imports for list
, arraylist
, and checkfornull
, compiled, and ran findbugs 1.3.9. findbugs generates several warnings about null values:
m d np: possible null pointer dereference in findbugsannotationstest.shouldgetfindbugswarning() due to return value of called method dereferenced at findbugsannotationstest.java:[line 18] m c uwf: unwritten field: findbugsannotationstest.canbenull at findbugsannotationstest.java:[line 12] m c np: read of unwritten field canbenull in findbugsannotationstest.shouldgetfindbugswarning() at findbugsannotationstest.java:[line 16] warnings generated: 3
these are the imports i added to the top of findbugsannotationstest.java
:
import java.util.arraylist;
import java.util.list;
import edu.umd.cs.findbugs.annotations.checkfornull;
commands:
javac -d . -classpath ${findbugs_home}/lib/findbugs.jar findbugsannotationstest.java
${findbugs_home}/bin/findbugs findbugsannotationstest.class
where ${findbugs_home}
is the directory in which findbugs 1.3.9 is installed. javac
is assumed to be on the path.
note: i used the findbugs.jar
instead of annotations.jar
and jsr305.jar
but i get the same results with this command:
javac -d . -classpath ${findbugs_home}/lib/annotations.jar:${findbugs_home}/lib/jsr305.jar findbugsannotationstest.java
Source: stackoverflow.com
Related Query
- Findbugs using jsr305 annotations in eclipse is not finding bugs
- When using Eclipse with FindBugs can you mark a bug as not a bug and have it removed from the bug list?
- Eclipse indexer is not finding the functions using the android ndk
- Java "constant string too long" compile error. Only happens using Ant, not when using Eclipse
- Eclipse CDT using MinGW does not output in console
- FindBugs not showing the bugs found
- Error "AdbCommandRejectedException: device not found" in Eclipse using Android emulator
- Multiple "could not be resolved" problems using Eclipse with minGW
- Using Eclipse for androidSDK, when I go to run, I get WARNING: Data partition already in use. Changes will not persist!
- SRC folder in Eclipse is empty (MainActivity class not created) after creating a new android project using Eclipse
- Eclipse pydev warning - "Debugger speedups using cython not found."
- Using JavaFX (JDK 1.8.0_05) in Eclipse Luna does not work
- Could not create servlet in web application project (google app engine) by using eclipse
- Using native git not jgit in Eclipse git?
- When using Eclipse and Egit I can not push to upstream
- When not to use this server location when using tomcat within Eclipse
- Files in src/main/resources not copied when using maven and eclipse
- Why Eclipse does not include annotations when implementing methods from a Java interface?
- Could not understand about Maven pom file using Eclipse
- Properties of new tags using composite component are not displayed by Eclipse auto complete shortcurt
- Why is Eclipse Content Assist not using static imports
- Eclipse Lombok annotations not compiled... Why?
- Could not run phased build action using gradle distribution - eclipse
- Log4j not finding custom appender using a property file
- Run As JUnit not appearing in Eclipse - using JUnit4
- FindBugs 3 not working in Eclipse Luna
- Eclipse semicolon inserted before cursor when typing full line not using content assist
- Class not found when using JAX-RS with Eclipse and Glassfish
- Eclipse plugin to SonarQube 4.0 not finding provisioned project or creating new project
- "Source not found" when debugging android app using Eclipse
More Query from same tag
- GGTS not adding classes to Grails project
- custom exception only prints out null when called in a try/catch block
- C:\Users\defaultu\.m2\repository\...plugins\maven-resources-plugin\2.5\maven-resources-plugin-2.5.pom. (The system cannot find the path specified)
- Compare editor not working on eclipse on node.js project
- Maven : No compile errors but still cant find symbol
- How to debug Java Desktop Application with Ant Script?
- ActivityNotFoundException - Android application using fb login and google maps
- wamy project's R.java file is causing and error and when ever i fix it eclipse removes the changes i made
- Qt C++, Eclipse (on Win 7) - project build failed with "unresolved reference to _Unwind_Resume" error
- How to recursively move a package between source folders in Eclipse and update CVS?
- is there a way to copy the loaded ivy jars to the filesystem in eclipse?
- Eclipse shows different then when I debug on my phone
- Can i remove google play services language files?
- Eclipse does not Highlght my JSP-File
- How to Hide Context Menu in Eclipse?
- Phone - How to do setup to create phonegap application
- Hide files in eclipse navigator
- Eclipse WTP vs sydeo, " serves modules without publishing "
- I'm using xtag in selenium but can't able to clk on link. My html code contains href and onclick tags both
- How to resolve requirement: Import-Package:
- How can I share an Eclipse workspace between accounts in Mac?
- Eclipse key bindings warnings.
- How to access files in Hadoop HDFS?
- Eclipse plug-in: Create a new file extension for a language not supported by Eclipse
- Where can I find gradle dependencies?
- What is the bottleneck of Android app debugging?
- How to configure the bootstrap classpath of an Eclipse plug-in?
- cvc-complex-type.2.4.a invalid content was found starting with element factory in faces-config.xml
- prevent empty constructors from @Immutable annotation
- Exporting dynamic java web application to PDF?