Skip to content

Commit 09eefed

Browse files
cortinicoOlimpiaZurek
authored andcommitted
Fix compilation warnings for MapBuffer
Summary: We have two warnings on MapBuffer which I'd like to resolve as they show up on console every time. 1. We're using a deprecated method receiveCommand, which is actually legit but was missing a propagation of the warning. I'm adding it. 2. We had a null check that that was always not null. That is enforced by the Kotlin type system. I've checked the code and we're actually always returning non-nulls there or raising exceptions instead. Changelog: [Internal] [Changed] - Fix compilation warnings for MapBuffer Reviewed By: javache Differential Revision: D41522129 fbshipit-source-id: c2dbb660f95a2ff7dac6e4fcdf476e4058cf730e
1 parent e266184 commit 09eefed

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactMapBufferPropSetter.kt

+3-5
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,9 @@ object ReactMapBufferPropSetter {
255255
for (entry in mapBuffer) {
256256
val map = JavaOnlyMap()
257257
val action = entry.mapBufferValue
258-
if (action != null) {
259-
map.putString("name", action.getString(ACCESSIBILITY_ACTION_NAME))
260-
if (action.contains(ACCESSIBILITY_ACTION_LABEL)) {
261-
map.putString("label", action.getString(ACCESSIBILITY_ACTION_LABEL))
262-
}
258+
map.putString("name", action.getString(ACCESSIBILITY_ACTION_NAME))
259+
if (action.contains(ACCESSIBILITY_ACTION_LABEL)) {
260+
map.putString("label", action.getString(ACCESSIBILITY_ACTION_LABEL))
263261
}
264262
actions.add(map)
265263
}

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManagerWrapper.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ interface ReactViewManagerWrapper {
6464
}
6565

6666
override fun receiveCommand(root: View, commandId: Int, args: ReadableArray?) {
67-
viewManager.receiveCommand(root, commandId, args)
67+
@Suppress("DEPRECATION") viewManager.receiveCommand(root, commandId, args)
6868
}
6969

7070
override fun setPadding(view: View, left: Int, top: Int, right: Int, bottom: Int) {

0 commit comments

Comments
 (0)