diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java index 4ff50c54a9daf4..def6056917fb01 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/ArrayUtils.java @@ -9,10 +9,11 @@ import java.util.Arrays; import java.util.List; +import javax.annotation.Nullable; public class ArrayUtils { - public static float[] copyArray(float[] array) { + public static float[] copyArray(@Nullable float[] array) { return array == null ? null : Arrays.copyOf(array, array.length); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java index 9399888a16c5a1..4c886ef03832c6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java @@ -13,7 +13,12 @@ * Not all versions of Android SDK have this class in nio package. This is the reason to have it * around. */ -public class StandardCharsets { +@Deprecated( + since = "Deprecated class since v0.73.0, please use java.nio.charset.StandardCharsets instead.", + forRemoval = true) +public final class StandardCharsets { + + private StandardCharsets() {} /** Eight-bit UCS Transformation Format */ public static final Charset UTF_8 = Charset.forName("UTF-8"); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java index 1c4b373f126aa1..020f8b82e277fb 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java @@ -20,12 +20,12 @@ import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableMap; -import com.facebook.react.common.StandardCharsets; import com.facebook.react.common.network.OkHttpCallUtil; import com.facebook.react.module.annotations.ReactModule; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashSet; import java.util.List; diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.java index a49e6ebc2c857a..6483953b104fe0 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.java +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/NetworkingModuleTest.java @@ -23,9 +23,9 @@ import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.WritableArray; import com.facebook.react.bridge.WritableMap; -import com.facebook.react.common.StandardCharsets; import com.facebook.react.common.network.OkHttpCallUtil; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; import okhttp3.Call; diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ProgressiveStringDecoderTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ProgressiveStringDecoderTest.java index a714df574b6310..3078bcbfa64942 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ProgressiveStringDecoderTest.java +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/network/ProgressiveStringDecoderTest.java @@ -7,8 +7,8 @@ package com.facebook.react.modules.network; -import com.facebook.react.common.StandardCharsets; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith;