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.
Product Version = NetBeans IDE 7.3 (Build 201302132200) Operating System = Windows 7 version 6.1 running on amd64 Java; VM; Vendor = 1.7.0_17 Runtime = Java HotSpot(TM) 64-Bit Server VM 23.7-b01 The Findbugs editor integration show an error at line 17 while it is at line 16 (on a different method call). Both Findbugs inspection (inside Netbeans) and maven Findbugs command-line check say the error is on line 16.
Created attachment 133937 [details] IDE log
Created attachment 133938 [details] Screen shot editor Please note two arrows: first on editor line 17 (method metAnnotated) and second one on inspect window which show error on line 16 (method metSimple).
Created attachment 133940 [details] Test case (maven project)
Integrated into 'main-golden', will be available in build *201305082300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/9defc44722d6 User: Jan Lahoda <jlahoda@netbeans.org> Log: #229167: including a warning about difference in FindBugs results between editor and Source/Inspect.
In fact, the problem is not in showing the warning on a wrong line, the problem is that there are two distinct warnings: in the Source/Inspect way, deeper analysis is performed, which detects that Args1.metSimple cannot complete normally for null parameter, and produces warning for that (and only for that). Inside edito, the analysis is more shallow, and so the problem in Args1.metSimple is not found, which leads to the warning on the other line. I am afraid I don't see a way to fix that: the analysis inside editor is passing only the classfile for the one file in the editor into FindBugs, for performance reasons. Passing all the project's classfiles would be prohibitively slow for anything but toy projects. I am not aware about any way to run FindBugs incrementally (if you know about one, please let me know, thanks). So the thing I think I can do is to add a warning that the results in editor may differ from the ones in Source/Inspect, which I did by the above changeset.
(In reply to comment #5) So, if I understood well, - in the editor, Findbugs analysis is on single class file with effort = min. - in the inspection analysis, Findbugs scope is on complete project with effort = default or max. I think this situation is a good solution and the warning let user understand there is a difference. Thanks. By the way, inspection analysis works at project level only. If I select the package and run inspection analysis on "current package", no errors/warnings are shown which it is not correct as all project source files are in that package.