mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Annotate NullSafe(LOCAL) for classes in java/com/facebook/react/modules (#49769)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49769 Nullsafety scripts and analysis determine it's safe to annotate these classes as NullSafe(LOCAL) changelog: [internal] internal Reviewed By: rshest Differential Revision: D70464130 fbshipit-source-id: b6819efc06e0a25a5de32842536175177c42c7b6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8f209acb3f
commit
4e35676149
+4
-1
@@ -7,6 +7,8 @@
|
||||
|
||||
package com.facebook.react.modules.network;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import okhttp3.Headers;
|
||||
@@ -20,12 +22,13 @@ import okhttp3.OkHttpClient;
|
||||
* different RN platform environments, and then consider getting rid of this compat layer
|
||||
* altogether.
|
||||
*/
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public class OkHttpCompat {
|
||||
public static CookieJarContainer getCookieJarContainer(OkHttpClient client) {
|
||||
return (CookieJarContainer) client.cookieJar();
|
||||
}
|
||||
|
||||
public static Headers getHeadersFromMap(Map<String, String> headers) {
|
||||
public static Headers getHeadersFromMap(@Nullable Map<String, String> headers) {
|
||||
if (headers == null) {
|
||||
return Headers.of(Collections.emptyMap());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user