mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
1 parent
f75b92a12b
commit
e6c0ac0517
2 files changed
+4
-6
No files matched your search
+3
-5
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user