Deprecate throws annotation in favor of Throws
This commit is contained in:
@@ -524,7 +524,7 @@ public class FunctionCodegen {
|
||||
|
||||
@NotNull
|
||||
public static String[] getThrownExceptions(@NotNull FunctionDescriptor function, @NotNull final JetTypeMapper mapper) {
|
||||
AnnotationDescriptor annotation = function.getAnnotations().findAnnotation(new FqName("kotlin.throws"));
|
||||
AnnotationDescriptor annotation = function.getAnnotations().findAnnotation(new FqName("kotlin.Throws"));
|
||||
if (annotation == null) return ArrayUtil.EMPTY_STRING_ARRAY;
|
||||
|
||||
Collection<ConstantValue<?>> values = annotation.getAllValueArguments().values();
|
||||
|
||||
@@ -4,12 +4,12 @@ class E1: Exception()
|
||||
class E2: Exception()
|
||||
|
||||
class Test {
|
||||
throws()
|
||||
@Throws()
|
||||
fun none() {}
|
||||
|
||||
throws(E1::class)
|
||||
@Throws(E1::class)
|
||||
fun one() {}
|
||||
|
||||
throws(E1::class, E2::class)
|
||||
@Throws(E1::class, E2::class)
|
||||
fun two() {}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package test
|
||||
class E1: Exception()
|
||||
class E2: Exception()
|
||||
|
||||
class None @throws() constructor() {}
|
||||
class One @throws(E1::class) constructor()
|
||||
class Two @throws(E1::class, E2::class) constructor()
|
||||
class None @Throws() constructor() {}
|
||||
class One @Throws(E1::class) constructor()
|
||||
class Two @Throws(E1::class, E2::class) constructor()
|
||||
|
||||
class OneWithParam @throws(E1::class) constructor(a: Int)
|
||||
class OneWithParam @Throws(E1::class) constructor(a: Int)
|
||||
@@ -2,10 +2,10 @@ package test
|
||||
|
||||
class E1: Exception()
|
||||
|
||||
throws(E1::class) jvmOverloads
|
||||
Throws(E1::class) jvmOverloads
|
||||
fun one(a: Int = 1) {}
|
||||
|
||||
class One @throws(E1::class) constructor(a: Int = 1) {
|
||||
throws(E1::class)
|
||||
class One @Throws(E1::class) constructor(a: Int = 1) {
|
||||
@Throws(E1::class)
|
||||
fun one(a: Int = 1) {}
|
||||
}
|
||||
@@ -4,13 +4,13 @@ class E1: Exception()
|
||||
class E2: Exception()
|
||||
|
||||
interface Trait {
|
||||
throws()
|
||||
@Throws()
|
||||
fun none()
|
||||
|
||||
throws(E1::class)
|
||||
@Throws(E1::class)
|
||||
fun one()
|
||||
|
||||
throws(E1::class, E2::class)
|
||||
@Throws(E1::class, E2::class)
|
||||
fun two()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package test
|
||||
class E1: Exception()
|
||||
|
||||
interface Base<T> {
|
||||
throws(E1::class)
|
||||
@Throws(E1::class)
|
||||
fun one(t: T) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ package test
|
||||
class E1: Exception()
|
||||
class E2: Exception()
|
||||
|
||||
throws()
|
||||
@Throws()
|
||||
fun none() {}
|
||||
|
||||
throws(E1::class)
|
||||
@Throws(E1::class)
|
||||
fun one() {}
|
||||
|
||||
throws(E1::class, E2::class)
|
||||
@Throws(E1::class, E2::class)
|
||||
fun two() {}
|
||||
@@ -4,13 +4,13 @@ class E1: Exception()
|
||||
class E2: Exception()
|
||||
|
||||
interface Trait {
|
||||
throws()
|
||||
@Throws()
|
||||
fun none() {}
|
||||
|
||||
throws(E1::class)
|
||||
@Throws(E1::class)
|
||||
fun one() {}
|
||||
|
||||
throws(E1::class, E2::class)
|
||||
@Throws(E1::class, E2::class)
|
||||
fun two() {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user