Skip to content

Groovy 2.5.5 unreachable line in byte code #884

@admxiii

Description

@admxiii

JaCoCo version: 0.8.4

Starting with groovy 2.5.5 through 2.5.7, an additional line number was added to the byte code to fix some issues. This causes jacoco to report lines that cannot ever be covered. This new line number seems to cause problems anytime it is after a ARETURN statement on the closing brace of the method. It would be great if these unreachable lines could be filtered out somehow.

int nonVoidMethod() {
1 * 1
} <-- shows red

Example of new byte code

ARETURN
L1
LINENUMBER 16 L1 <-- new line number that cant be hit
FRAME FULL [] [java/lang/Throwable]
NOP
ATHROW
LOCALVARIABLE this Lcom/company/Form; L0 L1 0
MAXSTACK = 2
MAXLOCALS = 1

groovy 2.5.4 byte code

ARETURN
L1
FRAME FULL [] [java/lang/Throwable]
NOP
ATHROW
LOCALVARIABLE this Lcom/company/Form; L0 L1 0
MAXSTACK = 2
MAXLOCALS = 1

related to fixed issues
https://issues.apache.org/jira/browse/GROOVY-7647
https://issues.apache.org/jira/browse/GROOVY-8742

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions