mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix nullsafe FIXMES for ReconnectingWebSocket.java and mark nullsafe (#50354)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50354 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 ReconnectingWebSocket.java nullsafe Reviewed By: cortinico Differential Revision: D71979606 fbshipit-source-id: d71e26fe37bdf5abbe7b933d0fee25e05d0da87d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f94174f2dc
commit
ff6601bfb7
+4
-2
@@ -11,6 +11,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import java.io.IOException;
|
||||
import java.nio.channels.ClosedChannelException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -22,6 +23,7 @@ import okhttp3.WebSocketListener;
|
||||
import okio.ByteString;
|
||||
|
||||
/** A wrapper around WebSocketClient that reconnects automatically */
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public final class ReconnectingWebSocket extends WebSocketListener {
|
||||
private static final String TAG = ReconnectingWebSocket.class.getSimpleName();
|
||||
|
||||
@@ -138,8 +140,8 @@ public final class ReconnectingWebSocket extends WebSocketListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
// NULLSAFE_FIXME[Inconsistent Subclass Parameter Annotation]
|
||||
public synchronized void onFailure(WebSocket webSocket, Throwable t, Response response) {
|
||||
public synchronized void onFailure(
|
||||
@Nullable WebSocket webSocket, Throwable t, @Nullable Response response) {
|
||||
if (mWebSocket != null) {
|
||||
abort("Websocket exception", t);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user