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
This commit is contained in:
Nicola Corti authored and Facebook GitHub Bot committed 2022-11-25 08:01:18 -08:00
1 parent f75b92a12b
commit e6c0ac0517
2 files changed
+4 -6

No files matched your search

@@ -255,11 +255,9 @@ object ReactMapBufferPropSetter {
for (entry in mapBuffer) {
val map = JavaOnlyMap()
val action = entry.mapBufferValue
if (action != null) {
map.putString("name", action.getString(ACCESSIBILITY_ACTION_NAME))
if (action.contains(ACCESSIBILITY_ACTION_LABEL)) {
map.putString("label", action.getString(ACCESSIBILITY_ACTION_LABEL))
}
map.putString("name", action.getString(ACCESSIBILITY_ACTION_NAME))
if (action.contains(ACCESSIBILITY_ACTION_LABEL)) {
map.putString("label", action.getString(ACCESSIBILITY_ACTION_LABEL))
}
actions.add(map)
}
@@ -64,7 +64,7 @@ interface ReactViewManagerWrapper {
}
override fun receiveCommand(root: View, commandId: Int, args: ReadableArray?) {
viewManager.receiveCommand(root, commandId, args)
@Suppress("DEPRECATION") viewManager.receiveCommand(root, commandId, args)
}
override fun setPadding(view: View, left: Int, top: Int, right: Int, bottom: Int) {