Program: 40972
Project: 40972
Buggy source:
/** 
 * Updates the input parameters. If instance data are available the provided input parameters will be overwritten with them.
 * @param inputParams
 * @param csarID
 * @param serviceTemplateID
 * @param nodeTypeID
 * @param nodeTemplateID
 * @param neededInterface
 * @param neededOperation
 * @param serviceInstanceID
 * @return the updated input parameters.
 */
private HashMap<String,String> updateInputParams(final HashMap<String,String> inputParams,final CSARID csarID,final QName serviceTemplateID,QName nodeTypeID,final String nodeTemplateID,final String neededInterface,final String neededOperation,final URI serviceInstanceID){
  ManagementBusServiceImpl.LOG.debug("String_Node_Str",inputParams.size(),neededOperation,inputParams.toString());
  nodeTypeID=ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID,serviceTemplateID,nodeTemplateID);
  final List<String> expectedParams=this.getExpectedInputParams(csarID,nodeTypeID,neededInterface,neededOperation);
  ManagementBusServiceImpl.LOG.debug("String_Node_Str",neededOperation,expectedParams.size(),expectedParams.toString());
  if (!expectedParams.isEmpty()) {
    if ((serviceInstanceID != null) && (!serviceInstanceID.toString().equals("String_Node_Str"))) {
      ManagementBusServiceImpl.LOG.debug("String_Node_Str",serviceInstanceID);
      final HashMap<String,String> propertiesMap=MBUtils.getInstanceDataProperties(csarID,serviceTemplateID,nodeTemplateID.trim(),serviceInstanceID);
      ManagementBusServiceImpl.LOG.debug("String_Node_Str");
      for (      final String key : propertiesMap.keySet()) {
        ManagementBusServiceImpl.LOG.debug("String_Node_Str" + key + "String_Node_Str"+ propertiesMap.get(key));
      }
      if (propertiesMap != null) {
        final List<String> supportedIPPropertyNames=Utils.getSupportedVirtualMachineIPPropertyNames();
        final List<String> supportedInstanceIdPropertyNames=Utils.getSupportedVirtualMachineInstanceIdPropertyNames();
        final List<String> supportedPasswordPropertyNames=Utils.getSupportedVirtualMachineLoginPasswordPropertyNames();
        final List<String> supportedUsernamePropertyNames=Utils.getSupportedVirtualMachineLoginUserNamePropertyNames();
        ManagementBusServiceImpl.LOG.debug("String_Node_Str",serviceInstanceID,nodeTemplateID,propertiesMap.toString());
        String prop;
        for (        final String expectedParam : expectedParams) {
          if (supportedIPPropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedIPPropertyNames,propertiesMap);
            if (prop != null) {
              inputParams.put(expectedParam,prop);
            }
          }
 else           if (supportedInstanceIdPropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedInstanceIdPropertyNames,propertiesMap);
            if (prop != null) {
              inputParams.put(expectedParam,prop);
            }
          }
 else           if (supportedPasswordPropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedPasswordPropertyNames,propertiesMap);
            if (prop != null) {
              inputParams.put(expectedParam,prop);
            }
          }
 else           if (supportedUsernamePropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedUsernamePropertyNames,propertiesMap);
            if (prop != null) {
              inputParams.put(expectedParam,prop);
            }
          }
 else {
            for (            final String propName : propertiesMap.keySet()) {
              if (expectedParam.equals(propName)) {
                inputParams.put(expectedParam,propertiesMap.get(propName));
              }
            }
          }
        }
        ManagementBusServiceImpl.LOG.debug("String_Node_Str",inputParams.size(),neededOperation,inputParams.toString());
      }
 else {
        ManagementBusServiceImpl.LOG.debug("String_Node_Str");
      }
    }
 else {
      ManagementBusServiceImpl.LOG.debug("String_Node_Str");
    }
  }
  return inputParams;
}

