J2K: adapted for default visibility modifier 'public'

This commit is contained in:
Valentin Kipyatkov
2015-09-15 11:29:27 +03:00
parent 1ccbda6af4
commit c3ddd5d32b
477 changed files with 1359 additions and 1350 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
package pack
class C JvmOverloads constructor(arg1: Int, arg2: Int = 0, arg3: Int = 0)
internal class C JvmOverloads internal constructor(arg1: Int, arg2: Int = 0, arg3: Int = 0)
public object User {
public fun main() {
object User {
fun main() {
val c1 = C(100, 100, 100)
val c2 = C(100, 100)
val c3 = C(100)
@@ -1,13 +1,13 @@
class C(val myArg1: Int) {
var myArg2: Int = 0
var myArg3: Int = 0
internal class C internal constructor(internal val myArg1: Int) {
internal var myArg2: Int = 0
internal var myArg3: Int = 0
constructor(arg1: Int, arg2: Int, arg3: Int) : this(arg1) {
internal constructor(arg1: Int, arg2: Int, arg3: Int) : this(arg1) {
myArg2 = arg2
myArg3 = arg3
}
constructor(arg1: Int, arg2: Int) : this(arg1) {
internal constructor(arg1: Int, arg2: Int) : this(arg1) {
myArg2 = arg2
myArg3 = 0
}
@@ -18,8 +18,8 @@ class C(val myArg1: Int) {
}
}
public object User {
public fun main() {
object User {
fun main() {
val c1 = C(100, 100, 100)
val c2 = C(100, 100)
val c3 = C(100)
@@ -1,14 +1,14 @@
// ERROR: Property must be initialized or be abstract
public class Test {
class Test {
private val s: String
var b: Boolean = false
var d: Double = 0.toDouble()
internal var b: Boolean = false
internal var d: Double = 0.toDouble()
public constructor() {
constructor() {
b = true
}
public constructor(s: String) {
constructor(s: String) {
this.s = s
}
}
+5 -5
View File
@@ -1,16 +1,16 @@
class C(arg1: Int, arg2: Int, arg3: Int) {
internal class C internal constructor(arg1: Int, arg2: Int, arg3: Int) {
constructor(arg1: Int, arg2: Int) : this(arg1, arg2, 0) {
internal constructor(arg1: Int, arg2: Int) : this(arg1, arg2, 0) {
println()
}
constructor(arg1: Int) : this(arg1, 0) {
internal constructor(arg1: Int) : this(arg1, 0) {
println()
}
}
public object User {
public fun main() {
object User {
fun main() {
val c1 = C(1, 2, 3)
val c2 = C(5, 6)
val c3 = C(7)
@@ -1,16 +1,16 @@
import javaApi.Anon5
class A
internal class A
Anon5(10)
constructor(private val a: Int, private val b: Int) {
Deprecated("") // this constructor will not be replaced by default parameter value in primary because of this annotation
public constructor(a: Int) : this(a, 1) {
constructor(a: Int) : this(a, 1) {
}
}
class B Anon5(11)
internal class B Anon5(11)
constructor()
class C Anon5(12)
internal class C Anon5(12)
private constructor()
+9 -9
View File
@@ -1,6 +1,6 @@
package org.test.customer
class Customer(public val firstName: String, public val lastName: String) {
internal class Customer internal constructor(val firstName: String, val lastName: String) {
init {
doSmthBefore()
@@ -14,27 +14,27 @@ class Customer(public val firstName: String, public val lastName: String) {
}
}
class CustomerBuilder {
public var _firstName: String = "Homer"
public var _lastName: String = "Simpson"
internal class CustomerBuilder {
var _firstName: String = "Homer"
var _lastName: String = "Simpson"
public fun WithFirstName(firstName: String): CustomerBuilder {
fun WithFirstName(firstName: String): CustomerBuilder {
_firstName = firstName
return this
}
public fun WithLastName(lastName: String): CustomerBuilder {
fun WithLastName(lastName: String): CustomerBuilder {
_lastName = lastName
return this
}
public fun Build(): Customer {
fun Build(): Customer {
return Customer(_firstName, _lastName)
}
}
public object User {
public fun main() {
object User {
fun main() {
val customer = CustomerBuilder().WithFirstName("Homer").WithLastName("Simpson").Build()
println(customer.firstName)
println(customer.lastName)
@@ -1 +1 @@
class C(private val p1: Int, private val myP2: Int, public var p3: Int)
internal class C(private val p1: Int, private val myP2: Int, var p3: Int)
@@ -1,4 +1,4 @@
class C(private val field: Int) {
internal class C(private val field: Int) {
init {
println(field)
@@ -1,4 +1,4 @@
class C(p: Int) {
internal class C(p: Int) {
private val p: Int
init {
@@ -1,5 +1,5 @@
class C(p: Int, c: C) {
public var p: Int = 0
internal class C(p: Int, c: C) {
var p: Int = 0
init {
c.p = p
@@ -1,5 +1,5 @@
class C(p: Int) {
public var p: Int = 0
internal class C(p: Int) {
var p: Int = 0
init {
this.p = 0
@@ -1,5 +1,5 @@
class C(x: String) {
public var x: Any
internal class C(x: String) {
var x: Any
init {
this.x = x
@@ -1,6 +1,6 @@
// ERROR: Property must be initialized or be abstract
class C(x: Any, b: Boolean) {
public var x: Any
internal class C(x: Any, b: Boolean) {
var x: Any
init {
if (b) {
@@ -1,3 +1,3 @@
open class Base(o: Any, l: Int)
internal open class Base internal constructor(o: Any, l: Int)
class C(private val string: String) : Base(string, string.length())
internal class C(private val string: String) : Base(string, string.length())
@@ -1 +1 @@
class C JvmOverloads constructor(private val string: String, a: Int = string.length())
internal class C JvmOverloads constructor(private val string: String, a: Int = string.length())
@@ -1,3 +1,3 @@
import java.lang.SuppressWarnings
class C(Deprecated("") private val p1: Int, Deprecated("") private val myP2: Int, Deprecated("") SuppressWarnings("x") public var p3: Int)
internal class C(Deprecated("") private val p1: Int, Deprecated("") private val myP2: Int, Deprecated("") SuppressWarnings("x") var p3: Int)
@@ -1,27 +1,27 @@
// ERROR: Property must be initialized or be abstract
public class Identifier<T> {
public val name: T
class Identifier<T> {
val name: T
private val myHasDollar: Boolean
private var myNullable = true
public constructor(name: T) {
constructor(name: T) {
this.name = name
}
public constructor(name: T, isNullable: Boolean) {
constructor(name: T, isNullable: Boolean) {
this.name = name
myNullable = isNullable
}
public constructor(name: T, hasDollar: Boolean, isNullable: Boolean) {
constructor(name: T, hasDollar: Boolean, isNullable: Boolean) {
this.name = name
myHasDollar = hasDollar
myNullable = isNullable
}
}
public object User {
public fun main() {
object User {
fun main() {
val i1 = Identifier("name", false, true)
val i2 = Identifier("name", false)
val i3 = Identifier("name")
+7 -7
View File
@@ -1,27 +1,27 @@
// ERROR: Property must be initialized or be abstract
public class Identifier {
public val name: String
class Identifier {
val name: String
private val myHasDollar: Boolean
private var myNullable = true
public constructor(name: String) {
constructor(name: String) {
this.name = name
}
public constructor(name: String, isNullable: Boolean) {
constructor(name: String, isNullable: Boolean) {
this.name = name
myNullable = isNullable
}
public constructor(name: String, hasDollar: Boolean, isNullable: Boolean) {
constructor(name: String, hasDollar: Boolean, isNullable: Boolean) {
this.name = name
myHasDollar = hasDollar
myNullable = isNullable
}
}
public object User {
public fun main() {
object User {
fun main() {
val i1 = Identifier("name", false, true)
val i2 = Identifier("name", false)
val i3 = Identifier("name")
@@ -1,12 +1,12 @@
class C1(arg1: Int,
arg2: Int,
arg3: Int) {
internal class C1 internal constructor(arg1: Int,
arg2: Int,
arg3: Int) {
constructor(x: Int,
y: Int) : this(x, x + y, 0) {
internal constructor(x: Int,
y: Int) : this(x, x + y, 0) {
}
}
class C2(private val arg1: Int,
private val arg2: Int,
arg3: Int)
internal class C2 internal constructor(private val arg1: Int,
private val arg2: Int,
arg3: Int)
@@ -1,10 +1,10 @@
class C(private val arg1: Int, private val arg2: Int, private val arg3: Int) {
internal class C internal constructor(private val arg1: Int, private val arg2: Int, private val arg3: Int) {
fun foo(p: Int): Int {
internal fun foo(p: Int): Int {
return p
}
constructor(arg1: Int, arg2: Int, other: C) : this(arg1, arg2, 0) {
internal constructor(arg1: Int, arg2: Int, other: C) : this(arg1, arg2, 0) {
println(foo(1) + this.foo(2) + other.foo(3) + staticFoo(4) + C.staticFoo(5))
}
@@ -13,7 +13,7 @@ class C(private val arg1: Int, private val arg2: Int, private val arg3: Int) {
return p
}
public fun staticFoo2(): Int {
fun staticFoo2(): Int {
return 0
}
}
@@ -1,9 +1,9 @@
class A JvmOverloads constructor(nested: A.Nested = A.Nested(A.Nested.FIELD)) {
internal class A JvmOverloads internal constructor(nested: A.Nested = A.Nested(A.Nested.FIELD)) {
class Nested(p: Int) {
internal class Nested internal constructor(p: Int) {
companion object {
public val FIELD: Int = 0
val FIELD: Int = 0
}
}
}
@@ -1,16 +1,16 @@
// ERROR: Property must be initialized or be abstract
import A.Nested
class A JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
internal class A JvmOverloads internal constructor(nested: Nested = Nested(Nested.FIELD)) {
class Nested(p: Int) {
internal class Nested internal constructor(p: Int) {
companion object {
public val FIELD: Int = 0
val FIELD: Int = 0
}
}
}
class B {
var nested: Nested
internal class B {
internal var nested: Nested
}
@@ -3,16 +3,16 @@ package pack
import pack.A.Nested
class A JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
internal class A JvmOverloads internal constructor(nested: Nested = Nested(Nested.FIELD)) {
class Nested(p: Int) {
internal class Nested internal constructor(p: Int) {
companion object {
public val FIELD: Int = 0
val FIELD: Int = 0
}
}
}
class B {
var nested: Nested
internal class B {
internal var nested: Nested
}
@@ -3,16 +3,16 @@ package pack
import pack.A.*
class A JvmOverloads constructor(nested: Nested = Nested(Nested.FIELD)) {
internal class A JvmOverloads internal constructor(nested: Nested = Nested(Nested.FIELD)) {
class Nested(p: Int) {
internal class Nested internal constructor(p: Int) {
companion object {
public val FIELD: Int = 0
val FIELD: Int = 0
}
}
}
class B {
var nested: Nested
internal class B {
internal var nested: Nested
}
@@ -1,11 +1,11 @@
open class Base(nested: Base.Nested) {
internal open class Base internal constructor(nested: Base.Nested) {
class Nested(p: Int) {
internal class Nested internal constructor(p: Int) {
companion object {
public val FIELD: Int = 0
val FIELD: Int = 0
}
}
}
class Derived : Base(Base.Nested(Base.Nested.FIELD))
internal class Derived internal constructor() : Base(Base.Nested(Base.Nested.FIELD))
+7 -7
View File
@@ -1,20 +1,20 @@
open class Base
internal open class Base
class C : Base {
constructor(arg1: Int, arg2: Int, arg3: Int) {
internal class C : Base {
internal constructor(arg1: Int, arg2: Int, arg3: Int) {
}
constructor(arg1: Int, arg2: Int) : this(arg1, arg2, 0) {
internal constructor(arg1: Int, arg2: Int) : this(arg1, arg2, 0) {
println()
}
constructor(arg: Int) {
internal constructor(arg: Int) {
println(arg)
}
}
public object User {
public fun main() {
object User {
fun main() {
val c1 = C(1, 2, 3)
val c2 = C(5, 6)
val c3 = C(7)
@@ -1,7 +1,7 @@
package pack
class C JvmOverloads constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
internal class C JvmOverloads internal constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
constructor(a: Int) : this(a, 0, 0, 0, 1) {
internal constructor(a: Int) : this(a, 0, 0, 0, 1) {
}
}
@@ -1,10 +1,10 @@
package pack
class C JvmOverloads constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
internal class C JvmOverloads internal constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
constructor(a1: Int, b1: Int, c1: Int) : this(a1, b1, c1, 0, 0) {
internal constructor(a1: Int, b1: Int, c1: Int) : this(a1, b1, c1, 0, 0) {
}
constructor(b: Byte) : this(b.toInt(), 0, 0, 0, 0) {
internal constructor(b: Byte) : this(b.toInt(), 0, 0, 0, 0) {
}
}
@@ -1,7 +1,7 @@
package pack
class C JvmOverloads constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
internal class C JvmOverloads internal constructor(a: Int = 0, b: Int = 0, c: Int = 0, d: Int = 0, e: Int = 0) {
constructor(a: Int, b: Int, c: Int) : this(b, a, c, 0, 0) {
internal constructor(a: Int, b: Int, c: Int) : this(b, a, c, 0, 0) {
}
}
@@ -1,3 +1,3 @@
package pack
class C JvmOverloads constructor(a: Int = 1, b: Int = 2, c: Int = 3, d: Int = 4, e: Int = 5)
internal class C JvmOverloads internal constructor(a: Int = 1, b: Int = 2, c: Int = 3, d: Int = 4, e: Int = 5)
@@ -1,3 +1,3 @@
package pack
class C JvmOverloads constructor(a: Int = 1, b: Int = 2, c: Int = 3, d: Int = 4, e: Int = 5)
internal class C JvmOverloads internal constructor(a: Int = 1, b: Int = 2, c: Int = 3, d: Int = 4, e: Int = 5)
@@ -1,4 +1,4 @@
class C JvmOverloads constructor(arg1: Int, arg2: Int = 0, arg3: Int = 0) {
internal class C JvmOverloads internal constructor(arg1: Int, arg2: Int = 0, arg3: Int = 0) {
private val field: Int
init {
@@ -10,14 +10,14 @@ class C JvmOverloads constructor(arg1: Int, arg2: Int = 0, arg3: Int = 0) {
arg3++
}
constructor(arg1: Int, arg2: Int) : this(arg1, arg2, 0) {
internal constructor(arg1: Int, arg2: Int) : this(arg1, arg2, 0) {
var arg2 = arg2
arg2++
}
}
public object User {
public fun main() {
object User {
fun main() {
val c1 = C(100, 100, 100)
val c2 = C(100, 100)
val c3 = C(100)
@@ -1,5 +1,5 @@
class C private constructor(arg1: Int, arg2: Int, arg3: Int = 0) {
internal class C private constructor(arg1: Int, arg2: Int, arg3: Int = 0) {
public constructor(arg1: Int) : this(arg1, 0, 0) {
constructor(arg1: Int) : this(arg1, 0, 0) {
}
}
@@ -1,12 +1,12 @@
class C(private val arg1: Int, private val arg2: Int, private val arg3: Int) {
internal class C internal constructor(private val arg1: Int, private val arg2: Int, private val arg3: Int) {
constructor(arg1: Int, arg2: Int, other: C) : this(arg1, arg2, 0) {
internal constructor(arg1: Int, arg2: Int, other: C) : this(arg1, arg2, 0) {
println(this.arg1 + other.arg2)
}
}
class User {
fun foo() {
internal class User {
internal fun foo() {
val c1 = C(100, 100, 100)
val c2 = C(100, 100, c1)
}
@@ -1,13 +1,13 @@
// ERROR: Val cannot be reassigned
// ERROR: Val cannot be reassigned
class A {
internal class A {
private val s = ""
private val x = 0
public constructor() {
constructor() {
}
JvmOverloads public constructor(p: Int, s: String, x: Int = 1) {
JvmOverloads constructor(p: Int, s: String, x: Int = 1) {
this.s = s
this.x = x
}
@@ -1,10 +1,10 @@
// ERROR: Val cannot be reassigned
// ERROR: Val cannot be reassigned
class A() {
internal class A() {
private val s = ""
private val x = 0
JvmOverloads public constructor(p: Int, s: String, x: Int = 1) : this() {
JvmOverloads constructor(p: Int, s: String, x: Int = 1) : this() {
this.s = s
this.x = x
}
@@ -1,7 +1,7 @@
class Outer {
internal class Outer {
private inner class Inner1() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -13,7 +13,7 @@ class Outer {
protected inner class Inner2() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -24,9 +24,9 @@ class Outer {
}
inner class Inner3() {
internal inner class Inner3() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -36,9 +36,9 @@ class Outer {
}
}
public inner class Inner4() {
inner class Inner4() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -48,7 +48,7 @@ class Outer {
}
}
fun foo() {
internal fun foo() {
val inner1 = Inner1(1)
val inner2 = Inner2(2)
val inner3 = Inner3(3)
@@ -1,7 +1,7 @@
object Outer {
internal object Outer {
private class Nested1() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -13,7 +13,7 @@ object Outer {
protected class Nested2() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -24,9 +24,9 @@ object Outer {
}
class Nested3() {
internal class Nested3() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -36,9 +36,9 @@ object Outer {
}
}
public class Nested4() {
class Nested4() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
@@ -48,7 +48,7 @@ object Outer {
}
}
fun foo() {
internal fun foo() {
val nested1 = Nested1(1)
val nested2 = Nested2(2)
val nested3 = Nested3(3)
@@ -1,27 +1,27 @@
class A() {
internal class A() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
}
constructor(f: Float) : this() {
internal constructor(f: Float) : this() {
}
private constructor(d: Double) : this() {
}
}
public class B() {
class B() {
public constructor(a: Int) : this() {
constructor(a: Int) : this() {
}
protected constructor(c: Char) : this() {
}
constructor(f: Float) : this() {
internal constructor(f: Float) : this() {
}
private constructor(d: Double) : this() {
@@ -1,6 +1,6 @@
class C() {
internal class C internal constructor() {
constructor(p: Int) : this() {
internal constructor(p: Int) : this() {
println(staticField1 + C.staticField2)
}
@@ -1,31 +1,31 @@
// ERROR: Property must be initialized or be abstract
public class Test {
class Test {
private val myName: String
var a: Boolean = false
var b: Double = 0.toDouble()
var c: Float = 0.toFloat()
var d: Long = 0
var e: Int = 0
internal var a: Boolean = false
internal var b: Double = 0.toDouble()
internal var c: Float = 0.toFloat()
internal var d: Long = 0
internal var e: Int = 0
protected var f: Short = 0
protected var g: Char = ' '
public constructor() {
constructor() {
}
public constructor(name: String) {
constructor(name: String) {
myName = foo(name)
}
companion object {
fun foo(n: String): String {
internal fun foo(n: String): String {
return ""
}
}
}
public object User {
public fun main() {
object User {
fun main() {
val t = Test("name")
}
}