String (@NotNull String baseName, PsiElement place, boolean lookForward, boolean allowShadowing, Predicate<? super PsiVariable> canBeReused) { PsiElement scope = PsiTreeUtil.getNonStrictParentOfType(place, PsiStatement.class, PsiCodeBlock.class, PsiMethod.class); for (int index = 0; ; index++) { String name = index > 0 ? baseName + index : baseName; if (hasConflictingVariable(place, name, allowShadowing) || lookForward && hasConflictingVariableAfterwards(scope, name, canBeReused)) { continue; } return name; } }