mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fix ReadableArray annotations (#30122)
Summary: Fix ReadableArray annotations, because these methods throw ArrayIndexOutOfBoundsException instead of null if index is not found. ## Changelog [Android] [Changed] - fix ReadableArray null annotations. Possibly breaking change for Kotlin apps. Pull Request resolved: https://github.com/facebook/react-native/pull/30122 Test Plan: RNTester app builds and runs as expected, and show correct type in when used with Kotlin code. Reviewed By: JoshuaGross Differential Revision: D24164326 Pulled By: fkgozali fbshipit-source-id: 0c3f8fa9accbd32cc71c50befe9330e5201643f6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4d4992c790
commit
d76556543f
@@ -98,17 +98,17 @@ public class ReadableNativeArray extends NativeArray implements ReadableArray {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getString(int index) {
|
||||
public @NonNull String getString(int index) {
|
||||
return (String) getLocalArray()[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ReadableNativeArray getArray(int index) {
|
||||
public @NonNull ReadableNativeArray getArray(int index) {
|
||||
return (ReadableNativeArray) getLocalArray()[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ReadableNativeMap getMap(int index) {
|
||||
public @NonNull ReadableNativeMap getMap(int index) {
|
||||
return (ReadableNativeMap) getLocalArray()[index];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user