Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@c-mita
Copy link

@c-mita c-mita commented Aug 22, 2025

Currently KotlinWhenStringFilter breaks branch coverage for String based when statements because the replacement branches into the case statements can never be covered.

This is because the new branches point to the "first" branch of the unconditional jumps to the bodies of the case statement (after the String equality check).

But the first branch of a jump is the "fallthrough" (the path if the jump is not taken), which is never taken for a simple goto. The target of a jump is the second branch.

Fixes #1938

Currently KotlinWhenStringFilter breaks branch coverage for String
based when statements because the replacement branches into the case
statements can never be covered.

This is because the new branches point to the "first" branch of the
unconditional jumps to the bodies of the case statement (after the
String equality check).

But the first branch of a jump is the "fallthrough" (the path if the
jump is not taken), which is never taken for a simple goto. The
target of a jump is the second branch.

Fixes jacoco#1938
@Godin Godin self-requested a review August 22, 2025 16:25
@Godin Godin self-assigned this Aug 22, 2025
@github-project-automation github-project-automation bot moved this to Implementation in Current work items Aug 22, 2025
@github-project-automation github-project-automation bot moved this to Awaiting triage in Filtering Aug 22, 2025
@Godin Godin moved this from Awaiting triage to In Progress in Filtering Aug 22, 2025
@Godin Godin closed this in #1940 Aug 27, 2025
@github-project-automation github-project-automation bot moved this from Implementation to Done in Current work items Aug 27, 2025
@Godin Godin moved this from In Progress to Done in Filtering Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

KotlinWhenStringFilter assigns incorrect branch indices for replacement branches

2 participants