Skip to content

Commit 08170cd

Browse files
GijsWeteringsfacebook-github-bot
authored andcommitted
[skip ci] Fix Nullsafe FIXMEs for JSDebuggerWebSocketClient.java and mark nullsafe (facebook#50058)
Summary: Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations. Changelog: [Android][Fixed] Made JSDebuggerWebsocketClient.java nullsafe Reviewed By: mdvacca Differential Revision: D71126385
1 parent ee74d1b commit 08170cd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/JSDebuggerWebSocketClient.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import androidx.annotation.Nullable;
1414
import com.facebook.common.logging.FLog;
1515
import com.facebook.infer.annotation.Assertions;
16+
import com.facebook.infer.annotation.Nullsafe;
1617
import com.facebook.react.common.JavascriptException;
1718
import com.facebook.react.common.annotations.VisibleForTesting;
1819
import java.io.IOException;
@@ -29,6 +30,7 @@
2930
import okhttp3.WebSocketListener;
3031

3132
/** A wrapper around WebSocketClient that recognizes RN debugging message format. */
33+
@Nullsafe(Nullsafe.Mode.LOCAL)
3234
class JSDebuggerWebSocketClient extends WebSocketListener {
3335

3436
private static final String TAG = "JSDebuggerWebSocketClient";
@@ -210,8 +212,7 @@ public void onMessage(@Nullable WebSocket webSocket, String text) {
210212
}
211213

212214
@Override
213-
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
214-
public void onFailure(WebSocket webSocket, Throwable t, Response response) {
215+
public void onFailure(@Nullable WebSocket webSocket, Throwable t, @Nullable Response response) {
215216
abort("Websocket exception", t);
216217
}
217218

packages/react-native/ReactAndroid/src/test/java/com/facebook/react/devsupport/JSDebuggerWebSocketClientTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class JSDebuggerWebSocketClientTest {
4141
val client = spy(JSDebuggerWebSocketClient())
4242
val injectedObjects = mapOf("key1" to "value1", "key2" to "value2")
4343
client.loadBundle(
44-
"http://localhost:8080/index.js", injectedObjects as HashMap<String, String>?, cb)
44+
"http://localhost:8080/index.js", injectedObjects as HashMap<String, String>, cb)
4545
verify(client)
4646
.sendMessage(
4747
0,

0 commit comments

Comments
 (0)