diff options
Diffstat (limited to 'org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinCoroutineFilter.java')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinCoroutineFilter.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinCoroutineFilter.java b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinCoroutineFilter.java index f1261b22..d9944bf5 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinCoroutineFilter.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/KotlinCoroutineFilter.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.List; import org.objectweb.asm.Opcodes; +import org.objectweb.asm.Type; import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.JumpInsnNode; import org.objectweb.asm.tree.LdcInsnNode; @@ -26,6 +27,13 @@ import org.objectweb.asm.tree.TableSwitchInsnNode; */ public final class KotlinCoroutineFilter implements IFilter { + static boolean isLastArgumentContinuation(final MethodNode methodNode) { + final Type methodType = Type.getMethodType(methodNode.desc); + final int lastArgument = methodType.getArgumentTypes().length - 1; + return lastArgument >= 0 && "kotlin.coroutines.Continuation".equals( + methodType.getArgumentTypes()[lastArgument].getClassName()); + } + public void filter(final MethodNode methodNode, final IFilterContext context, final IFilterOutput output) { |