diff options
author | Evgeny Mandrikov <138671+Godin@users.noreply.github.com> | 2021-03-15 09:21:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 09:21:22 +0100 |
commit | d9296f7251f99a9b0b6e624d7eb6d35021279ce3 (patch) | |
tree | 31a1abec2a0879c2ed96309522e2a7d96021f2a6 | |
parent | 66b5fa9216577bfe86fb29e83b031a3cde10cc08 (diff) | |
download | jacoco-d9296f7251f99a9b0b6e624d7eb6d35021279ce3.tar.gz |
Update KotlinDefaultArgumentsFilter for Kotlin 1.5 (#1162)
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinDefaultArgumentsFilter.java | 4 | ||||
-rw-r--r-- | org.jacoco.doc/docroot/doc/changes.html | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinDefaultArgumentsFilter.java b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinDefaultArgumentsFilter.java index 6d8ccc99..b734d234 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinDefaultArgumentsFilter.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinDefaultArgumentsFilter.java @@ -82,7 +82,7 @@ public final class KotlinDefaultArgumentsFilter implements IFilter { private static class Matcher extends AbstractMatcher { public void match(final MethodNode methodNode, final IFilterOutput output, final boolean constructor) { - cursor = methodNode.instructions.getFirst(); + cursor = skipNonOpcodes(methodNode.instructions.getFirst()); nextIs(Opcodes.IFNULL); nextIsType(Opcodes.NEW, "java/lang/UnsupportedOperationException"); @@ -102,7 +102,7 @@ public final class KotlinDefaultArgumentsFilter implements IFilter { output.ignore(methodNode.instructions.getFirst(), cursor); next(); } else { - cursor = methodNode.instructions.getFirst(); + cursor = skipNonOpcodes(methodNode.instructions.getFirst()); } final Set<AbstractInsnNode> ignore = new HashSet<AbstractInsnNode>(); diff --git a/org.jacoco.doc/docroot/doc/changes.html b/org.jacoco.doc/docroot/doc/changes.html index 58be8389..2eacdeb4 100644 --- a/org.jacoco.doc/docroot/doc/changes.html +++ b/org.jacoco.doc/docroot/doc/changes.html @@ -33,6 +33,9 @@ <li>Branches added by the Kotlin compiler version 1.4.20 and above for suspending lambdas are filtered out during generation of report (GitHub <a href="https://github.com/jacoco/jacoco/issues/1149">#1149</a>).</li> + <li>Branches added by the Kotlin compiler version 1.5.0 and above for functions + with default arguments are filtered out during generation of report + (GitHub <a href="https://github.com/jacoco/jacoco/issues/1162">#1162</a>).</li> <li>Improved filtering of bytecode generated by Kotlin compiler for <code>when</code> expressions on <code>kotlin.String</code> values (GitHub <a href="https://github.com/jacoco/jacoco/issues/1156">#1156</a>).</li> |