Program: 40202
Project: 40202
Buggy source:
private static Map<String,Object> collectProperties(RemoteNeo4jAssociationPropertiesRow row,AssociationKey associationKey,AssociatedEntityKeyMetadata associatedEntityKeyMetadata){
  Map<String,Object> properties=new HashMap<String,Object>();
  String[] rowKeyColumnNames=associationKey.getMetadata().getRowKeyColumnNames();
  Map<String,Object> relationship=row.getRelationship();
  Map<String,Object> ownerNode=row.getOwnerNode();
  Map<String,Object> targetNode=row.getTargetNode();
  for (int i=0; i < rowKeyColumnNames.length; i++) {
    if (relationship.containsKey(rowKeyColumnNames[i])) {
      properties.put(rowKeyColumnNames[i],relationship.get(rowKeyColumnNames[i]));
    }
  }
  for (  String associationColumn : associatedEntityKeyMetadata.getAssociationKeyColumns()) {
    String targetColumnName=associatedEntityKeyMetadata.getCorrespondingEntityKeyColumn(associationColumn);
    if (isPartOfEmbedded(targetColumnName)) {
      String collectionRole=associationKey.getMetadata().getCollectionRole();
      if (targetColumnName.equals(collectionRole)) {
        targetColumnName=targetColumnName.substring(targetColumnName.lastIndexOf("String_Node_Str") + 1);
        if (targetNode.containsKey(targetColumnName)) {
          properties.put(associationColumn,targetNode.get(targetColumnName));
        }
      }
 else       if (targetNode.containsKey(targetColumnName)) {
        properties.put(associationColumn,targetNode.get(targetColumnName));
      }
 else {
        if (targetNode.containsKey(targetColumnName)) {
          properties.put(associationColumn,targetNode.get(targetColumnName));
        }
      }
    }
 else {
      if (targetNode.containsKey(targetColumnName)) {
        properties.put(associationColumn,targetNode.get(targetColumnName));
      }
    }
  }
  for (int i=0; i < associationKey.getColumnNames().length; i++) {
    String key=associationKey.getEntityKey().getColumnNames()[i];
    if (ownerNode.containsKey(key)) {
      properties.put(associationKey.getColumnNames()[i],ownerNode.get(key));
    }
  }
  return properties;
}

Fixed version (ground truth):
private static Map<String,Object> collectProperties(RemoteNeo4jAssociationPropertiesRow row,AssociationKey associationKey,AssociatedEntityKeyMetadata associatedEntityKeyMetadata){
  Map<String,Object> properties=new HashMap<String,Object>();
  String[] rowKeyColumnNames=associationKey.getMetadata().getRowKeyColumnNames();
  Map<String,Object> relationship=row.getRelationship();
  Map<String,Object> ownerNode=row.getOwnerNode();
  Map<String,Object> targetNode=row.getTargetNode();
  for (int i=0; i < rowKeyColumnNames.length; i++) {
    if (relationship.containsKey(rowKeyColumnNames[i])) {
      properties.put(rowKeyColumnNames[i],relationship.get(rowKeyColumnNames[i]));
    }
  }
  for (  String associationColumn : associatedEntityKeyMetadata.getAssociationKeyColumns()) {
    String targetColumnName=associatedEntityKeyMetadata.getCorrespondingEntityKeyColumn(associationColumn);
    if (isPartOfEmbedded(targetColumnName)) {
      String collectionRole=associationKey.getMetadata().getCollectionRole();
      if (targetColumnName.equals(collectionRole)) {
        targetColumnName=targetColumnName.substring(targetColumnName.lastIndexOf("String_Node_Str") + 1);
        if (targetNode.containsKey(targetColumnName)) {
          properties.put(associationColumn,targetNode.get(targetColumnName));
        }
      }
 else       if (targetNode.containsKey(targetColumnName)) {
        properties.put(associationColumn,targetNode.get(targetColumnName));
      }
      if (targetColumnName.startsWith(collectionRole)) {
        targetColumnName=targetColumnName.substring(collectionRole.length() + 1);
        if (targetNode.containsKey(targetColumnName)) {
          properties.put(associationColumn,targetNode.get(targetColumnName));
        }
      }
 else {
        if (targetNode.containsKey(targetColumnName)) {
          properties.put(associationColumn,targetNode.get(targetColumnName));
        }
      }
    }
 else {
      if (targetNode.containsKey(targetColumnName)) {
        properties.put(associationColumn,targetNode.get(targetColumnName));
      }
    }
  }
  for (int i=0; i < associationKey.getColumnNames().length; i++) {
    String key=associationKey.getEntityKey().getColumnNames()[i];
    if (ownerNode.containsKey(key)) {
      properties.put(associationKey.getColumnNames()[i],ownerNode.get(key));
    }
  }
  return properties;
}