From 54334f20cfd15dbd62929ed77464a7fcf3353ef8 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Tue, 16 Aug 2016 21:29:36 +0200 Subject: Do not add members into interfaces with only abstract and clinit methods (#441) --- .../src/org/jacoco/core/internal/instr/ProbeCounter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'org.jacoco.core') diff --git a/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeCounter.java b/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeCounter.java index d45a8f9d..66adf029 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeCounter.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/instr/ProbeCounter.java @@ -13,6 +13,7 @@ package org.jacoco.core.internal.instr; import org.jacoco.core.internal.flow.ClassProbesVisitor; import org.jacoco.core.internal.flow.MethodProbesVisitor; +import org.objectweb.asm.Opcodes; /** * Internal class to remember the total number of probes required for a class. @@ -30,7 +31,8 @@ class ProbeCounter extends ClassProbesVisitor { @Override public MethodProbesVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { - if (!InstrSupport.CLINIT_NAME.equals(name)) { + if (!InstrSupport.CLINIT_NAME.equals(name) + && (access & Opcodes.ACC_ABSTRACT) == 0) { methods = true; } return null; @@ -46,8 +48,8 @@ class ProbeCounter extends ClassProbesVisitor { } /** - * @return true if the class has other methods than a static - * initializer + * @return true if the class has non-abstract methods other + * than a static initializer */ boolean hasMethods() { return methods; -- cgit v1.2.3