Program: 62158
Project: 62158
Buggy source:
public void validateNodeTemplate(List<PropertiesTask> toReturnTaskList,NodeType relatedIndexedNodeType,NodeTemplate nodeTemplate,String nodeTempalteName,boolean skipInputProperties){
  PropertiesTask task=new PropertiesTask();
  task.setNodeTemplateName(nodeTempalteName);
  task.setComponent(relatedIndexedNodeType);
  task.setCode(TaskCode.PROPERTIES);
  task.setProperties(Maps.newHashMap());
  if (MapUtils.isNotEmpty(nodeTemplate.getProperties())) {
    addRequiredPropertyIdToTaskProperties(null,nodeTemplate.getProperties(),relatedIndexedNodeType.getProperties(),task,skipInputProperties);
  }
  for (  Map.Entry<String,RelationshipTemplate> relationshipEntry : safe(nodeTemplate.getRelationships()).entrySet()) {
    RelationshipTemplate relationship=relationshipEntry.getValue();
    if (relationship.getProperties() == null || relationship.getProperties().isEmpty()) {
      continue;
    }
    addRequiredPropertyIdToTaskProperties("String_Node_Str" + relationshipEntry.getKey() + "String_Node_Str",relationship.getProperties(),getRelationshipPropertyDefinition(nodeTemplate),task,skipInputProperties);
  }
  for (  Map.Entry<String,Capability> capabilityEntry : safe(nodeTemplate.getCapabilities()).entrySet()) {
    Capability capability=capabilityEntry.getValue();
    if (capability.getProperties() == null || capability.getProperties().isEmpty()) {
      continue;
    }
    addRequiredPropertyIdToTaskProperties("String_Node_Str" + capabilityEntry.getKey() + "String_Node_Str",capability.getProperties(),getCapabilitiesPropertyDefinition(nodeTemplate),task,skipInputProperties);
    if (capability.getType().equals(NormativeCapabilityTypes.SCALABLE)) {
      Map<String,AbstractPropertyValue> scalableProperties=capability.getProperties();
      verifyScalableProperties(scalableProperties,toReturnTaskList,nodeTempalteName,skipInputProperties);
    }
  }
  if (MapUtils.isNotEmpty(task.getProperties())) {
    toReturnTaskList.add(task);
  }
}

Fixed version (ground truth):
public void validateNodeTemplate(List<PropertiesTask> toReturnTaskList,NodeType relatedIndexedNodeType,NodeTemplate nodeTemplate,String nodeTempalteName,boolean skipInputProperties){
  PropertiesTask task=new PropertiesTask();
  task.setNodeTemplateName(nodeTempalteName);
  task.setComponent(relatedIndexedNodeType);
  task.setCode(TaskCode.PROPERTIES);
  task.setProperties(Maps.newHashMap());
  if (MapUtils.isNotEmpty(nodeTemplate.getProperties())) {
    addRequiredPropertyIdToTaskProperties(null,nodeTemplate.getProperties(),relatedIndexedNodeType.getProperties(),task,skipInputProperties);
  }
  for (  Map.Entry<String,RelationshipTemplate> relationshipEntry : safe(nodeTemplate.getRelationships()).entrySet()) {
    RelationshipTemplate relationship=relationshipEntry.getValue();
    if (relationship.getProperties() == null || relationship.getProperties().isEmpty()) {
      continue;
    }
    addRequiredPropertyIdToTaskProperties("String_Node_Str" + relationshipEntry.getKey() + "String_Node_Str",relationship.getProperties(),safe(ToscaContext.getOrFail(RelationshipType.class,relationshipEntry.getValue().getType()).getProperties()),task,skipInputProperties);
  }
  for (  Map.Entry<String,Capability> capabilityEntry : safe(nodeTemplate.getCapabilities()).entrySet()) {
    Capability capability=capabilityEntry.getValue();
    if (capability.getProperties() == null || capability.getProperties().isEmpty()) {
      continue;
    }
    addRequiredPropertyIdToTaskProperties("String_Node_Str" + capabilityEntry.getKey() + "String_Node_Str",capability.getProperties(),safe(ToscaContext.getOrFail(CapabilityType.class,capabilityEntry.getValue().getType()).getProperties()),task,skipInputProperties);
    if (capability.getType().equals(NormativeCapabilityTypes.SCALABLE)) {
      Map<String,AbstractPropertyValue> scalableProperties=capability.getProperties();
      verifyScalableProperties(scalableProperties,toReturnTaskList,nodeTempalteName,skipInputProperties);
    }
  }
  if (MapUtils.isNotEmpty(task.getProperties())) {
    toReturnTaskList.add(task);
  }
}