[
https://issues.apache.org/jira/browse/GROOVY-9373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17249073#comment-17249073
]
Eric Milles commented on GROOVY-9373:
-------------------------------------
[Part one|https://github.com/apache/groovy/pull/1443] has been submitted for
review. It writes line number information for the first line of method block
to cover generated bytecode instructions, for example implicit call to super
class constructor. And writes line number information for the last line of
method block to cover generated bytecode for call return. Also it consolidates
and reworks the fixes for GROOVY-7647, GROOVY-8742 and GROOVY-9199 -- extra
line numbers are not written for "do \{", "try \{" and "\} finally \{".
Part two should focus on {{AsmClassGenerator#visitStdMethod}}, which adds
return instructions (described in GROOVY-9126). These failsafe instructions
are not needed in many cases and represent unreachable bytecode that affects
coverage reports (and bloats the bytecode). It will be necessary to determine
if any path in the method's bytecode can reach the point where returns are
written. Void methods, bytecode sequences and other cases are examples where
the returns are still leveraged.
> ASM: rework line numbers for blocks with fast-path, try/catch or return
> statement insertion
> -------------------------------------------------------------------------------------------
>
> Key: GROOVY-9373
> URL: https://issues.apache.org/jira/browse/GROOVY-9373
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.18, 2.5.9, 3.0.0-rc-3
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> GROOVY-4063, GROOVY-4505, GROOVY-7647, GROOVY-8742, GROOVY-9076, GROOVY-9126
> and GROOVY-9199 present (possibly) conflicting concerns. Code coverage
> metrics are thrown off when line number information exists outside of the
> reachable paths in the bytecode. Debug break and step exhibit strange
> behaviors when the bytecode contains insufficient or duplicated line number
> information.
> Can the ASM changes in StatementWriter be reworked to address these concerns?
> See also https://github.com/jacoco/jacoco/issues/884
--
This message was sent by Atlassian Jira
(v8.3.4#803005)