Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why empty line is not included in code coverage?

I am using Java 8.0, Springboot and Junit.

After writing my unit tests for my Application class I get following stats:

Application class: Line Coverage: 95% (22/23)

So I looked after the line and get:

enter image description here

Marked with pink dots, this is the line that "ruins" my coverage. It is an EMPTY line with one closing bracket!!!

Why is that count at All? It cannot be stepped over, otherwise I will never get a return value! Wow! What is happening here?

Thanks for help!

P.S.: I don't care about the coverage, but I am VERY curious, what happened here.

like image 655
Tagamoga Avatar asked Oct 18 '25 22:10

Tagamoga


1 Answers

It's a known bug.

Very sad that there are so old unfixed bugs. You could try a workaround posted in this thread or just leave code as is.

like image 170
alaster Avatar answered Oct 20 '25 12:10

alaster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!