-
Notifications
You must be signed in to change notification settings - Fork 81
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 processor to handle class instance creation accessi…
…bility (#1413) * Fix move instance processor to recognize an inaccessible constructor - add logic to the MethodBodyRewriter so it will recognize a constructor call that will be inaccessible after moving and try to modify the accessibility of the constructor - fix the ThisReferenceFinder to ignore field references made from a local variable - add new tests to MoveInstanceMethodTests - fixes #1304
- Loading branch information
Showing
8 changed files
with
157 additions
and
7 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
20 changes: 20 additions & 0 deletions
20
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test77/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,20 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
int k; | ||
|
||
private A() { | ||
|
||
} | ||
|
||
public void m() { | ||
A a = new A(); | ||
a.k = 3; | ||
} | ||
} | ||
|
||
class B { | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test77/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,20 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
int k; | ||
|
||
A() { | ||
|
||
} | ||
} | ||
|
||
class B { | ||
|
||
public void m() { | ||
A a = new A(); | ||
a.k = 3; | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test78/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,16 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
int k; | ||
|
||
private A() { | ||
|
||
} | ||
|
||
public void m() { | ||
A a = new A(); | ||
a.k = 3; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test78/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 { | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test78/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,11 @@ | ||
package p1; | ||
|
||
public class A { | ||
|
||
B b; | ||
int k; | ||
|
||
A() { | ||
|
||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test78/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,10 @@ | ||
package p1; | ||
|
||
class B { | ||
|
||
public void m() { | ||
A a = new A(); | ||
a.k = 3; | ||
} | ||
|
||
} |
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