Fix Java compile errors in JS-generated receiveCommand method

Summary: This diff adds a missing `switch` statement

Reviewed By: makovkastar

Differential Revision: D16892042

fbshipit-source-id: c162655445f3c0891d2377595a9389d419713bdf
This commit is contained in:
Eli White
2019-08-19 11:53:27 -07:00
committed by Facebook Github Bot
parent b9899222a3
commit cddc2c6c72
2 changed files with 22 additions and 16 deletions
@@ -43,7 +43,9 @@ const propSetterTemplate = `
const commandsTemplate = `
public void receiveCommand(::_INTERFACE_CLASSNAME_::<T> viewManager, T view, String commandName, ReadableArray args) {
::_COMMAND_CASES_::
switch (commandName) {
::_COMMAND_CASES_::
}
}
`;
@@ -173,13 +175,13 @@ function generateCommandCasesString(
const commandMethods = component.commands
.map(command => {
return `case "${command.name}":
viewManager.${toSafeJavaString(
command.name,
false,
)}(${getCommandArguments(command)});
break;`;
viewManager.${toSafeJavaString(
command.name,
false,
)}(${getCommandArguments(command)});
break;`;
})
.join('\n' + ' ');
.join('\n' + ' ');
return commandMethods;
}