Change Signature: Process internal usages of function parameters when

performing Java refactoring
This commit is contained in:
Alexey Sedunov
2015-07-01 17:16:33 +03:00
parent 5c60a1bdb8
commit 0169963a27
10 changed files with 183 additions and 14 deletions
@@ -0,0 +1,25 @@
open class X: A() {
fun foo(x: Int): String? {
return super.foo(x) + 1
}
}
open class Y: B() {
fun foo(x: Int): String? {
return x.length() * 2
}
}
open class Z: X() {
fun foo(x: Int): String? {
return x.length()
}
}
fun test() {
A().foo("")
B().foo("")
X().foo("")
Y().foo("")
Z().foo("")
}
@@ -0,0 +1,25 @@
import java.lang.Override;
import java.lang.String;
class A {
String <caret>foo(int x) {
return x.length() * 2;
}
}
class B extends A {
@Override
String foo(int x) {
return super.foo(x + "_");
}
}
class Test {
void test() {
new A().foo("");
new B().foo("");
new X().foo("");
new Y().foo("");
new Z().foo("");
}
}
@@ -1,18 +1,18 @@
open class X: A() {
fun foo(s: String): Int {
return super.foo(s)
return super.foo(s) + 1
}
}
open class Y: B() {
fun foo(s: String): Int {
return 0
return s.length() * 2
}
}
open class Z: X() {
fun foo(s: String): Int {
return 0
return s.length()
}
}
@@ -3,14 +3,14 @@ import java.lang.String;
class A {
int <caret>foo(String s) {
return 0;
return s.length() * 2;
}
}
class B extends A {
@Override
int foo(String s) {
return super.foo(s);
return super.foo(s + "_");
}
}
@@ -1,18 +1,18 @@
open class X: A() {
fun foo(x: Int): String? {
return super.foo(1)
return super.foo(1) + 1
}
}
open class Y: B() {
fun foo(x: Int): String? {
return 0
return s.length() * 2
}
}
open class Z: X() {
fun foo(x: Int): String? {
return 0
return s.length()
}
}
@@ -3,7 +3,7 @@ import java.lang.String;
class A {
String foo(int x) {
return 0;
return s.length() * 2;
}
}
@@ -0,0 +1,25 @@
open class X: A() {
fun foo(s: String): Int {
return super.foo(s) + 1
}
}
open class Y: B() {
fun foo(s: String): Int {
return s.length() * 2
}
}
open class Z: X() {
fun foo(s: String): Int {
return s.length()
}
}
fun test() {
A().foo("")
B().foo("")
X().foo("")
Y().foo("")
Z().foo("")
}
@@ -0,0 +1,25 @@
import java.lang.Override;
import java.lang.String;
class A {
int <caret>foo(String s) {
return s.length() * 2;
}
}
class B extends A {
@Override
int foo(String s) {
return super.foo(s + "_");
}
}
class Test {
void test() {
new A().foo("");
new B().foo("");
new X().foo("");
new Y().foo("");
new Z().foo("");
}
}