diff options
Diffstat (limited to 'org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/AbstractMatcher.java')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/AbstractMatcher.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/AbstractMatcher.java b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/AbstractMatcher.java index 9e07153b..9b01e777 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/AbstractMatcher.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/AbstractMatcher.java @@ -111,6 +111,25 @@ abstract class AbstractMatcher { } /** + * Moves {@link #cursor} to next instruction if it is + * <code>TABLESWITCH</code> or <code>LOOKUPSWITCH</code>, otherwise sets it + * to <code>null</code>. + */ + final void nextIsSwitch() { + next(); + if (cursor == null) { + return; + } + switch (cursor.getOpcode()) { + case Opcodes.TABLESWITCH: + case Opcodes.LOOKUPSWITCH: + return; + default: + cursor = null; + } + } + + /** * Moves {@link #cursor} to next instruction if it has given opcode, * otherwise sets it to <code>null</code>. */ |