Program: 62159
Project: 62159
Buggy source:
private void updateApplicationTopology(PaaSInstancePersistentResourceMonitorEvent persistentResourceEvent,final Map<String,Object> persistentProperties){
  Deployment deployment=deploymentService.get(persistentResourceEvent.getDeploymentId());
  String deploymentTopologyId=DeploymentTopology.generateId(deployment.getVersionId(),deployment.getEnvironmentId());
  String topologyId=deployment.getSourceId() + "String_Node_Str" + deployment.getVersionId();
  Topology topology=topoServiceCore.getOrFail(topologyId);
  NodeTemplate nodeTemplate;
  try {
    nodeTemplate=TopologyUtils.getNodeTemplate(topology,persistentResourceEvent.getNodeTemplateId());
  }
 catch (  NotFoundException e) {
    log.warn("String_Node_Str",persistentResourceEvent.getNodeTemplateId(),e);
    return;
  }
  for (  String propertyName : persistentProperties.keySet()) {
    Object propertyValue=persistentProperties.get(propertyName);
    AbstractPropertyValue abstractPropertyValue=nodeTemplate.getProperties().get(propertyName);
    if (abstractPropertyValue != null && abstractPropertyValue instanceof FunctionPropertyValue) {
      FunctionPropertyValue function=(FunctionPropertyValue)abstractPropertyValue;
      if (function.getFunction().equals(ToscaFunctionConstants.GET_INPUT) && propertyValue instanceof String) {
        DeploymentInputs deploymentInputs=alienDAO.findById(DeploymentInputs.class,AbstractDeploymentConfig.generateId(deployment.getVersionId(),deployment.getEnvironmentId()));
        log.info("String_Node_Str",deploymentInputs.getId(),function.getTemplateName());
        log.debug("String_Node_Str",propertyName,persistentResourceEvent.getPersistentProperties().get(propertyName),propertyValue);
        deploymentInputs.getInputs().put(function.getTemplateName(),new ScalarPropertyValue((String)propertyValue));
        alienDAO.save(deploymentInputs);
      }
 else {
        log.warn("String_Node_Str");
        return;
      }
    }
 else {
      DeploymentMatchingConfiguration matchingConfiguration=alienDAO.findById(DeploymentMatchingConfiguration.class,AbstractDeploymentConfig.generateId(deployment.getVersionId(),deployment.getEnvironmentId()));
      log.info("String_Node_Str",propertyName,matchingConfiguration.getId(),persistentResourceEvent.getNodeTemplateId());
      log.debug("String_Node_Str",persistentResourceEvent.getPersistentProperties().get(propertyName),propertyValue);
      matchingConfiguration.getMatchedNodesConfiguration().get(persistentResourceEvent.getNodeTemplateId()).getProperties().put(propertyName,getPropertyValue(propertyValue));
      alienDAO.save(matchingConfiguration);
    }
  }
}

Fixed version (ground truth):
private void updateApplicationTopology(PaaSInstancePersistentResourceMonitorEvent persistentResourceEvent,final Map<String,Object> persistentProperties){
  Deployment deployment=deploymentService.get(persistentResourceEvent.getDeploymentId());
  String topologyId=deployment.getSourceId() + "String_Node_Str" + deployment.getVersionId();
  Topology topology=topoServiceCore.getOrFail(topologyId);
  NodeTemplate nodeTemplate;
  try {
    nodeTemplate=TopologyUtils.getNodeTemplate(topology,persistentResourceEvent.getNodeTemplateId());
  }
 catch (  NotFoundException e) {
    log.warn("String_Node_Str",persistentResourceEvent.getNodeTemplateId(),e);
    return;
  }
  for (  String propertyName : persistentProperties.keySet()) {
    Object propertyValue=persistentProperties.get(propertyName);
    AbstractPropertyValue abstractPropertyValue=nodeTemplate.getProperties().get(propertyName);
    if (abstractPropertyValue != null && abstractPropertyValue instanceof FunctionPropertyValue) {
      FunctionPropertyValue function=(FunctionPropertyValue)abstractPropertyValue;
      if (function.getFunction().equals(ToscaFunctionConstants.GET_INPUT) && propertyValue instanceof String) {
        DeploymentInputs deploymentInputs=alienDAO.findById(DeploymentInputs.class,AbstractDeploymentConfig.generateId(deployment.getVersionId(),deployment.getEnvironmentId()));
        log.info("String_Node_Str",deploymentInputs.getId(),function.getTemplateName());
        log.debug("String_Node_Str",propertyName,persistentResourceEvent.getPersistentProperties().get(propertyName),propertyValue);
        deploymentInputs.getInputs().put(function.getTemplateName(),new ScalarPropertyValue((String)propertyValue));
        alienDAO.save(deploymentInputs);
      }
 else {
        log.warn("String_Node_Str");
        return;
      }
    }
 else {
      DeploymentMatchingConfiguration matchingConfiguration=alienDAO.findById(DeploymentMatchingConfiguration.class,AbstractDeploymentConfig.generateId(deployment.getVersionId(),deployment.getEnvironmentId()));
      log.info("String_Node_Str",propertyName,matchingConfiguration.getId(),persistentResourceEvent.getNodeTemplateId());
      log.debug("String_Node_Str",persistentResourceEvent.getPersistentProperties().get(propertyName),propertyValue);
      matchingConfiguration.getMatchedNodesConfiguration().get(persistentResourceEvent.getNodeTemplateId()).getProperties().put(propertyName,getPropertyValue(propertyValue));
      alienDAO.save(matchingConfiguration);
    }
  }
}