@@ -0,0 +1,2350 @@
+package bugIdeas;%0A%0Aimport java.util.logging.Logger;%0A%0Aimport javax.annotation.CheckForNull;%0A%0Aimport junit.framework.Assert;%0Aimport edu.umd.cs.findbugs.annotations.DesireNoWarning;%0Aimport edu.umd.cs.findbugs.annotations.DesireWarning;%0Aimport edu.umd.cs.findbugs.annotations.ExpectWarning;%0Aimport edu.umd.cs.findbugs.annotations.NoWarning;%0A%0Apublic class Ideas_2011_12_19 %7B%0A%0A    static final Logger LOG = Logger.getLogger(Ideas_2011_12_19.class.getName());%0A%0A    @NoWarning(%22NP%22)%0A    int f(Object x) %7B%0A        assert x != null;%0A        return x.hashCode();%0A    %7D%0A%0A    @ExpectWarning(%22NP%22)%0A    int f2(Object x) %7B%0A        assert x == null;%0A        return x.hashCode();%0A    %7D%0A%0A    @DesireNoWarning(%22NP%22)%0A    int f3(Object x) %7B%0A        Assert.assertTrue(x != null);%0A        return x.hashCode();%0A    %7D%0A%0A    @DesireNoWarning(%22NP%22)%0A    int f4(Object x) %7B%0A        Assert.assertFalse(x == null);%0A        return x.hashCode();%0A    %7D%0A%0A    @DesireWarning(%22NP%22)%0A    int f3Bug(Object x) %7B%0A        Assert.assertTrue(x == null);%0A        return x.hashCode();%0A    %7D%0A%0A    @DesireWarning(%22NP%22)%0A    int f4Bug(Object x) %7B%0A        Assert.assertFalse(x != null);%0A        return x.hashCode();%0A    %7D%0A%0A    @ExpectWarning(%22NP%22)%0A    int f5a() %7B%0A        Object o = h(%22a%22);%0A        return o.hashCode();%0A    %7D%0A%0A    @NoWarning(%22NP%22)%0A    int f5b() %7B%0A        Object o = h(%22a%22);%0A        assert o != null;%0A        return o.hashCode();%0A    %7D%0A%0A    @NoWarning(%22NP%22)%0A    int f5c() %7B%0A        Object o = h(%22a%22);%0A        Assert.assertTrue(o != null);%0A        return o.hashCode();%0A    %7D%0A%0A    @NoWarning(%22NP%22)%0A    int f5e(Object o) %7B%0A        if (o == null)%0A            System.out.println(%22oops%22);%0A        Assert.assertTrue(o != null);%0A        return o.hashCode();%0A    %7D%0A%0A    @NoWarning(%22NP%22)%0A    int f5f(Object o) %7B%0A        if (o == null)%0A            System.out.println(%22oops%22);%0A        assertIsTrue(o != null);%0A        return o.hashCode();%0A    %7D%0A%0A    @ExpectWarning(%22NP%22)%0A    int f5g(Object o) %7B%0A        if (o == null)%0A            System.out.println(%22oops%22);%0A        foo(o != null);%0A        return o.hashCode();%0A    %7D%0A%0A    @CheckForNull%0A    Object h(Object x) %7B%0A        return x;%0A    %7D%0A%0A    int g(Object x) %7B%0A        Assert.assertNotNull(x != null);%0A        return x.hashCode();%0A    %7D%0A%0A    void foo(boolean b) %7B%0A    %7D%0A%0A    boolean assertIsTrue(boolean b) %7B%0A        assert b;%0A        return b;%0A    %7D%0A%7D%0A

add test for to handle assertion methods with boolean return value