We know that findbugs is dedicated for code bugs check. It works on many common bug patterns.
But today, I found a bug of findbugs, it ignores a bug on java8 codes.
1. The codes
Here we use jdk 1.8, we use streams to travese a string list like this.
As the comments shown, the second line of the s.forEach is a bug, because in java8,
one stream object can only be traversed once, so ,if you run the program, you would get this:
2. Let findbugs check it
Now we call findbugs to check it, just from the context menu, we got this result:
You can find that no bugs found by findbugs,but there is one!!!
I think findbugs should fix it ASAP.
You can find detail documents about the java8 here: