-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix push down to recognize super class name collisions (#1690)
- fix PushDownRefactoringProcessor to look for method invocations and field accesses to super class members that have names that collide with members in any of the destination types and reference them using super expression - add new test to PushDownTests - fixes #1679
- Loading branch information
Showing
4 changed files
with
185 additions
and
1 deletion.
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/PushDown/test39/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 p; | ||
|
||
class A extends ParentClass { | ||
void m() { | ||
f = 3; | ||
method(); | ||
} | ||
} | ||
class ParentClass { | ||
int f; | ||
void method() { | ||
System.out.println("ParentClass method"); | ||
} | ||
} | ||
class B extends A { | ||
int f; | ||
void method() { | ||
System.out.println("Class B method"); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
org.eclipse.jdt.ui.tests.refactoring/resources/PushDown/test39/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 p; | ||
|
||
class A extends ParentClass { | ||
} | ||
class ParentClass { | ||
int f; | ||
void method() { | ||
System.out.println("ParentClass method"); | ||
} | ||
} | ||
class B extends A { | ||
int f; | ||
void method() { | ||
System.out.println("Class B method"); | ||
} | ||
void m() { | ||
super.f = 3; | ||
super.method(); | ||
} | ||
} |
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