GrVariable (@Nullable PsiElement instructionElement) { final GrVariable variable; if (instructionElement instanceof GrReferenceExpression) { final PsiElement resolved = ((GrReferenceExpression)instructionElement).resolve(); variable = resolved instanceof GrVariable ? (GrVariable)resolved : null; } else if (instructionElement instanceof GrVariable) { variable = (GrVariable)instructionElement; } else { variable = null; } return variable != null && PsiUtil.isLocalOrParameter(variable) ? variable : null; }