mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
move members: conflict against members of superclass (IDEA-151440)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
class One {
|
||||
static boolean truth = true;
|
||||
static void important() {
|
||||
System.out.println(1);
|
||||
}
|
||||
}
|
||||
class A extends One {
|
||||
Two() {
|
||||
important();
|
||||
System.out.println(truth);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public class B {
|
||||
static boolean truth = false;
|
||||
static void important() {
|
||||
System.out.println(2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class One {
|
||||
static boolean truth = true;
|
||||
static void important() {
|
||||
System.out.println(1);
|
||||
}
|
||||
}
|
||||
class A extends One {
|
||||
Two() {
|
||||
important();
|
||||
System.out.println(truth);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public class B {
|
||||
static boolean truth = false;
|
||||
static void important() {
|
||||
System.out.println(2);
|
||||
}
|
||||
}
|
||||
@@ -154,6 +154,17 @@ public class MoveMembersTest extends MultiFileTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testExistingFieldInSuper() throws Exception {
|
||||
try {
|
||||
doTest("B", "A", 0, 1);
|
||||
fail("conflict expected");
|
||||
}
|
||||
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
|
||||
assertEquals("Field <b><code>truth</code></b> already exists in the target class.\n" +
|
||||
"Method <b><code>important()</code></b> already exists in the target class.", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void testInnerToInterface() throws Exception {
|
||||
doTest("A", "B", 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user