You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Alexey Kuznetsov <ak...@gridgain.com> on 2015/11/13 15:49:52 UTC

Check Ignite code base with Findbugs.

Igniters,

What do you think about checking Ignite code base with Findbugs (
http://findbugs.sourceforge.net)?

Does it make sense?

Maybe someone will try?

Thoughts?

-- 
Alexey Kuznetsov

Re: Check Ignite code base with Findbugs.

Posted by Dmitriy Setrakyan <ds...@apache.org>.
On Mon, Nov 30, 2015 at 9:00 AM, Alexey Goncharuk <
alexey.goncharuk@gmail.com> wrote:

> I think this is a great idea, however this exercise only makes sense if
> FindBugs profile is plugged to CI and provides continuous checks for the
> new code being committed.
> …
> Hopefully, somebody from the community will help to integrate it with the
> build process.
>

Huge +1.

If anyone in the community has any experience with integrating FindBugs,
please make yourself known in this thread.

Re: Check Ignite code base with Findbugs.

Posted by Alexey Goncharuk <al...@gmail.com>.
I think this is a great idea, however this exercise only makes sense if
FindBugs profile is plugged to CI and provides continuous checks for the
new code being committed.

Since Alexey K. already has some feedback for the first run, I will
cooperate with him to create a minimal set of checks that we can start with
and then we can probably gradually increase the amount of checks to run.
Hopefully, somebody from the community will help to integrate it with the
build process.

Re: Check Ignite code base with Findbugs.

Posted by Alexey Kuznetsov <ak...@gridgain.com>.
Cos, that was only ONE module checked :)

And who knows what FindBugs will find when I start it over whole project.
:)

On Thu, Nov 26, 2015 at 9:31 AM, Konstantin Boudnik <co...@apache.org> wrote:

> On Tue, Nov 24, 2015 at 10:50AM, Alexey Kuznetsov wrote:
> > Igniters,
> >
> > I've installed FindBugs plugin for Idea and run it on ignite-core module.
> >
> > Well it found a lot... 1331 items...
>
> Better than 100500, eh? :)
>
> > Some of them are false-positive of course, but this plugin has quite
> handy
> > grouping
> >  and we could only check important groups like "Multithreading".
> >
> >
> > Also FindBugs found a bunch of silly bugs like this in GridCacheAdapter:
> > ---------------
> > Nullcheck of res at line 5936 of value previously dereferenced
> >
> > for (ComputeJobResult res : results) {
> > line 5936 >>>  if (res.getException() == null && res != null)
> >                     size += res.<Integer>getData();
> >             }
> > ---------------
> >
> > I think it is worth to install this plugin and take a look.
> >
> > --
> > Alexey Kuznetsov
> > GridGain Systems
> > www.gridgain.com
>



-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com

Re: Check Ignite code base with Findbugs.

Posted by Konstantin Boudnik <co...@apache.org>.
On Tue, Nov 24, 2015 at 10:50AM, Alexey Kuznetsov wrote:
> Igniters,
> 
> I've installed FindBugs plugin for Idea and run it on ignite-core module.
> 
> Well it found a lot... 1331 items...

Better than 100500, eh? :)

> Some of them are false-positive of course, but this plugin has quite handy
> grouping
>  and we could only check important groups like "Multithreading".
> 
> 
> Also FindBugs found a bunch of silly bugs like this in GridCacheAdapter:
> ---------------
> Nullcheck of res at line 5936 of value previously dereferenced
> 
> for (ComputeJobResult res : results) {
> line 5936 >>>  if (res.getException() == null && res != null)
>                     size += res.<Integer>getData();
>             }
> ---------------
> 
> I think it is worth to install this plugin and take a look.
> 
> --
> Alexey Kuznetsov
> GridGain Systems
> www.gridgain.com

Re: Check Ignite code base with Findbugs.

