diff options
Diffstat (limited to 'org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java b/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java index b6632c62..c7b7cf84 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/instr/InstrSupport.java @@ -158,6 +158,18 @@ public final class InstrSupport { static final int CLINIT_ACC = Opcodes.ACC_SYNTHETIC | Opcodes.ACC_STATIC; /** + * Determines whether the given class file version requires stackmap frames. + * + * @param version + * class file version + * @return <code>true</code> if frames are required + */ + public static boolean needsFrames(final int version) { + // consider major version only (due to 1.1 anomaly) + return (version & 0xff) >= Opcodes.V1_6; + } + + /** * Ensures that the given member does not correspond to a internal member * created by the instrumentation process. This would mean that the class is * already instrumented. @@ -173,8 +185,8 @@ public final class InstrSupport { public static void assertNotInstrumented(final String member, final String owner) throws IllegalStateException { if (member.equals(DATAFIELD_NAME) || member.equals(INITMETHOD_NAME)) { - throw new IllegalStateException(format( - "Class %s is already instrumented.", owner)); + throw new IllegalStateException( + format("Class %s is already instrumented.", owner)); } } |