mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
distinguish usageInfos corresponding to one poly reference
static import on overload method should be updated when all overloads are renamed simultaneously (IDEA-142445)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
package pack1;
|
||||
|
||||
public class A {
|
||||
public static void renamedStaticMethod(int i) {
|
||||
}
|
||||
|
||||
public static void renamedStaticMethod(String s) {
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package pack2;
|
||||
|
||||
import pack1.A;
|
||||
|
||||
import static pack1.A.renamedStaticMethod;
|
||||
|
||||
class Usage {
|
||||
{
|
||||
A.renamedStaticMethod(27);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package pack1;
|
||||
|
||||
public class A {
|
||||
public static void staticMethod(int i) {
|
||||
}
|
||||
|
||||
public static void staticMethod(String s) {
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package pack2;
|
||||
|
||||
import static pack1.A.staticMethod;
|
||||
|
||||
class Usage {
|
||||
{
|
||||
staticMethod(27);
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,10 @@ public class RenameMethodMultiTest extends MultiFileTestCase {
|
||||
doTest("pack1.A", "void staticMethod(int i)", "renamedStaticMethod");
|
||||
}
|
||||
|
||||
public void testStaticImport5() throws Exception {
|
||||
doAutomaticRenameMethod("pack1.A", "void staticMethod(int i)", "renamedStaticMethod");
|
||||
}
|
||||
|
||||
public void testDefaultAnnotationMethod() throws Exception {
|
||||
doTest("pack1.A", "int value()", "intValue");
|
||||
}
|
||||
|
||||
@@ -86,6 +86,26 @@ public class MoveRenameUsageInfo extends UsageInfo{
|
||||
return myReferencedElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
if (!super.equals(o)) return false;
|
||||
|
||||
MoveRenameUsageInfo info = (MoveRenameUsageInfo)o;
|
||||
|
||||
if (myReferencedElement != null ? !myReferencedElement.equals(info.myReferencedElement) : info.myReferencedElement != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = super.hashCode();
|
||||
result = 31 * result + (myReferencedElement != null ? myReferencedElement.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public PsiReference getReference() {
|
||||
|
||||
Reference in New Issue
Block a user