BitSet (@NotNull BitSet bitSet, @NotNull Instruction instruction) { if (!(instruction instanceof ReadWriteVariableInstruction)) return bitSet; if (!((ReadWriteVariableInstruction)instruction).isWrite()) return bitSet; final PsiElement element = instruction.getElement(); if (element instanceof GrVariable && element != var) return bitSet; if (element instanceof GrReferenceExpression ref) { if (ref.isQualified() || ref.resolve() != var) { return bitSet; } } if (!groovyFlow.getVarIndices()[((ReadWriteVariableInstruction)instruction).getDescriptor()].equals(createDescriptor(var))) { return bitSet; } BitSet newResult = new BitSet(groovyFlow.getFlow().length); newResult.set(instruction.num()); return newResult; }