From 99b9be8f783894ef712f9afa9ebc1353e2e022e9 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Thu, 24 Oct 2013 17:03:14 +0200 Subject: [PATCH] IDEA-115381 NotNull bytecode instrumenter does not update visibility scope for 'this' and parameter local variables --- .../notNullVerification/NotNullVerifyingInstrumenter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 b293b4ffc5ee..af36e512dd26 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 @@ -190,8 +190,9 @@ public class NotNullVerifyingInstrumenter extends ClassVisitor implements Opcode @Override public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) { - final boolean isParameter = getParameterIndex(index, access, args) >= 0; - final Label label = (isParameter && myStartGeneratedCodeLabel != null) ? myStartGeneratedCodeLabel : start; + final boolean isStatic = (access & ACC_STATIC) != 0; + final boolean isParameterOrThisRef = isStatic ? index < args.length : index <= args.length; + final Label label = (isParameterOrThisRef && myStartGeneratedCodeLabel != null) ? myStartGeneratedCodeLabel : start; mv.visitLocalVariable(name, desc, signature, label, end, index); }