Skip to content

Commit 03badf9

Browse files
authored
misc: re-enable kotlinWarningsAsErrors=true (#1224)
1 parent 8b33693 commit 03badf9

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ jobs:
6262
- name: Test
6363
shell: bash
6464
run: |
65-
# FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532
66-
# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
65+
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
6766
./gradlew apiCheck
6867
./gradlew test jvmTest
6968
- name: Save Test Reports

runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/MetricsInterceptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public object MetricsInterceptor : Interceptor {
3030
}
3131

3232
val originalResponse = chain.proceed(request)
33-
val response = if (originalResponse.body == null || originalResponse.body?.contentLength() == 0L) {
33+
val response = if (originalResponse.body.contentLength() == 0L) {
3434
originalResponse
3535
} else {
3636
originalResponse.newBuilder()

runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpEngine.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import aws.smithy.kotlin.runtime.net.TlsVersion
1515
import aws.smithy.kotlin.runtime.operation.ExecutionContext
1616
import aws.smithy.kotlin.runtime.time.Instant
1717
import aws.smithy.kotlin.runtime.time.fromEpochMilliseconds
18+
import kotlinx.coroutines.ExperimentalCoroutinesApi
1819
import kotlinx.coroutines.job
1920
import okhttp3.*
2021
import okhttp3.ConnectionPool
@@ -47,6 +48,7 @@ public class OkHttpEngine(
4748
private val connectionIdleMonitor = config.connectionIdlePollingInterval?.let { ConnectionIdleMonitor(it) }
4849
private val client = config.buildClientWithConnectionListener(metrics, connectionIdleMonitor)
4950

51+
@OptIn(ExperimentalCoroutinesApi::class)
5052
override suspend fun roundTrip(context: ExecutionContext, request: HttpRequest): HttpCall {
5153
val callContext = callContext()
5254

runtime/protocol/http-client-engines/http-client-engine-okhttp/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp/OkHttpUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public fun Headers.toOkHttpHeaders(): OkHttpHeaders = OkHttpHeaders.Builder().al
104104
@InternalApi
105105
public fun OkHttpResponse.toSdkResponse(): HttpResponse {
106106
val sdkHeaders = OkHttpHeadersAdapter(headers)
107-
val httpBody = if (body == null || body!!.contentLength() == 0L) {
107+
val httpBody = if (body.contentLength() == 0L) {
108108
HttpBody.Empty
109109
} else {
110110
object : HttpBody.SourceContent() {

runtime/protocol/http-client-engines/http-client-engine-okhttp4/jvm/src/aws/smithy/kotlin/runtime/http/engine/okhttp4/OkHttp4Engine.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private suspend fun Call.executeAsync(): Response =
9999
call: Call,
100100
response: Response,
101101
) {
102-
continuation.resume(response) {
102+
continuation.resume(response) { cause, _, _ ->
103103
response.closeQuietly()
104104
}
105105
}

runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/util/JMESPath.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ public fun Any?.type(): String = when (this) {
6262
is List<*>, is Array<*> -> "array"
6363
is Number -> "number"
6464
is Any -> "object"
65-
null -> "null"
66-
else -> throw Exception("Undetected type for: $this")
65+
else -> "null"
6766
}
6867

6968
// Collection `flattenIfPossible` functions

0 commit comments

Comments
 (0)