diff --git a/build.gradle b/build.gradle index 9f6d39d9f6..a88196523d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false - id 'org.jetbrains.kotlin.jvm' version '1.4-M2' apply false + id 'org.jetbrains.kotlin.jvm' version '1.3.72' apply false id 'org.jetbrains.dokka' version '0.10.1' apply false id 'org.asciidoctor.jvm.convert' version '2.4.0' id 'io.spring.nohttp' version '0.0.5.RELEASE' @@ -29,8 +29,8 @@ configure(allprojects) { project -> mavenBom "io.r2dbc:r2dbc-bom:Arabba-SR5" mavenBom "io.rsocket:rsocket-bom:1.0.1" mavenBom "org.eclipse.jetty:jetty-bom:9.4.30.v20200611" - mavenBom "org.jetbrains.kotlin:kotlin-bom:1.4-M2" - mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.7-1.4-M2" + mavenBom "org.jetbrains.kotlin:kotlin-bom:1.3.72" + mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.7" mavenBom "org.junit:junit-bom:5.6.2" } dependencies { @@ -286,8 +286,6 @@ configure(allprojects) { project -> mavenCentral() maven { url "https://repo.spring.io/libs-spring-framework-build" } maven { url "https://repo.spring.io/snapshot" } // Reactor - maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // Kotlin - maven { url "https://kotlin.bintray.com/kotlinx" } // Coroutines } } configurations.all { @@ -310,16 +308,9 @@ configure([rootProject] + javaProjects) { project -> pluginManager.withPlugin("kotlin") { apply plugin: "org.jetbrains.dokka" - // Workaround for https://youtrack.jetbrains.com/issue/KT-39610 - configurations["kotlinCompilerPluginClasspath"].attributes.attribute( - org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, - objects.named(Usage.class, "java-runtime") - ) compileKotlin { kotlinOptions { jvmTarget = "1.8" - languageVersion = "1.3" - apiVersion = "1.3" freeCompilerArgs = ["-Xjsr305=strict"] allWarningsAsErrors = true } diff --git a/settings.gradle b/settings.gradle index 7ad7dee39e..5ceee64116 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,7 +2,6 @@ pluginManagement { repositories { gradlePluginPortal() maven { url 'https://repo.spring.io/plugins-release' } - maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } // Kotlin } } diff --git a/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt b/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt index 1ce7820d73..eb2dfe3671 100644 --- a/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt +++ b/spring-jdbc/src/test/kotlin/org/springframework/jdbc/core/JdbcOperationsExtensionsTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors + * Copyright 2002-2019 the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class JdbcOperationsExtensionsTests { @Test // gh-22682 fun `queryForObject with nullable RowMapper-like function`() { every { template.queryForObject(sql, any>(), 3) } returns null - assertThat(template.queryForObject(sql, 3) { _, _ -> null }).isNull() + assertThat(template.queryForObject(sql, 3) { _, _ -> null as Int? }).isNull() verify { template.queryForObject(eq(sql), any>(), eq(3)) } } @@ -130,7 +130,7 @@ class JdbcOperationsExtensionsTests { @Test fun `query with RowMapper-like function`() { - val list = mutableListOf(1, 2, 3) + val list = listOf(1, 2, 3) every { template.query(sql, ofType>(), 3) } returns list assertThat(template.query(sql, 3) { rs, _ -> rs.getInt(1) diff --git a/spring-messaging/spring-messaging.gradle b/spring-messaging/spring-messaging.gradle index 87f77a95a1..b1e9bae989 100644 --- a/spring-messaging/spring-messaging.gradle +++ b/spring-messaging/spring-messaging.gradle @@ -2,12 +2,6 @@ description = "Spring Messaging" apply plugin: "kotlin" -// Workaround for https://youtrack.jetbrains.com/issue/KT-39610 -configurations["optional"].attributes.attribute( - org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, - objects.named(Usage.class, "java-runtime") -) - dependencies { compile(project(":spring-beans")) compile(project(":spring-core")) diff --git a/spring-messaging/src/test/kotlin/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerKotlinTests.kt b/spring-messaging/src/test/kotlin/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerKotlinTests.kt index 27c0304159..9e49d6dc6a 100644 --- a/spring-messaging/src/test/kotlin/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerKotlinTests.kt +++ b/spring-messaging/src/test/kotlin/org/springframework/messaging/simp/annotation/support/SimpAnnotationMethodMessageHandlerKotlinTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,7 +132,7 @@ class SimpAnnotationMethodMessageHandlerKotlinTests { messageHandler.registerHandler(testController) messageHandler.handleMessage(message) assertThat(testController.exception).isNotNull() - assertThat(testController.exception).isInstanceOf(NullPointerException::class.java) + assertThat(testController.exception).isInstanceOf(IllegalArgumentException::class.java) } private fun createMessage(destination: String, headers: Map): Message { diff --git a/spring-test/spring-test.gradle b/spring-test/spring-test.gradle index 231ee2e405..506db8d5b5 100644 --- a/spring-test/spring-test.gradle +++ b/spring-test/spring-test.gradle @@ -2,12 +2,6 @@ description = "Spring TestContext Framework" apply plugin: "kotlin" -// Workaround for https://youtrack.jetbrains.com/issue/KT-39610 -configurations["optional"].attributes.attribute( - org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, - objects.named(Usage.class, "java-runtime") -) - dependencies { compile(project(":spring-core")) optional(project(":spring-aop")) diff --git a/spring-tx/spring-tx.gradle b/spring-tx/spring-tx.gradle index 7c5cde91f8..99c8298926 100644 --- a/spring-tx/spring-tx.gradle +++ b/spring-tx/spring-tx.gradle @@ -2,12 +2,6 @@ description = "Spring Transaction" apply plugin: "kotlin" -// Workaround for https://youtrack.jetbrains.com/issue/KT-39610 -configurations["optional"].attributes.attribute( - org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, - objects.named(Usage.class, "java-runtime") -) - dependencies { compile(project(":spring-beans")) compile(project(":spring-core")) diff --git a/spring-web/src/test/kotlin/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverKotlinTests.kt b/spring-web/src/test/kotlin/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverKotlinTests.kt index 07d989bcf6..61c32fec34 100644 --- a/spring-web/src/test/kotlin/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverKotlinTests.kt +++ b/spring-web/src/test/kotlin/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverKotlinTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -139,7 +139,7 @@ class RequestParamMethodArgumentResolverKotlinTests { @Test fun resolveNonNullableNotRequiredWithoutParameter() { - assertThatExceptionOfType(NullPointerException::class.java).isThrownBy { + assertThatExceptionOfType(TypeCastException::class.java).isThrownBy { resolver.resolveArgument(nonNullableParamNotRequired, null, webRequest, binderFactory) as String } } @@ -221,7 +221,7 @@ class RequestParamMethodArgumentResolverKotlinTests { request.method = HttpMethod.POST.name request.contentType = MediaType.MULTIPART_FORM_DATA_VALUE - assertThatExceptionOfType(NullPointerException::class.java).isThrownBy { + assertThatExceptionOfType(TypeCastException::class.java).isThrownBy { resolver.resolveArgument(nonNullableMultipartParamNotRequired, null, webRequest, binderFactory) as MultipartFile } } diff --git a/spring-webflux/spring-webflux.gradle b/spring-webflux/spring-webflux.gradle index 11e7587643..45c9eac256 100644 --- a/spring-webflux/spring-webflux.gradle +++ b/spring-webflux/spring-webflux.gradle @@ -2,12 +2,6 @@ description = "Spring WebFlux" apply plugin: "kotlin" -// Workaround for https://youtrack.jetbrains.com/issue/KT-39610 -configurations["optional"].attributes.attribute( - org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, - objects.named(Usage.class, "java-runtime") -) - dependencies { compile(project(":spring-beans")) compile(project(":spring-core"))