Posted by Alexey Kuznetsov <ak...@gridgain.com>.
Ok, I will fix trivial issues and prepare report for most suspicious code.

On Tue, Nov 24, 2015 at 4:34 PM, Yakov Zhdanov <yz...@apache.org> wrote:

> Alex, if you have already run this test, can you please share the report
> or, even more, fix vivid trivial issues right away and let us review?
>
> --Yakov
>
> 2015-11-24 6:50 GMT+03:00 Alexey Kuznetsov <ak...@gridgain.com>:
>
> > Igniters,
> >
> > I've installed FindBugs plugin for Idea and run it on ignite-core module.
> >
> > Well it found a lot... 1331 items...
> >
> > Some of them are false-positive of course, but this plugin has quite
> handy
> > grouping
> >  and we could only check important groups like "Multithreading".
> >
> >
> > Also FindBugs found a bunch of silly bugs like this in GridCacheAdapter:
> > ---------------
> > Nullcheck of res at line 5936 of value previously dereferenced
> >
> > for (ComputeJobResult res : results) {
> > line 5936 >>>  if (res.getException() == null && res != null)
> >                     size += res.<Integer>getData();
> >             }
> > ---------------
> >
> > I think it is worth to install this plugin and take a look.
> >
> > --
> > Alexey Kuznetsov
> > GridGain Systems
> > www.gridgain.com
> >
>



-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com

Re: Check Ignite code base with Findbugs.

Posted by Yakov Zhdanov <yz...@apache.org>.
Alex, if you have already run this test, can you please share the report
or, even more, fix vivid trivial issues right away and let us review?

--Yakov

2015-11-24 6:50 GMT+03:00 Alexey Kuznetsov <ak...@gridgain.com>:

> Igniters,
>
> I've installed FindBugs plugin for Idea and run it on ignite-core module.
>
> Well it found a lot... 1331 items...
>
> Some of them are false-positive of course, but this plugin has quite handy
> grouping
>  and we could only check important groups like "Multithreading".
>
>
> Also FindBugs found a bunch of silly bugs like this in GridCacheAdapter:
> ---------------
> Nullcheck of res at line 5936 of value previously dereferenced
>
> for (ComputeJobResult res : results) {
> line 5936 >>>  if (res.getException() == null && res != null)
>                     size += res.<Integer>getData();
>             }
> ---------------
>
> I think it is worth to install this plugin and take a look.
>
> --
> Alexey Kuznetsov
> GridGain Systems
> www.gridgain.com
>

Re: Check Ignite code base with Findbugs.

Posted by Alexey Kuznetsov <ak...@gridgain.com>.
Igniters,

I've installed FindBugs plugin for Idea and run it on ignite-core module.

Well it found a lot... 1331 items...

Some of them are false-positive of course, but this plugin has quite handy
grouping
 and we could only check important groups like "Multithreading".


Also FindBugs found a bunch of silly bugs like this in GridCacheAdapter:
---------------
Nullcheck of res at line 5936 of value previously dereferenced

for (ComputeJobResult res : results) {
line 5936 >>>  if (res.getException() == null && res != null)
                    size += res.<Integer>getData();
            }
---------------

I think it is worth to install this plugin and take a look.

--
Alexey Kuznetsov
GridGain Systems
www.gridgain.com

Re: Check Ignite code base with Findbugs.

Posted by Raul Kripalani <ra...@apache.org>.
On Fri, Nov 13, 2015 at 4:51 PM, Alexey Kuznetsov <ak...@gridgain.com>
wrote:

> Raul, I'm afraid it will produce 100500 false-positive warnings.
>

Yep, it's likely.

I think we need to investigate what will be generated by FB tune it and
>
then decide to include it or not into maven build.
>

Exactly. We should do a trial run, tune the configuration and include it
once we have no warnings. That would be our baseline.

