Skip to content

Commit

Permalink
Fix ViewManager.receiveCommand nullability (facebook#44531)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#44531

Changelog: [Internal]

Properly propagate the `Nullable` to the delegates.

Reviewed By: rshest

Differential Revision: D57218665

fbshipit-source-id: 2783ad9b37688e0928ad2e3cf6a2ab1f41190fe7
  • Loading branch information
Thomas Nardone authored and facebook-github-bot committed May 14, 2024
1 parent 1a56b9a commit 6876775
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const PropSetterTemplate = ({propCases}: {propCases: string}) =>
const CommandsTemplate = ({commandCases}: {commandCases: string}) =>
`
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
${commandCases}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
}
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
case \\"flashScrollIndicators\\":
mViewManager.flashScrollIndicators(view);
Expand Down Expand Up @@ -263,7 +263,7 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
}
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
case \\"handleRootTag\\":
mViewManager.handleRootTag(view, args.getDouble(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ public void setProperty(T view, String propName, @Nullable Object value) {
}

@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {}
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
public interface ViewManagerDelegate<T extends View> {
void setProperty(T view, String propName, @Nullable Object value);

void receiveCommand(T view, String commandName, ReadableArray args);
void receiveCommand(T view, String commandName, @Nullable ReadableArray args);
}

0 comments on commit 6876775

Please sign in to comment.