Question

How to suppress " Inefficient use of keySet iterator instead of entrySet iterator" and "Unread field" warning ?

I don't want to / rather can't change some implementation so how could I pass/suppress this warning ?

Please tell me what all package I need to import including annotations.

Thank you.

Was it helpful?

Solution

You can annotate a class/method/field with @SuppressFBWarnings and the bug to ignore from the FindBugs bug descriptions list.

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

class MyBuggyClass
{
    @SuppressFBWarnings("URF_UNREAD_FIELD")
    private int unreadField;

    @SuppressFBWarnings("WMI_WRONG_MAP_ITERATOR")
    public void useKeySet() { ... }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top