mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
push down: show conflict if wrong field would be accessed (IDEADEV-40753)
This commit is contained in:
@@ -151,6 +151,13 @@ public class RefactoringConflictsUtil {
|
||||
RefactoringUIUtil.getDescription(member, false));
|
||||
message = CommonRefactoringUtil.capitalize(message);
|
||||
conflicts.putValue(refMember, message);
|
||||
} else if (newContext instanceof PsiClass && refMember instanceof PsiField && refMember.getContainingClass() == member.getContainingClass()) {
|
||||
final PsiField fieldInSubClass = ((PsiClass)newContext).findFieldByName(refMember.getName(), false);
|
||||
if (fieldInSubClass != null) {
|
||||
conflicts.putValue(refMember, CommonRefactoringUtil.capitalize(RefactoringUIUtil.getDescription(fieldInSubClass, true) +
|
||||
" would hide " + RefactoringUIUtil.getDescription(refMember, true) +
|
||||
" which is used by moved " + RefactoringUIUtil.getDescription(member, false)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user