Java to Kotlin converter: fixed overriding of Object methods

This commit is contained in:
Valentin Kipyatkov
2014-06-04 15:12:37 +04:00
parent dcfa396b50
commit 118b23061b
12 changed files with 169 additions and 222 deletions
@@ -1,23 +1,23 @@
package test
class Test() {
public fun hashCode(): Int {
return System.identityHashCode(this)
class X() {
override fun hashCode(): Int {
return super.hashCode()
}
public fun equals(o: Any): Boolean {
return this.identityEquals(o)
override fun equals(other: Any?): Boolean {
return super.equals(o)
}
override fun toString(): String {
return super.toString()
}
protected fun clone(): Any {
return super.clone()
}
}
public fun toString(): String {
return getJavaClass<Test>.getName() + '@' + Integer.toHexString(hashCode())
}
protected fun finalize() {
super.finalize()
class Y() : Thread() {
override fun clone(): Any {
return super.clone()
}
}