Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ jobs:
- name: Test
shell: bash
run: |
# FIXME K2. Re-enable warnings as errors after this warning is removed: https://youtrack.jetbrains.com/issue/KT-68532
# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
./gradlew apiCheck
./gradlew test jvmTest
- name: Save Test Reports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public object MetricsInterceptor : Interceptor {
}

val originalResponse = chain.proceed(request)
val response = if (originalResponse.body == null || originalResponse.body?.contentLength() == 0L) {
val response = if (originalResponse.body.contentLength() == 0L) {
originalResponse
} else {
originalResponse.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import aws.smithy.kotlin.runtime.net.TlsVersion
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.time.Instant
import aws.smithy.kotlin.runtime.time.fromEpochMilliseconds
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.job
import okhttp3.*
import okhttp3.ConnectionPool
Expand Down Expand Up @@ -47,6 +48,7 @@ public class OkHttpEngine(
private val connectionIdleMonitor = config.connectionIdlePollingInterval?.let { ConnectionIdleMonitor(it) }
private val client = config.buildClientWithConnectionListener(metrics, connectionIdleMonitor)

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public fun Headers.toOkHttpHeaders(): OkHttpHeaders = OkHttpHeaders.Builder().al
@InternalApi
public fun OkHttpResponse.toSdkResponse(): HttpResponse {
val sdkHeaders = OkHttpHeadersAdapter(headers)
val httpBody = if (body == null || body!!.contentLength() == 0L) {
val httpBody = if (body.contentLength() == 0L) {
HttpBody.Empty
} else {
object : HttpBody.SourceContent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private suspend fun Call.executeAsync(): Response =
call: Call,
response: Response,
) {
continuation.resume(response) {
continuation.resume(response) { cause, _, _ ->
response.closeQuietly()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public fun Any?.type(): String = when (this) {
is List<*>, is Array<*> -> "array"
is Number -> "number"
is Any -> "object"
null -> "null"
else -> throw Exception("Undetected type for: $this")
else -> "null"
}

// Collection `flattenIfPossible` functions
Expand Down
Loading