Skip to content

Commit 46904be

Browse files
committed
Fix or suppress "Redundant call of conversion method"
1 parent 08ebe11 commit 46904be

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

libraries/apollo-runtime/src/appleMain/kotlin/com/apollographql/apollo/network/http/DefaultHttpEngine.apple.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ private fun buildHttpResponse(
182182
HttpHeader(key.toString(), value.toString())
183183
}
184184

185+
@Suppress("REDUNDANT_CALL_OF_CONVERSION_METHOD")
185186
val statusCode = httpResponse.statusCode.toInt()
186187

187188
return Result.success(

libraries/apollo-runtime/src/appleMain/kotlin/com/apollographql/apollo/network/websocket/WebSocketEngine.apple.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ internal class AppleWebSocket(
131131
nsurlSessionWebSocketTask.receiveMessageWithCompletionHandler { message, nsError ->
132132
if (nsError != null) {
133133
if (disposed.compareAndSet(expect = false, update = true)) {
134+
@Suppress("REDUNDANT_CALL_OF_CONVERSION_METHOD")
134135
val exception = if (nsError.domain == "NSPOSIXErrorDomain" && nsError.code.toLong() == ENOTCONN.toLong()) {
135136
ApolloWebSocketClosedException(nsurlSessionWebSocketTask.closeCode.convert(), nsurlSessionWebSocketTask.closeReason?.toByteString()
136137
?.toByteArray()?.commonToUtf8String())

tests/sample-server/src/main/kotlin/com/apollographql/apollo/sample/server/SampleServer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fun ApolloWebsocketHandler(executableSchema: ExecutableSchema, webSocketRegistry
143143
ConnectionInitError()
144144
}
145145

146-
shouldReturn != null && shouldReturn.toString().startsWith("close") -> {
146+
shouldReturn != null && shouldReturn.startsWith("close") -> {
147147
val code = Regex("close\\(([0-9]*)\\)").matchEntire(shouldReturn)
148148
?.let { it.groupValues[1].toIntOrNull() }
149149
?: 1001
@@ -242,4 +242,4 @@ class SampleServer(port: Int = 0, tag: String = "") : Closeable {
242242
override fun close() {
243243
server.close()
244244
}
245-
}
245+
}

tests/scalar-adapters/src/test/kotlin/test/CustomScalarTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class CustomScalarTest {
125125
/*
126126
* Decimal is mapped to a String to get the same `toString` representation, else Double
127127
*/
128-
assertEquals("1000000000000000000000000000000000000000000", data.decimal?.toString())
128+
assertEquals("1000000000000000000000000000000000000000000", data.decimal)
129129
}
130130

131131
/**

0 commit comments

Comments
 (0)