mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inplace rename: do not rename enum constants when constructor was renamed (IDEA-91063)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
enum Foo {
|
||||
BAR,
|
||||
BAZ
|
||||
;
|
||||
|
||||
Fo<caret>o() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
enum Bar {
|
||||
BAR,
|
||||
BAZ
|
||||
;
|
||||
|
||||
Bar() {
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,10 @@ public class RenameMembersInplaceTest extends LightCodeInsightTestCase {
|
||||
public void testMethodWithJavadocRef() throws Exception {
|
||||
doTestInplaceRename("bar");
|
||||
}
|
||||
|
||||
public void testEnumConstructor() throws Exception {
|
||||
doTestInplaceRename("Bar");
|
||||
}
|
||||
|
||||
public void testConflictingMethodName() throws Exception {
|
||||
try {
|
||||
|
||||
@@ -220,6 +220,10 @@ public abstract class InplaceRefactoring {
|
||||
}
|
||||
|
||||
protected boolean acceptReference(PsiReference reference) {
|
||||
final PsiElement element = reference.getElement();
|
||||
if (element instanceof PsiNamedElement) {
|
||||
return Comparing.strEqual(((PsiNamedElement)element).getName(), myElementToRename.getName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user