mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-86405 "Implement methods" fails to alpha-rename type variables that conflict with class type parameters fixed
This commit is contained in:
@@ -305,13 +305,13 @@ public class GenerateMembersUtil {
|
||||
|
||||
@NotNull
|
||||
private static String suggestUniqueTypeParameterName(@NonNls String baseName, @NotNull PsiTypeParameterList typeParameterList, @Nullable PsiClass targetClass) {
|
||||
String newName = baseName;
|
||||
int index = 0;
|
||||
while ((!checkUniqueTypeParameterName(newName, typeParameterList)) || (targetClass != null && !checkUniqueTypeParameterName(newName, targetClass.getTypeParameterList()))) {
|
||||
newName = baseName + ++index;
|
||||
int i =0;
|
||||
while (true) {
|
||||
final String newName = baseName + ++i;
|
||||
if (checkUniqueTypeParameterName(newName, typeParameterList) && (targetClass == null || checkUniqueTypeParameterName(newName, targetClass.getTypeParameterList()))){
|
||||
return newName;
|
||||
}
|
||||
}
|
||||
|
||||
return newName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user