Program: 40992
Project: 40992
Buggy source:
/** 
 * Append logic for executing a script on a remote machine with the invoker plugin
 * @param templateContext the context with a bpel templateBuildPlan
 * @param templateId the id of the template inside the context
 * @param runShScriptStringVar the bpel variable containing the script call
 * @param sshUserVariable the user name for the remote machine as a bpel variable
 * @param sshKeyVariable the pass for the remote machine as a bpel variable
 * @param serverIpPropWrapper the ip of the remote machine as a bpel variable
 * @param runScriptRequestInputParams a mapping from parameter names to bpel variables
 * @return true if appending the bpel logic was successful else false
 */
private boolean appendExecuteScript(TemplatePlanContext templateContext,String templateId,Variable runShScriptStringVar,Variable sshUserVariable,Variable sshKeyVariable,Variable serverIpPropWrapper,Map<String,Variable> runScriptRequestInputParams){
  String cleanPropName=serverIpPropWrapper.getName().substring(serverIpPropWrapper.getName().lastIndexOf("String_Node_Str") + 1);
switch (cleanPropName) {
case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_SERVERIP:
    runScriptRequestInputParams.put("String_Node_Str",serverIpPropWrapper);
  runScriptRequestInputParams.put("String_Node_Str",sshKeyVariable);
runScriptRequestInputParams.put("String_Node_Str",sshUserVariable);
runScriptRequestInputParams.put("String_Node_Str",runShScriptStringVar);
this.invokerPlugin.handle(templateContext,templateId,true,"String_Node_Str","String_Node_Str","String_Node_Str",runScriptRequestInputParams,new HashMap<String,Variable>(),false);
break;
case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMIP:
case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_RASPBIANIP:
runScriptRequestInputParams.put("String_Node_Str",serverIpPropWrapper);
runScriptRequestInputParams.put("String_Node_Str",sshKeyVariable);
runScriptRequestInputParams.put("String_Node_Str",sshUserVariable);
runScriptRequestInputParams.put("String_Node_Str",runShScriptStringVar);
this.invokerPlugin.handle(templateContext,templateId,true,"String_Node_Str",Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM,"String_Node_Str",runScriptRequestInputParams,new HashMap<String,Variable>(),false);
break;
default :
return false;
}
return true;
}

Fixed version (ground truth):
/** 
 * Append logic for executing a script on a remote machine with the invoker plugin
 * @param templateContext the context with a bpel templateBuildPlan
 * @param templateId the id of the template inside the context
 * @param runShScriptStringVar the bpel variable containing the script call
 * @param sshUserVariable the user name for the remote machine as a bpel variable
 * @param sshKeyVariable the pass for the remote machine as a bpel variable
 * @param serverIpPropWrapper the ip of the remote machine as a bpel variable
 * @return true if appending the bpel logic was successful else false
 */
private boolean appendExecuteScript(TemplatePlanContext templateContext,String templateId,Variable runShScriptStringVar,Variable sshUserVariable,Variable sshKeyVariable,Variable serverIpPropWrapper){
  Map<String,Variable> runScriptRequestInputParams=new HashMap<String,Variable>();
  String cleanPropName=serverIpPropWrapper.getName().substring(serverIpPropWrapper.getName().lastIndexOf("String_Node_Str") + 1);
switch (cleanPropName) {
case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_SERVERIP:
    runScriptRequestInputParams.put("String_Node_Str",serverIpPropWrapper);
  runScriptRequestInputParams.put("String_Node_Str",sshKeyVariable);
runScriptRequestInputParams.put("String_Node_Str",sshUserVariable);
runScriptRequestInputParams.put("String_Node_Str",runShScriptStringVar);
this.invokerPlugin.handle(templateContext,templateId,true,"String_Node_Str","String_Node_Str","String_Node_Str",runScriptRequestInputParams,new HashMap<String,Variable>(),false);
break;
case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_VMIP:
case Properties.OPENTOSCA_DECLARATIVE_PROPERTYNAME_RASPBIANIP:
runScriptRequestInputParams.put("String_Node_Str",serverIpPropWrapper);
runScriptRequestInputParams.put("String_Node_Str",sshKeyVariable);
runScriptRequestInputParams.put("String_Node_Str",sshUserVariable);
runScriptRequestInputParams.put("String_Node_Str",runShScriptStringVar);
this.invokerPlugin.handle(templateContext,templateId,true,"String_Node_Str",Interfaces.OPENTOSCA_DECLARATIVE_INTERFACE_OPERATINGSYSTEM,"String_Node_Str",runScriptRequestInputParams,new HashMap<String,Variable>(),false);
break;
default :
return false;
}
return true;
}