mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fix Kotlin parameter name mismatches with supertypes (#56840)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56840 Fix Kotlin compiler warnings about overridden method parameter names not matching their supertypes. Rename `websocket` to `webSocket` in `WebSocketModule.onClosing` to match `WebSocketListener`, and rename `done` to `isLastChunk` in `MultipartStreamReaderTest` callbacks to match `CallCountTrackingChunkCallback`. Changelog: [Internal] Differential Revision: D105299024 fbshipit-source-id: fcf3718fbbfd342f598a05ddbe170a11480cce89
This commit is contained in:
1 parent
cb04956cde
commit
accc44eb75
2 files changed
+16
-8
No files matched your search
+2
-2
@@ -154,8 +154,8 @@ public class WebSocketModule(context: ReactApplicationContext) :
|
||||
sendEvent("websocketOpen", params)
|
||||
}
|
||||
|
||||
override fun onClosing(websocket: WebSocket, code: Int, reason: String) {
|
||||
websocket.close(code, reason)
|
||||
override fun onClosing(webSocket: WebSocket, code: Int, reason: String) {
|
||||
webSocket.close(code, reason)
|
||||
}
|
||||
|
||||
override fun onClosed(webSocket: WebSocket, code: Int, reason: String) {
|
||||
|
||||
+14
-6
@@ -34,10 +34,14 @@ class MultipartStreamReaderTest {
|
||||
|
||||
val callback: CallCountTrackingChunkCallback =
|
||||
object : CallCountTrackingChunkCallback() {
|
||||
override fun onChunkComplete(headers: Map<String, String>, body: Buffer, done: Boolean) {
|
||||
super.onChunkComplete(headers, body, done)
|
||||
override fun onChunkComplete(
|
||||
headers: Map<String, String>,
|
||||
body: Buffer,
|
||||
isLastChunk: Boolean,
|
||||
) {
|
||||
super.onChunkComplete(headers, body, isLastChunk)
|
||||
|
||||
assertThat(done).isTrue
|
||||
assertThat(isLastChunk).isTrue
|
||||
assertThat(headers["Content-Type"]).isEqualTo("application/json; charset=utf-8")
|
||||
assertThat(body.readUtf8()).isEqualTo("{}")
|
||||
}
|
||||
@@ -70,10 +74,14 @@ class MultipartStreamReaderTest {
|
||||
|
||||
val callback: CallCountTrackingChunkCallback =
|
||||
object : CallCountTrackingChunkCallback() {
|
||||
override fun onChunkComplete(headers: Map<String, String>, body: Buffer, done: Boolean) {
|
||||
super.onChunkComplete(headers, body, done)
|
||||
override fun onChunkComplete(
|
||||
headers: Map<String, String>,
|
||||
body: Buffer,
|
||||
isLastChunk: Boolean,
|
||||
) {
|
||||
super.onChunkComplete(headers, body, isLastChunk)
|
||||
|
||||
assertThat(done).isEqualTo(callCount == 3)
|
||||
assertThat(isLastChunk).isEqualTo(callCount == 3)
|
||||
assertThat(body.readUtf8()).isEqualTo("$callCount")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user