Given the backlog of new features, I doubt this would be implemented soon, but I wanted to add it since I couldn't find a duplicate.
I have a couple of methods that are wrappers for Object.wait and Condition.wait, respectively. They do not synchronize or loop themselves, so FindBugs diagnoses bug code "Wa". However, these wrappers have most (if not all) the restrictions of the standard wait methods: they need to be called in a loop, can throw interrupted exceptions, etc. So, preferred behavior would be to check the callers of my wrappers and, if applicable, diagnose "Wa" bugs on the callers.
Of course, I would not expect FindBugs to be able to detect these methods are wait-like itself. Instead, I would like to be able to use an annotation (e.g. @WaitLike) to indicate these methods are wait-like and have the anaylsis behind "Wa" and other bugs applied to them.
I'm manually verified all the current uses of these methods, so the current diagnostics are currently "false positives". I now have the choice of filtering these diagnostics as false positives or leaving these diagnostics on the report and training humans to ignore them. Both risk undiagnosed bugs entering my code base in the future. A @WaitLike attribute would be a great advantage, though it may indirectly depend on other features (like some parts of understanding @Generated annotations).
Thanks for your time, I know it is precious.
Seems that too specific problem. If you have only couple of such methods, you may use @SuppressFBWarning annotation or filter them using XML exclude filter. If you want to process custom annotation, probably you may consider writing your own FindBugs plugin...
I've already suppressed the warnings with an XML file. However, I want to
propogate all the wait() restrictions outward. My wrappers, must be called in
a loop, with the appropriate object locked/monitor held, etc. (The wrappers
"just" adjust the wait time.)
In particular, I want FindBugs to check new code I write that uses the
wrappers, and I don't see a way to do that.
Thanks for taking a look at the bugs though.
On Sunday, October 04, 2015 10:00:17 you wrote:
--
Boyd Stephen Smith Jr. ,= ,--. =.
bss@iguanasuicide.net ((/)o o(_))
ICQ: 514984 YM/AIM: DaTwinkDaddy
-'(. .)-'http://iguanasuicide.net/ _/
Related
Feature Requests:
#348