I'm not sure what the benefit of FindBugs will be in the long-run, though.
I like the idea as long as it brings more benefits rather than hindrances.
Ignite's codebase is quite special. If we find that FB is too prone to
report false positives for us, we might as well discard the idea
altogether.

If we do find a few bugs thanks to it during our baseline runs, then I'm
all for it.


> Or may be we could have it as optional step (it is possible?).
>

Yep, doable through a Maven profile.

Regards,
*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

Re: Check Ignite code base with Findbugs.

Posted by Alexey Kuznetsov <ak...@gridgain.com>.
Raul, I'm afraid it will produce 100500 false-positive warnings.

I think we need to investigate what will be generated by FB tune it and
then decide to include it or not into maven build.

Or may be we could have it as optional step (it is possible?).

On Fri, Nov 13, 2015 at 11:32 PM, Raul Kripalani <ra...@apache.org> wrote:

> I'd prefer to plug it into the Maven build:
> https://gleclaire.github.io/findbugs-maven-plugin/.
>
> *Raúl Kripalani*
> PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
> Messaging Engineer
> http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
> http://blog.raulkr.net | twitter: @raulvk
>
> On Fri, Nov 13, 2015 at 4:02 PM, Sergi Vladykin <se...@gmail.com>
> wrote:
>
> > It absolutely does make sense. Of course it will not find complex bugs
> but
> > it is pretty good at spotting stupid mistakes.
> >
> > Time ago I used to run Eclipse plugin for FindBugs, I believe something
> > alike should exist for Idea as well.
> >
> > Sergi
> >
> > 2015-11-13 17:49 GMT+03:00 Alexey Kuznetsov <ak...@gridgain.com>:
> >
> > > Igniters,
> > >
> > > What do you think about checking Ignite code base with Findbugs (
> > > http://findbugs.sourceforge.net)?
> > >
> > > Does it make sense?
> > >
> > > Maybe someone will try?
> > >
> > > Thoughts?
> > >
> > > --
> > > Alexey Kuznetsov
> > >
> >
>



-- 
Alexey Kuznetsov
GridGain Systems
www.gridgain.com

Re: Check Ignite code base with Findbugs.

Posted by Raul Kripalani <ra...@apache.org>.
I'd prefer to plug it into the Maven build:
https://gleclaire.github.io/findbugs-maven-plugin/.

*Raúl Kripalani*
PMC & Committer @ Apache Ignite, Apache Camel | Integration, Big Data and
Messaging Engineer
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

On Fri, Nov 13, 2015 at 4:02 PM, Sergi Vladykin <se...@gmail.com>
wrote:

> It absolutely does make sense. Of course it will not find complex bugs but
> it is pretty good at spotting stupid mistakes.
>
> Time ago I used to run Eclipse plugin for FindBugs, I believe something
> alike should exist for Idea as well.
>
> Sergi
>
> 2015-11-13 17:49 GMT+03:00 Alexey Kuznetsov <ak...@gridgain.com>:
>
> > Igniters,
> >
> > What do you think about checking Ignite code base with Findbugs (
> > http://findbugs.sourceforge.net)?
> >
> > Does it make sense?
> >
> > Maybe someone will try?
> >
> > Thoughts?
> >
> > --
> > Alexey Kuznetsov
> >
>

Re: Check Ignite code base with Findbugs.

Posted by Sergi Vladykin <se...@gmail.com>.
It absolutely does make sense. Of course it will not find complex bugs but
it is pretty good at spotting stupid mistakes.

Time ago I used to run Eclipse plugin for FindBugs, I believe something
alike should exist for Idea as well.

Sergi

2015-11-13 17:49 GMT+03:00 Alexey Kuznetsov <ak...@gridgain.com>:

> Igniters,
>
> What do you think about checking Ignite code base with Findbugs (
> http://findbugs.sourceforge.net)?
>
> Does it make sense?
>
> Maybe someone will try?
>
> Thoughts?
>
> --
> Alexey Kuznetsov
>