How to filter on errors common to inner classes of a class.

View: New views
1 Messages — Rating Filter:   Alert me  

How to filter on errors common to inner classes of a class.

by Wim Veldhuis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am working on a project on which we recently integrated findbugs. As expected there are a lot of existing warnings which we incrementally are trying to either solve or to suppress them. A number of these warnings is about a serializable inner class (not static) like in :

package x;
public class Foo {
  ...
  private final class SomeAction extends  javax.swing.AbstractAction {
    ...
  }
}

Findbugs reports a SE_BAD_FIELD_INNER_CLASS  warning here. However in this case we know this is not a problem and want to suppress this specific warning. In the example, the class Foo actually has many inner classes and we want to suppress the warning on the outer class level. So I added a clause to our findbugs-exclude filter like

<And>
   <Bug pattern="SE_BAD_FIELD_INNER_CLASS"/>
    <Or>
<!-- Following classes declare actions as inner class, action are by default serializable -->
        <Class name="x.Foo"/>
        <Class name="y.AnotherFoo"/>
    </Or>
</And> 

However Findbugs still reports these warnings, which is irritating as these are confirmed false positives.
I already tried "x.Foo$" and and "x.Foo$*" as class name, but to no avail.

Does anybody know how to specifiy that these warnings should be suppressed for all inner classes of Foo ?

Thanks in advance,
Wim Veldhuis.


_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@...
https://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss