-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix move instance method when inner class is referenced (#1412)
* Fix move instance method when inner class is referenced - fix MoveInstanceMethodProcessor to handle the cases where the method to move references a member class - add new tests to MoveInstanceMethodTests - fixes #1301 - verifies #1303 is fixed
- Loading branch information
Showing
23 changed files
with
394 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test71/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
private class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
|
||
public void m() { | ||
InnerInterface inner = new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
} | ||
|
||
class B { | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test71/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
} | ||
|
||
class B { | ||
|
||
public void m(A a) { | ||
A.InnerInterface inner = a.new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test72/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
private static class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
|
||
public void m() { | ||
InnerInterface inner = new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
} | ||
|
||
class B { | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test72/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
static class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
} | ||
|
||
class B { | ||
|
||
public void m() { | ||
A.InnerInterface inner = new A.InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test73/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
private class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
|
||
public void m() { | ||
InnerInterface inner = new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test73/in/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package p1; | ||
|
||
class B { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test73/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test73/out/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package p1; | ||
|
||
import p1.A.InnerInterface; | ||
|
||
class B { | ||
|
||
public void m(A a) { | ||
InnerInterface inner = a.new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test74/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
private static class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
|
||
public void m() { | ||
InnerInterface inner = new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test74/in/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package p1; | ||
|
||
class B { | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test74/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
static class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test74/out/B.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package p1; | ||
|
||
import p1.A.InnerInterface; | ||
|
||
class B { | ||
|
||
public void m() { | ||
InnerInterface inner = new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test75/in/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
protected class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
|
||
public void m() { | ||
InnerInterface inner = new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
} | ||
|
||
class B { | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test75/out/A.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
|
||
protected class InnerInterface { | ||
void innerMethod() { | ||
|
||
} | ||
} | ||
} | ||
|
||
class B { | ||
|
||
public void m(A a) { | ||
A.InnerInterface inner = a.new InnerInterface(); | ||
inner.innerMethod(); | ||
} | ||
|
||
} |
Oops, something went wrong.