From 3e5c687e9daf5b97abe50e471dc37a8847c97e8e Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 24 Aug 2015 20:17:43 +0200 Subject: [PATCH] additional tests to verify that cases from KT-4793 are fixed #KT-4793 Fixed --- .../RenameKotlinPrimaryConstructorProperty.kt | 10 +++++++++- .../after/testing/JavaImplementor.java | 14 ++++++++++++++ .../RenameKotlinPrimaryConstructorProperty.kt | 10 +++++++++- .../before/testing/JavaImplementor.java | 14 ++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/testing/JavaImplementor.java create mode 100644 idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/testing/JavaImplementor.java diff --git a/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/RenameKotlinPrimaryConstructorProperty.kt b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/RenameKotlinPrimaryConstructorProperty.kt index 1a51aa953bf..e901547c5a5 100644 --- a/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/RenameKotlinPrimaryConstructorProperty.kt +++ b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/RenameKotlinPrimaryConstructorProperty.kt @@ -1,3 +1,11 @@ package testing.rename -public class Foo(public val /*rename*/second: String) +public open class Foo(public open val /*rename*/second: String) + +public class Bar : Foo("abc") { + override val second = "xyzzy" +} + +fun usages(f: Foo, b: Bar): String { + return f.second + b.second +} diff --git a/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/testing/JavaImplementor.java b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/testing/JavaImplementor.java new file mode 100644 index 00000000000..24648eab51d --- /dev/null +++ b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/after/testing/JavaImplementor.java @@ -0,0 +1,14 @@ +package testng; + +import testing.rename.Foo; + +public class FooImpl extends Foo { + public FooImpl(String first) { + super(first); + } + + @Override + public int getSecond() { + return "abc"; + } +} \ No newline at end of file diff --git a/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/RenameKotlinPrimaryConstructorProperty.kt b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/RenameKotlinPrimaryConstructorProperty.kt index df2052a6011..0f402cbd263 100644 --- a/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/RenameKotlinPrimaryConstructorProperty.kt +++ b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/RenameKotlinPrimaryConstructorProperty.kt @@ -1,3 +1,11 @@ package testing.rename -public class Foo(public val /*rename*/first: String) +public open class Foo(public open val /*rename*/first: String) + +public class Bar : Foo("abc") { + override val first = "xyzzy" +} + +fun usages(f: Foo, b: Bar): String { + return f.first + b.first +} diff --git a/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/testing/JavaImplementor.java b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/testing/JavaImplementor.java new file mode 100644 index 00000000000..1117f7f870e --- /dev/null +++ b/idea/testData/refactoring/rename/renameKotlinPrimaryConstructorProperty/before/testing/JavaImplementor.java @@ -0,0 +1,14 @@ +package testng; + +import testing.rename.Foo; + +public class FooImpl extends Foo { + public FooImpl(String first) { + super(first); + } + + @Override + public int getFirst() { + return "abc"; + } +} \ No newline at end of file