This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 234603

Summary: Allow FindBugs to be skipped on test classes
Product: java Reporter: Jesse Glick <jglick>
Component: FindBugsAssignee: Petr Hejl <phejl>
Status: NEW ---    
Severity: normal Keywords: PATCH_AVAILABLE
Priority: P3    
Version: 7.4   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Simple solution (no configuration option)

Description Jesse Glick 2013-08-19 16:04:55 UTC
A lot of times I will be writing a unit test which repeatedly calls some API that I have marked @CheckForNull. In the test I am not going to bother checking for null after each call; the method should not in fact return null in this case, and if it does, the test will catch that in some other way, such as an assertion or a NullPointerException.

Or test code may legitimately do all sorts of things that would be considered inappropriate in production code, like repeatedly sleeping for 100ms, or hardcoding a path name, etc.

Since it is typically of little value to run FindBugs on test code, and it introduces a lot of spurious warning badges, I would recommend disabling the automatic scan on test source roots (or at least doing so optionally).
Comment 1 Jesse Glick 2016-11-22 21:44:46 UTC
Created attachment 162987 [details]
Simple solution (no configuration option)