Skip to content

Commit

Permalink
misc: re-enable kotlinWarningsAsErrors=true (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
lauzadis authored Jan 23, 2025
1 parent 8b33693 commit 03badf9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
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

0 comments on commit 03badf9

Please sign in to comment.