diff --git a/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java b/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java index 4b57a2e794ae..cec5a269acc8 100644 --- a/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java +++ b/java/compiler/instrumentation-util/src/com/intellij/compiler/notNullVerification/NotNullVerifyingInstrumenter.java @@ -25,7 +25,11 @@ public class NotNullVerifyingInstrumenter extends ClassVisitor implements Opcode @SuppressWarnings("SSBasedInspection") private static final String[] EMPTY_STRING_ARRAY = new String[0]; - @SuppressWarnings("ConstantConditions") private static final boolean NEW_ASM = Opcodes.API_VERSION > Opcodes.ASM6; + private static final boolean NEW_ASM; + static { + try { NEW_ASM = (Integer)Opcodes.class.getField("API_VERSION").get(null) > Opcodes.ASM6; } + catch (Exception e) { throw new RuntimeException(e); } + } private final Map> myMethodParamNames; private String myClassName; diff --git a/plugins/IntelliLang/intellilang-jps-plugin/src/org/jetbrains/jps/intellilang/instrumentation/PatternInstrumenter.java b/plugins/IntelliLang/intellilang-jps-plugin/src/org/jetbrains/jps/intellilang/instrumentation/PatternInstrumenter.java index eeed09b37ae1..cb8857c0642f 100644 --- a/plugins/IntelliLang/intellilang-jps-plugin/src/org/jetbrains/jps/intellilang/instrumentation/PatternInstrumenter.java +++ b/plugins/IntelliLang/intellilang-jps-plugin/src/org/jetbrains/jps/intellilang/instrumentation/PatternInstrumenter.java @@ -26,7 +26,11 @@ class PatternInstrumenter extends ClassVisitor implements Opcodes { static final String JAVA_UTIL_REGEX_PATTERN = "[Ljava/util/regex/Pattern;"; static final String NULL_PATTERN = "(((("; - @SuppressWarnings("ConstantConditions") static final boolean NEW_ASM = Opcodes.API_VERSION > Opcodes.ASM6; + private static final boolean NEW_ASM; + static { + try { NEW_ASM = (Integer)Opcodes.class.getField("API_VERSION").get(null) > Opcodes.ASM6; } + catch (Exception e) { throw new RuntimeException(e); } + } private final String myPatternAnnotationClassName; private final boolean myDoAssert;