Pregunta

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.

¿Fue útil?

Solución

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() { ... }
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top