diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java index 4d479379fec..c656d502391 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java @@ -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> values = annotation.getAllValueArguments().values(); diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.kt index e8b80ecf21b..b052f2489d9 100644 --- a/compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.kt +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/ClassMembers.kt @@ -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() {} } \ No newline at end of file diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.kt index cf67599c7ec..54c26c4fac2 100644 --- a/compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.kt +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/Constructor.kt @@ -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) \ No newline at end of file +class OneWithParam @Throws(E1::class) constructor(a: Int) \ No newline at end of file diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.kt index becfa1897be..b41adeac603 100644 --- a/compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.kt +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/DefaultArgs.kt @@ -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) {} } \ No newline at end of file diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.kt index 9399efe1aa5..e2793ccbecd 100644 --- a/compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.kt +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/Delegation.kt @@ -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() } diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt index befd95233be..86410a26fd0 100644 --- a/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/GenericSubstitution.kt @@ -3,7 +3,7 @@ package test class E1: Exception() interface Base { - throws(E1::class) + @Throws(E1::class) fun one(t: T) {} } diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.kt index cdc427a4c7f..3bc77076f4b 100644 --- a/compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.kt +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/TopLevel.kt @@ -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() {} \ No newline at end of file diff --git a/compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.kt b/compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.kt index cb242d3c5c7..b965f26ad08 100644 --- a/compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.kt +++ b/compiler/testData/compileJavaAgainstKotlin/method/throws/TraitMembers.kt @@ -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() {} } diff --git a/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt b/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt index ca5d86ccf98..9e7b0f0bc14 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/Converter.kt @@ -587,7 +587,7 @@ class Converter private constructor( val convertedType = typeConverter.convertType(types[index], Nullability.NotNull) null to deferredElement { ClassLiteralExpression(convertedType.assignPrototype(refElements[index])) } } - val annotation = Annotation(Identifier("throws").assignNoPrototype(), arguments, withAt = false, newLineAfter = true) + val annotation = Annotation(Identifier("Throws").assignNoPrototype(), arguments, withAt = false, newLineAfter = true) return Annotations(listOf(annotation.assignPrototype(throwsList))).assignPrototype(throwsList) } diff --git a/j2k/testData/fileOrElement/function/extendsBaseWhichExtendsObject.kt b/j2k/testData/fileOrElement/function/extendsBaseWhichExtendsObject.kt index a42b7dcc098..dfb93723294 100644 --- a/j2k/testData/fileOrElement/function/extendsBaseWhichExtendsObject.kt +++ b/j2k/testData/fileOrElement/function/extendsBaseWhichExtendsObject.kt @@ -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() } diff --git a/j2k/testData/fileOrElement/function/overrideObject.kt b/j2k/testData/fileOrElement/function/overrideObject.kt index 9df6feca9d6..f861860fd2e 100644 --- a/j2k/testData/fileOrElement/function/overrideObject.kt +++ b/j2k/testData/fileOrElement/function/overrideObject.kt @@ -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() } diff --git a/j2k/testData/fileOrElement/function/overrideObject2.kt b/j2k/testData/fileOrElement/function/overrideObject2.kt index 4fdcd98b828..6791e86c5e5 100644 --- a/j2k/testData/fileOrElement/function/overrideObject2.kt +++ b/j2k/testData/fileOrElement/function/overrideObject2.kt @@ -14,7 +14,7 @@ class X : Base() { return super.toString() } - throws(CloneNotSupportedException::class) + Throws(CloneNotSupportedException::class) protected fun clone(): Any { return super.clone() } diff --git a/j2k/testData/fileOrElement/function/throws.kt b/j2k/testData/fileOrElement/function/throws.kt index a2a2581a118..d84a06ff7e3 100644 --- a/j2k/testData/fileOrElement/function/throws.kt +++ b/j2k/testData/fileOrElement/function/throws.kt @@ -1,2 +1,2 @@ -throws(IOException::class, SerializationException::class) +Throws(IOException::class, SerializationException::class) fun foo() \ No newline at end of file diff --git a/j2k/testData/fileOrElement/methodCallExpression/vararg1.kt b/j2k/testData/fileOrElement/methodCallExpression/vararg1.kt index f75eb8d55aa..8d4627eeb39 100644 --- a/j2k/testData/fileOrElement/methodCallExpression/vararg1.kt +++ b/j2k/testData/fileOrElement/methodCallExpression/vararg1.kt @@ -1,7 +1,7 @@ import java.lang.reflect.Constructor object X { - throws(Exception::class) + Throws(Exception::class) fun foo(constructor: Constructor, args1: Array, args2: Array) { constructor.newInstance(*args1) constructor.newInstance(args1, args2) diff --git a/j2k/testData/fileOrElement/tryWithResource/Multiline.kt b/j2k/testData/fileOrElement/tryWithResource/Multiline.kt index 16670e22530..2beca75872d 100644 --- a/j2k/testData/fileOrElement/tryWithResource/Multiline.kt +++ b/j2k/testData/fileOrElement/tryWithResource/Multiline.kt @@ -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 diff --git a/j2k/testData/fileOrElement/tryWithResource/MultipleResources.kt b/j2k/testData/fileOrElement/tryWithResource/MultipleResources.kt index 749e8e2a3b1..3723fceb84a 100644 --- a/j2k/testData/fileOrElement/tryWithResource/MultipleResources.kt +++ b/j2k/testData/fileOrElement/tryWithResource/MultipleResources.kt @@ -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 -> diff --git a/j2k/testData/fileOrElement/tryWithResource/Simple.kt b/j2k/testData/fileOrElement/tryWithResource/Simple.kt index f1c589909e4..d6af44fc6b7 100644 --- a/j2k/testData/fileOrElement/tryWithResource/Simple.kt +++ b/j2k/testData/fileOrElement/tryWithResource/Simple.kt @@ -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()) } } diff --git a/j2k/testData/fileOrElement/tryWithResource/WithFinally.kt b/j2k/testData/fileOrElement/tryWithResource/WithFinally.kt index ab6962441b8..5107e6e289c 100644 --- a/j2k/testData/fileOrElement/tryWithResource/WithFinally.kt +++ b/j2k/testData/fileOrElement/tryWithResource/WithFinally.kt @@ -1,7 +1,7 @@ import java.io.* public class C { - throws(IOException::class) + Throws(IOException::class) fun foo() { try { ByteArrayInputStream(ByteArray(10)).use { stream -> diff --git a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt index ad9b3d05d1f..85c5b6a9b90 100644 --- a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt +++ b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass.kt @@ -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) } diff --git a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt index 0b7051c782f..bf26a084f5d 100644 --- a/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt +++ b/j2k/testData/fileOrElement/tryWithResource/WithReturnInAnonymousClass2.kt @@ -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) } diff --git a/libraries/stdlib/src/kotlin/util/JLangJVM.kt b/libraries/stdlib/src/kotlin/util/JLangJVM.kt index a0eed70a26d..c45f9ca3b4e 100644 --- a/libraries/stdlib/src/kotlin/util/JLangJVM.kt +++ b/libraries/stdlib/src/kotlin/util/JLangJVM.kt @@ -22,7 +22,7 @@ import kotlin.reflect.KClass * * @property exceptionClasses the list of checked exception classes that may be thrown by the function. */ -public annotation(retention = AnnotationRetention.SOURCE) class throws(public vararg val exceptionClasses: KClass) +public annotation(retention = AnnotationRetention.SOURCE) class Throws(public vararg val exceptionClasses: KClass) /** * Returns the runtime Java class of this object.