tyutNo4 / findbugs

Automatically exported from code.google.com/p/findbugs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No bug search for classes inside of inner member classes

GoogleCodeExporter opened this issue · comments

run findbugs on the followed class:

public class Test {
    private void testNamedInnerClass() {
        class B implements Runnable {
            public void run() {
                String s = null;
                s.equals(new Object() {
                    void test(){
                        String s = null;
                        s.equals(new Object() {

                        });
                    }
                });
            }
        }
    }

    private void testAnonymousClass() {
        Thread t = new Thread(new Runnable (){
            public void run() {
                String s = null;
                s.equals(new Object() {
                    void test(){
                        String s = null;
                        s.equals(new Object() {

                        });
                    }
                });
            }
        });
    }
}

AS IS:
NP bug ("Null pointer dereference") is reported only twice
TO BE:
there are 4 NP bugs.

The bugs inside of inner member classes (both named or anonymous) are not 
reported at all. It looks like FindBugs either ignores these classes 
during bug search or could not report bugs for.

Using latest FindBugs from SVN on Eclipse 3.2.2 with JDK 1.5

Original issue reported on code.google.com by andya...@nurfuerspam.de on 30 Oct 2006 at 10:35

at least a partial fix for 1.1.2-rc4. Finding Element types for anonymous inner 
classes is a pain.
Please check

Original comment by bill.p...@gmail.com on 16 Dec 2006 at 8:38

  • Changed state: Fixed
Using the same test case and 1.1.2-rc4 still exactly the same behavoir as 
before (2 
NP bugs reported instead of 4). Why this report is now marked as fixed?

Original comment by andya...@nurfuerspam.de on 18 Dec 2006 at 8:15

Because I made a stupid mistake in trying to also fold in a fix to another bug.
Should be fixed now.

Original comment by bill.p...@gmail.com on 18 Dec 2006 at 10:45