default -> companion: replace all mentions of default and default object

This commit is contained in:
Pavel V. Talanov
2015-03-16 14:56:06 +03:00
parent a0783757e8
commit 06916d98c6
1019 changed files with 2468 additions and 2469 deletions
@@ -20,7 +20,7 @@ public class X(bar: String? = A.BAR): A() {
super<A>.foo()
}
default object: A() {
companion object: A() {
}
}
@@ -12,7 +12,7 @@ Parameter type (10: 16) fun foo(a: A) {
Parameter type (32: 14) fun X.bar(a: A = A()) {
Super type qualifier (20: 15) super<A>.foo()
Supertype (1: 39) public class X(bar: String? = A.BAR): A() {
Supertype (23: 21) default object: A() {
Supertype (23: 23) companion object: A() {
Supertype (28: 11) object O: A() {
Target type of 'is' operation (37: 24) return if (this is A) this as A else null
Usage in cast target type (37: 35) return if (this is A) this as A else null
@@ -20,7 +20,7 @@ public class X(bar: String? = A.BAR): A() {
super<A>.foo()
}
default object: A() {
companion object: A() {
}
}
@@ -20,7 +20,7 @@ public class X(bar: String? = A.BAR): A() {
super<A>.foo()
}
default object: A() {
companion object: A() {
}
}
@@ -3,5 +3,5 @@ Function call (7: 11) A.foos()
New instance creation (2: 20) var next: A? = A()
New instance creation (32: 18) fun X.bar(a: A = A()) {
Supertype (1: 39) public class X(bar: String? = A.BAR): A() {
Supertype (23: 21) default object: A() {
Supertype (23: 23) companion object: A() {
Supertype (28: 11) object O: A() {
@@ -20,7 +20,7 @@ public class X(bar: String? = A.BAR): A() {
super<A>.foo()
}
default object: A() {
companion object: A() {
}
}
@@ -12,7 +12,7 @@ Parameter type (10: 16) fun foo(a: A) {
Parameter type (32: 14) fun X.bar(a: A = A()) {
Super type qualifier (20: 15) super<A>.foo()
Supertype (1: 39) public class X(bar: String? = A.BAR): A() {
Supertype (23: 21) default object: A() {
Supertype (23: 23) companion object: A() {
Supertype (28: 11) object O: A() {
Target type of 'is' operation (37: 24) return if (this is A) this as A else null
Usage in cast target type (37: 35) return if (this is A) this as A else null
@@ -20,7 +20,7 @@ public class X(bar: String? = Outer.A.BAR): Outer.A() {
super<Outer.A>.foo()
}
default object: Outer.A() {
companion object: Outer.A() {
}
}
@@ -12,7 +12,7 @@ Parameter type (10: 22) fun foo(a: Outer.A) {
Parameter type (32: 20) fun X.bar(a: Outer.A = Outer.A()) {
Super type qualifier (20: 21) super<Outer.A>.foo()
Supertype (1: 51) public class X(bar: String? = Outer.A.BAR): Outer.A() {
Supertype (23: 27) default object: Outer.A() {
Supertype (23: 29) companion object: Outer.A() {
Supertype (28: 17) object O: Outer.A() {
Target type of 'is' operation (37: 30) return if (this is Outer.A) this as Outer.A else null
Usage in cast target type (37: 47) return if (this is Outer.A) this as Outer.A else null
@@ -4,7 +4,7 @@
import kotlin.platform.platformStatic
class Foo {
default <caret>object {
companion <caret>object {
fun f() {
}
@@ -2,7 +2,7 @@ class JavaUsage {
public static void main(String[] args) {
System.out.println(Foo.CONST);
Foo.s();
Foo.Default.f();
Foo foo = new Foo(); // not usage of default object
Foo.Companion.f();
Foo foo = new Foo(); // not usage of companion object
}
}
@@ -1,3 +1,3 @@
Class static member access (3: 28) System.out.println(Foo.CONST);
Class static member access (4: 9) Foo.s();
Unclassified usage (5: 13) Foo.Default.f();
Unclassified usage (5: 13) Foo.Companion.f();
@@ -1,7 +1,7 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetObjectDeclaration
// OPTIONS: usages
class Foo {
default object <caret>Bar {
companion object <caret>Bar {
fun f() {
}
}
@@ -1,7 +1,7 @@
fun main(args: Array<String>) {
val p: Foo = Foo() // simple class usage
// default object usages
// companion object usages
Foo.f()
val x = Foo
@@ -1,4 +1,4 @@
Default object (5: 5) Foo.f()
Default object (6: 13) val x = Foo
Default object (8: 9) Foo.Bar.f()
Default object (9: 18) val xx = Foo.Bar
Companion object (5: 5) Foo.f()
Companion object (6: 13) val x = Foo
Companion object (8: 9) Foo.Bar.f()
Companion object (9: 18) val xx = Foo.Bar
@@ -1,7 +1,7 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetObjectDeclaration
// OPTIONS: usages
class Foo {
default <caret>object {
companion <caret>object {
fun f() {
}
}
@@ -1,10 +1,10 @@
fun main(args: Array<String>) {
val p: Foo = Foo() // simple class usage
// default object usages
// companion object usages
Foo.f()
val x = Foo
Foo.Default.f()
val xx = Foo.Default
Foo.Companion.f()
val xx = Foo.Companion
}
@@ -1,4 +1,4 @@
Default object (5: 5) Foo.f()
Default object (6: 13) val x = Foo
Default object (8: 9) Foo.Default.f()
Default object (9: 18) val xx = Foo.Default
Companion object (5: 5) Foo.f()
Companion object (6: 13) val x = Foo
Companion object (8: 9) Foo.Companion.f()
Companion object (9: 18) val xx = Foo.Companion
@@ -3,7 +3,7 @@
package server
open class <caret>Server {
default object {
companion object {
val NAME = "Server"
}
@@ -3,7 +3,7 @@
package server
open class <caret>Server {
default object {
companion object {
val NAME = "Server"
}
@@ -20,7 +20,7 @@ class Client(name: String = Server.NAME): Server() {
println("Client")
}
default object: Server() {
companion object: Server() {
}
}
@@ -1,14 +1,14 @@
Class/object property type (6: 21) var nextServer: Server? = new Server()
Default object (32: 28) fun Client.bar(s: Server = Server.NAME) {
Default object (5: 29) class Client(name: String = Server.NAME): Server() {
Default object (7: 16) val name = Server.NAME
Companion object (32: 28) fun Client.bar(s: Server = Server.NAME) {
Companion object (5: 29) class Client(name: String = Server.NAME): Server() {
Companion object (7: 16) val name = Server.NAME
Function return types (14: 26) fun getNextServer(): Server? {
Function return types (40: 21) fun Any.asServer(): Server? {
Local variable declaration (10: 21) val server: Server = s
Parameter type (32: 19) fun Client.bar(s: Server = Server.NAME) {
Parameter type (9: 16) fun foo(s: Server) {
Super type qualifier (19: 15) super<Server>.work()
Supertype (23: 21) default object: Server() {
Supertype (23: 23) companion object: Server() {
Supertype (28: 22) object ClientObject: Server() {
Supertype (5: 43) class Client(name: String = Server.NAME): Server() {
Target type of 'is' operation (41: 24) return if (this is Server) this as Server else null
@@ -3,7 +3,7 @@
package server
open class <caret>Server {
default object {
companion object {
val NAME = "Server"
}
@@ -3,7 +3,7 @@
package server
open class <caret>Server {
default object {
companion object {
val NAME = "Server"
}
@@ -1,7 +1,7 @@
Class/object property type (6: 21) var nextServer: Server? = new Server()
Default object (28: 28) fun Client.bar(s: Server = Server.NAME) {
Default object (5: 29) class Client(name: String = Server.NAME): Server() {
Default object (7: 16) val name = Server.NAME
Companion object (28: 28) fun Client.bar(s: Server = Server.NAME) {
Companion object (5: 29) class Client(name: String = Server.NAME): Server() {
Companion object (7: 16) val name = Server.NAME
Function return types (14: 26) fun getNextServer(): Server? {
Function return types (36: 21) fun Any.asServer(): Server? {
Local variable declaration (10: 21) val server: Server = s
@@ -11,7 +11,7 @@ public open class Outer {
}
default object {
companion object {
public var bar: String = "bar";
public open fun foo() {
@@ -24,7 +24,7 @@ public class X(bar: String? = Inner.A.bar): Inner.A() {
super<Inner.A>.foo()
}
default object: Inner.A() {
companion object: Inner.A() {
}
}
@@ -1,8 +1,8 @@
Class/object property type (6: 21) var next: Inner.A? = Inner.A()
Default object (10: 15) Inner.A.bar = ""
Default object (11: 15) Inner.A.foo()
Default object (5: 37) public class X(bar: String? = Inner.A.bar): Inner.A() {
Default object (7: 32) val myBar: String? = Inner.A.bar
Companion object (10: 15) Inner.A.bar = ""
Companion object (11: 15) Inner.A.foo()
Companion object (5: 37) public class X(bar: String? = Inner.A.bar): Inner.A() {
Companion object (7: 32) val myBar: String? = Inner.A.bar
Field declaration (6: 11) Inner.A next = new Inner.A();
Function return types (19: 26) fun getNext(): Inner.A? {
Function return types (40: 22) fun Any.toA(): Inner.A? {
@@ -13,7 +13,7 @@ New instance creation (6: 32) var next: Inner.A? = Inner.A()
Parameter type (14: 22) fun foo(a: Inner.A) {
Parameter type (36: 20) fun X.bar(a: Inner.A = Inner.A()) {
Super type qualifier (24: 21) super<Inner.A>.foo()
Supertype (27: 27) default object: Inner.A() {
Supertype (27: 29) companion object: Inner.A() {
Supertype (32: 17) object O: Inner.A() {
Supertype (5: 51) public class X(bar: String? = Inner.A.bar): Inner.A() {
Target type of 'is' operation (41: 30) return if (this is Inner.A) this as Inner.A else null
@@ -10,7 +10,7 @@ public open class Outer {
}
default object {
companion object {
public var bar: String = "bar";
public open fun foo() {
@@ -24,7 +24,7 @@ public class X(bar: String? = Outer.A.bar): Outer.A() {
super<Outer.A>.foo()
}
default object: Outer.A() {
companion object: Outer.A() {
}
}
@@ -1,8 +1,8 @@
Class/object property type (6: 21) var next: Outer.A? = Outer.A()
Default object (10: 15) Outer.A.bar = ""
Default object (11: 15) Outer.A.foo()
Default object (5: 37) public class X(bar: String? = Outer.A.bar): Outer.A() {
Default object (7: 32) val myBar: String? = Outer.A.bar
Companion object (10: 15) Outer.A.bar = ""
Companion object (11: 15) Outer.A.foo()
Companion object (5: 37) public class X(bar: String? = Outer.A.bar): Outer.A() {
Companion object (7: 32) val myBar: String? = Outer.A.bar
Field declaration (6: 11) Outer.A next = new Outer.A();
Function return types (19: 26) fun getNext(): Outer.A? {
Function return types (40: 22) fun Any.toA(): Outer.A? {
@@ -13,7 +13,7 @@ New instance creation (6: 32) var next: Outer.A? = Outer.A()
Parameter type (14: 22) fun foo(a: Outer.A) {
Parameter type (36: 20) fun X.bar(a: Outer.A = Outer.A()) {
Super type qualifier (24: 21) super<Outer.A>.foo()
Supertype (27: 27) default object: Outer.A() {
Supertype (27: 29) companion object: Outer.A() {
Supertype (32: 17) object O: Outer.A() {
Supertype (5: 51) public class X(bar: String? = Outer.A.bar): Outer.A() {
Target type of 'is' operation (41: 30) return if (this is Outer.A) this as Outer.A else null
@@ -3,7 +3,7 @@
package server
class A {
default object {
companion object {
var <caret>foo: String = "foo"
}
}
@@ -4,9 +4,9 @@ import server.*;
class Client {
void fooBar() {
A.Default.setFoo("a");
A.Companion.setFoo("a");
A.foo = "a";
System.out.println("a.foo = " + A.Default.getFoo());
System.out.println("a.foo = " + A.Companion.getFoo());
System.out.println("a.foo = " + A.foo);
}
}
@@ -1,4 +1,4 @@
Unclassified usage (10: 43) System.out.println("a.foo = " + A.foo);
Unclassified usage (7: 19) A.Default.setFoo("a");
Unclassified usage (7: 21) A.Companion.setFoo("a");
Unclassified usage (8: 11) A.foo = "a";
Unclassified usage (9: 51) System.out.println("a.foo = " + A.Default.getFoo());
Unclassified usage (9: 53) System.out.println("a.foo = " + A.Companion.getFoo());
@@ -3,7 +3,7 @@
package server
trait Some {
default object {
companion object {
val <caret>XX = 1
}
}
@@ -3,7 +3,7 @@
class Outer {
val x = Outer.t
default object {
companion object {
private val <caret>t = 1
}
}
@@ -4,7 +4,7 @@
package server
open class <caret>Server {
default object {
companion object {
val NAME = "Server"
}
@@ -20,7 +20,7 @@ class Client(name: String = Server.NAME): Server() {
println("Client")
}
default object: Server() {
companion object: Server() {
}
}
@@ -1,14 +1,14 @@
Class/object property type (Client) (6: 21) var nextServer: Server? = new Server()
Default object (Client) (5: 29) class Client(name: String = Server.NAME): Server() {
Default object (Client) (7: 16) val name = Server.NAME
Default object (bar) (32: 28) fun Client.bar(s: Server = Server.NAME) {
Companion object (Client) (5: 29) class Client(name: String = Server.NAME): Server() {
Companion object (Client) (7: 16) val name = Server.NAME
Companion object (bar) (32: 28) fun Client.bar(s: Server = Server.NAME) {
Function return types (Client) (14: 26) fun getNextServer(): Server? {
Function return types (asServer) (40: 21) fun Any.asServer(): Server? {
Local variable declaration (Client) (10: 21) val server: Server = s
Parameter type (Client) (9: 16) fun foo(s: Server) {
Parameter type (bar) (32: 19) fun Client.bar(s: Server = Server.NAME) {
Super type qualifier (Client) (19: 15) super<Server>.work()
Supertype (Client) (23: 21) default object: Server() {
Supertype (Client) (23: 23) companion object: Server() {
Supertype (Client) (5: 43) class Client(name: String = Server.NAME): Server() {
Supertype (ClientObject) (28: 22) object ClientObject: Server() {
Target type of 'is' operation (asServer) (41: 24) return if (this is Server) this as Server else null