Fixed version (ground truth):
/** 
 * Updates the input parameters. If instance data are available the provided input parameters will be overwritten with them.
 * @param inputParams
 * @param csarID
 * @param serviceTemplateID
 * @param nodeTypeID
 * @param nodeTemplateID
 * @param neededInterface
 * @param neededOperation
 * @param serviceInstanceID
 * @return the updated input parameters.
 */
private HashMap<String,String> updateInputParams(final HashMap<String,String> inputParams,final CSARID csarID,final QName serviceTemplateID,QName nodeTypeID,final String nodeTemplateID,final String neededInterface,final String neededOperation,final URI serviceInstanceID){
  ManagementBusServiceImpl.LOG.debug("String_Node_Str",inputParams.size(),neededOperation,inputParams.toString());
  nodeTypeID=ServiceHandler.toscaEngineService.getNodeTypeOfNodeTemplate(csarID,serviceTemplateID,nodeTemplateID);
  final List<String> expectedParams=this.getExpectedInputParams(csarID,nodeTypeID,neededInterface,neededOperation);
  ManagementBusServiceImpl.LOG.debug("String_Node_Str",neededOperation,expectedParams.size(),expectedParams.toString());
  if (!expectedParams.isEmpty()) {
    if ((serviceInstanceID != null) && (!serviceInstanceID.toString().equals("String_Node_Str"))) {
      ManagementBusServiceImpl.LOG.debug("String_Node_Str",serviceInstanceID);
      final HashMap<String,String> propertiesMap=MBUtils.getInstanceDataProperties(csarID,serviceTemplateID,nodeTemplateID.trim(),serviceInstanceID);
      ManagementBusServiceImpl.LOG.debug("String_Node_Str");
      for (      final String key : propertiesMap.keySet()) {
        ManagementBusServiceImpl.LOG.debug("String_Node_Str" + key + "String_Node_Str"+ propertiesMap.get(key));
      }
      if (propertiesMap != null) {
        final List<String> supportedIPPropertyNames=Utils.getSupportedVirtualMachineIPPropertyNames();
        final List<String> supportedInstanceIdPropertyNames=Utils.getSupportedVirtualMachineInstanceIdPropertyNames();
        final List<String> supportedPasswordPropertyNames=Utils.getSupportedVirtualMachineLoginPasswordPropertyNames();
        final List<String> supportedUsernamePropertyNames=Utils.getSupportedVirtualMachineLoginUserNamePropertyNames();
        ManagementBusServiceImpl.LOG.debug("String_Node_Str",serviceInstanceID,nodeTemplateID,propertiesMap.toString());
        String prop;
        for (        final String expectedParam : expectedParams) {
          if (supportedIPPropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedIPPropertyNames,propertiesMap);
            if (prop != null) {
              this.putOnlyIfNotSet(inputParams,expectedParam,prop);
            }
          }
 else           if (supportedInstanceIdPropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedInstanceIdPropertyNames,propertiesMap);
            if (prop != null) {
              this.putOnlyIfNotSet(inputParams,expectedParam,prop);
            }
          }
 else           if (supportedPasswordPropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedPasswordPropertyNames,propertiesMap);
            if (prop != null) {
              this.putOnlyIfNotSet(inputParams,expectedParam,prop);
            }
          }
 else           if (supportedUsernamePropertyNames.contains(expectedParam)) {
            ManagementBusServiceImpl.LOG.debug("String_Node_Str");
            prop=this.getSupportedProperty(supportedUsernamePropertyNames,propertiesMap);
            if (prop != null) {
              this.putOnlyIfNotSet(inputParams,expectedParam,prop);
            }
          }
 else {
            for (            final String propName : propertiesMap.keySet()) {
              if (expectedParam.equals(propName)) {
                this.putOnlyIfNotSet(inputParams,expectedParam,propertiesMap.get(propName));
              }
            }
          }
        }
        ManagementBusServiceImpl.LOG.debug("String_Node_Str",inputParams.size(),neededOperation,inputParams.toString());
      }
 else {
        ManagementBusServiceImpl.LOG.debug("String_Node_Str");
      }
    }
 else {
      ManagementBusServiceImpl.LOG.debug("String_Node_Str");
    }
  }
  return inputParams;
}