private static boolean checkVariableDeclaredInsideScope(@NotNull GrControlFlowOwner owner, @NotNull PsiElement variable) {
    final PsiElement scope = owner.getParent() instanceof PsiMethod
                             ? owner.getParent()
                             : owner;
    return PsiTreeUtil.isAncestor(scope, variable, false);
  }
private static boolean checkVariableDeclaredInsideScope(@NotNull GrControlFlowOwner owner, @NotNull PsiElement variable)