diff options
Diffstat (limited to 'org.jacoco.core/src/org/jacoco/core/internal/flow/Instruction.java')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/flow/Instruction.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/flow/Instruction.java b/org.jacoco.core/src/org/jacoco/core/internal/flow/Instruction.java index e49c5a0f..e41ca468 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/flow/Instruction.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/flow/Instruction.java @@ -11,12 +11,16 @@ *******************************************************************************/ package org.jacoco.core.internal.flow; +import org.objectweb.asm.tree.AbstractInsnNode; + /** * Representation of a byte code instruction for analysis. Internally used for * analysis. */ public class Instruction { + private final AbstractInsnNode node; + private final int line; private int branches; @@ -28,16 +32,26 @@ public class Instruction { /** * New instruction at the given line. * + * @param node + * corresponding node * @param line * source line this instruction belongs to */ - public Instruction(final int line) { + public Instruction(final AbstractInsnNode node, final int line) { + this.node = node; this.line = line; this.branches = 0; this.coveredBranches = 0; } /** + * @return corresponding node + */ + public AbstractInsnNode getNode() { + return node; + } + + /** * Adds an branch to this instruction. */ public void addBranch() { |