Move top-level declarations: Implement refactoring processor

This commit is contained in:
Alexey Sedunov
2014-03-17 15:45:17 +04:00
parent 5836bb41b6
commit abcba89ad3
269 changed files with 2302 additions and 5 deletions
@@ -0,0 +1,7 @@
package a
import b.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package a
import b.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,7 @@
package a
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package a
import b.Test
fun test(): Test {
return Test()
}
@@ -0,0 +1,9 @@
package a;
import b.Test;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package a
import b.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package a
import b.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,10 @@
package b
class Test {
val aFoo: a.Foo = a.Foo()
val bFoo: Foo = Foo()
val cFoo: c.Foo = c.Foo()
val aBar: a.Foo.Bar = a.Foo.Bar()
val bBar: Foo.Bar = Foo.Bar()
val cBar: c.Foo.Bar = c.Foo.Bar()
}
@@ -0,0 +1,7 @@
package b
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,5 @@
package b
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package b
import a.*
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package b
import b.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package b
import b.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,7 @@
package c
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,9 @@
package c;
import b.Test;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package c
import b.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,9 @@
package c;
import b.Test;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,8 @@
package c
import a.*
import b.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,9 @@
package c;
import b.Test;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package c
import b.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package c
import b.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,5 @@
package a
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package a
import a.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,7 @@
package a
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,14 @@
package a
class <caret>Test {
val aFoo: Foo = Foo()
val bFoo: b.Foo = b.Foo()
val cFoo: c.Foo = c.Foo()
val aBar: Foo.Bar = Foo.Bar()
val bBar: b.Foo.Bar = b.Foo.Bar()
val cBar: c.Foo.Bar = c.Foo.Bar()
}
fun test(): Test {
return Test()
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package a
import a.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,7 @@
package b
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
a.Test t = new a.Test();
}
}
@@ -0,0 +1,5 @@
package b
fun bar() {
val t: a.Test = a.Test()
}
@@ -0,0 +1,9 @@
package b;
import a.*;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package b
import a.*
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,9 @@
package b;
import a.Test;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package b
import a.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package b
import a.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,7 @@
package c
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
a.Test t = new a.Test();
}
}
@@ -0,0 +1,5 @@
package c
fun bar() {
val t: a.Test = a.Test()
}
@@ -0,0 +1,9 @@
package c;
import a.*;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package c
import a.*
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,9 @@
package c;
import a.Test;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,7 @@
package c
import a.Test
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,7 @@
package c
import a.Test as _Test
fun bar() {
val t: _Test = _Test()
}
@@ -0,0 +1,5 @@
{
"mainFile": "a/main.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetPackage": "b"
}
@@ -0,0 +1,9 @@
package a
private class Foo {
}
private fun foo(value: Foo) {
}
@@ -0,0 +1,7 @@
package a
private class Test {
fun test {
foo(Foo())
}
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,9 @@
package a
private class Foo {
}
private fun foo(value: Foo) {
}
@@ -0,0 +1,7 @@
package a
private class <caret>Test {
fun test {
foo(Foo())
}
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
Test t = new Test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
val t: Test = Test()
}
@@ -0,0 +1,4 @@
Class a.Test uses package-private class a.Foo
Class a.Test uses package-private function a.foo
Package-private class a.Test will no longer be accessible from method J.bar()
Package-private class a.Test will no longer be accessible from property a.bar.t
@@ -0,0 +1,5 @@
{
"mainFile": "a/main.kt",
"type": "MOVE_KOTLIN_TOP_LEVEL_DECLARATIONS",
"targetPackage": "b"
}
@@ -0,0 +1,5 @@
package a
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package a
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,7 @@
package a
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package a
class Test {
fun foo() {
b.test()
}
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package a
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package a;
import static b.BPackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,7 @@
package b
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,5 @@
package b
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package b
import a.*
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package b
import b.test
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package b
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package b;
import static b.BPackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,10 @@
package b
fun test {
val aFoo: a.Foo = a.Foo()
val bFoo: Foo = Foo()
val cFoo: c.Foo = c.Foo()
val aBar: a.Foo.Bar = a.Foo.Bar()
val bBar: Foo.Bar = Foo.Bar()
val cBar: c.Foo.Bar = c.Foo.Bar()
}
@@ -0,0 +1,7 @@
package c
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,5 @@
package c
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package c
import a.*
fun bar() {
b.test()
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package c;
class J {
void bar() {
b.BPackage.test();
}
}
@@ -0,0 +1,7 @@
package c
import b.test
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package c
import b.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package c;
import static b.BPackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
test()
}
@@ -0,0 +1,7 @@
package a
import a.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,7 @@
package a
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,16 @@
package a
fun <caret>test {
val aFoo: Foo = Foo()
val bFoo: b.Foo = b.Foo()
val cFoo: c.Foo = c.Foo()
val aBar: Foo.Bar = Foo.Bar()
val bBar: b.Foo.Bar = b.Foo.Bar()
val cBar: c.Foo.Bar = c.Foo.Bar()
}
class Test {
fun foo() {
test()
}
}
@@ -0,0 +1,7 @@
package a;
class J {
void bar() {
APackage.test();
}
}
@@ -0,0 +1,5 @@
package a
fun bar() {
test()
}
@@ -0,0 +1,9 @@
package a;
import static a.APackage.*;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,7 @@
package a
import a.test as _test
fun bar() {
_test()
}
@@ -0,0 +1,9 @@
package a;
import static a.APackage.test;
class J {
void bar() {
test();
}
}
@@ -0,0 +1,7 @@
package b
open class Foo {
open class Bar {
}
}
@@ -0,0 +1,7 @@
package b;
class J {
void bar() {
a.APackage.test();
}
}
@@ -0,0 +1,5 @@
package b
fun bar() {
a.test()
}

Some files were not shown because too many files have changed in this diff Show More