Deprecate throws annotation in favor of Throws

This commit is contained in:
Denis Zharkov
2015-09-01 17:34:20 +03:00
parent 9254b1b461
commit 2b76941733
21 changed files with 44 additions and 44 deletions
@@ -11,7 +11,7 @@ class Test : Base() {
return super.equals(o)
}
throws(CloneNotSupportedException::class)
Throws(CloneNotSupportedException::class)
override fun clone(): Any {
return super.clone()
}
@@ -20,7 +20,7 @@ class Test : Base() {
return super.toString()
}
throws(Throwable::class)
Throws(Throwable::class)
override fun finalize() {
super.finalize()
}
@@ -35,7 +35,7 @@ open class Base {
return super.equals(o)
}
throws(CloneNotSupportedException::class)
Throws(CloneNotSupportedException::class)
protected open fun clone(): Any {
return super.clone()
}
@@ -44,7 +44,7 @@ open class Base {
return super.toString()
}
throws(Throwable::class)
Throws(Throwable::class)
protected open fun finalize() {
super.finalize()
}
+2 -2
View File
@@ -12,14 +12,14 @@ class X {
return super.toString()
}
throws(CloneNotSupportedException::class)
Throws(CloneNotSupportedException::class)
protected fun clone(): Any {
return super.clone()
}
}
class Y : Thread() {
throws(CloneNotSupportedException::class)
Throws(CloneNotSupportedException::class)
override fun clone(): Any {
return super.clone()
}
+1 -1
View File
@@ -14,7 +14,7 @@ class X : Base() {
return super.toString()
}
throws(CloneNotSupportedException::class)
Throws(CloneNotSupportedException::class)
protected fun clone(): Any {
return super.clone()
}
+1 -1
View File
@@ -1,2 +1,2 @@
throws(IOException::class, SerializationException::class)
Throws(IOException::class, SerializationException::class)
fun foo()
+1 -1
View File
@@ -1,7 +1,7 @@
import java.lang.reflect.Constructor
object X {
throws(Exception::class)
Throws(Exception::class)
fun <T> foo(constructor: Constructor<T>, args1: Array<Any>, args2: Array<Any>) {
constructor.newInstance(*args1)
constructor.newInstance(args1, args2)
+1 -1
View File
@@ -1,7 +1,7 @@
import java.io.*
public class C {
throws(IOException::class)
Throws(IOException::class)
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream ->
// reading something
@@ -1,7 +1,7 @@
import java.io.*
public class C {
throws(IOException::class)
Throws(IOException::class)
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { input ->
ByteArrayOutputStream().use { output ->
+1 -1
View File
@@ -1,7 +1,7 @@
import java.io.*
public class C {
throws(IOException::class)
Throws(IOException::class)
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream -> println(stream.read()) }
}
+1 -1
View File
@@ -1,7 +1,7 @@
import java.io.*
public class C {
throws(IOException::class)
Throws(IOException::class)
fun foo() {
try {
ByteArrayInputStream(ByteArray(10)).use { stream ->
@@ -1,16 +1,16 @@
import java.io.*
interface I {
throws(IOException::class)
Throws(IOException::class)
public fun doIt(stream: InputStream): Int
}
public class C {
throws(IOException::class)
Throws(IOException::class)
fun foo() {
ByteArrayInputStream(ByteArray(10)).use { stream ->
bar(object : I {
throws(IOException::class)
Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
@@ -18,7 +18,7 @@ public class C {
}
}
throws(IOException::class)
Throws(IOException::class)
fun bar(i: I, stream: InputStream): Int {
return i.doIt(stream)
}
@@ -1,16 +1,16 @@
import java.io.*
interface I {
throws(IOException::class)
Throws(IOException::class)
public fun doIt(stream: InputStream): Int
}
public class C {
throws(IOException::class)
Throws(IOException::class)
fun foo(): Int {
ByteArrayInputStream(ByteArray(10)).use { stream ->
return bar(object : I {
throws(IOException::class)
Throws(IOException::class)
override fun doIt(stream: InputStream): Int {
return stream.available()
}
@@ -18,7 +18,7 @@ public class C {
}
}
throws(IOException::class)
Throws(IOException::class)
fun bar(i: I, stream: InputStream): Int {
return i.doIt(stream)
}