Program: 6564
Project: 6564
Buggy source:
List<BusinessMetadataRecord> executeSearchOnColumns(String column,String searchValue,MetadataSearchTargetType type){
  List<BusinessMetadataRecord> results=new LinkedList<>();
  Scanner scanner;
  String lowerCaseSearchValue=searchValue.toLowerCase();
  if (lowerCaseSearchValue.endsWith("String_Node_Str")) {
    byte[] startKey=Bytes.toBytes(lowerCaseSearchValue.substring(0,lowerCaseSearchValue.lastIndexOf("String_Node_Str")));
    byte[] stopKey=Bytes.stopKeyForPrefix(startKey);
    scanner=indexedTable.scanByIndex(Bytes.toBytes(column),startKey,stopKey);
  }
 else {
    byte[] value=Bytes.toBytes(lowerCaseSearchValue);
    scanner=indexedTable.readByIndex(Bytes.toBytes(column),value);
  }
  try {
    Row next;
    while ((next=scanner.next()) != null) {
      String rowValue=next.getString(VALUE_COLUMN);
      if (rowValue == null) {
        continue;
      }
      final byte[] rowKey=next.getRow();
      String targetType=MdsValueKey.getTargetType(rowKey);
      if ((type != MetadataSearchTargetType.ALL) && (!targetType.equals(type.getInternalName()))) {
        continue;
      }
      Id.NamespacedId targetId=MdsValueKey.getNamespaceIdFromKey(targetType,new MDSKey(rowKey));
      String key=MdsValueKey.getMetadataKey(targetType,rowKey);
      String value=Bytes.toString(next.get(Bytes.toBytes(BusinessMetadataDataset.VALUE_COLUMN)));
      BusinessMetadataRecord record=new BusinessMetadataRecord(targetId,key,value);
      results.add(record);
    }
  }
  finally {
    scanner.close();
  }
  return results;
}

Fixed version (ground truth):
List<BusinessMetadataRecord> executeSearchOnColumns(String namespaceId,String column,String searchValue,MetadataSearchTargetType type){
  List<BusinessMetadataRecord> results=new LinkedList<>();
  Scanner scanner;
  String namespacedSearchValue=namespaceId + KEYVALUE_SEPARATOR + searchValue.toLowerCase();
  if (namespacedSearchValue.endsWith("String_Node_Str")) {
    byte[] startKey=Bytes.toBytes(namespacedSearchValue.substring(0,namespacedSearchValue.lastIndexOf("String_Node_Str")));
    byte[] stopKey=Bytes.stopKeyForPrefix(startKey);
    scanner=indexedTable.scanByIndex(Bytes.toBytes(column),startKey,stopKey);
  }
 else {
    byte[] value=Bytes.toBytes(namespacedSearchValue);
    scanner=indexedTable.readByIndex(Bytes.toBytes(column),value);
  }
  try {
    Row next;
    while ((next=scanner.next()) != null) {
      String rowValue=next.getString(VALUE_COLUMN);
      if (rowValue == null) {
        continue;
      }
      final byte[] rowKey=next.getRow();
      String targetType=MdsValueKey.getTargetType(rowKey);
      if ((type != MetadataSearchTargetType.ALL) && (!targetType.equals(type.getInternalName()))) {
        continue;
      }
      Id.NamespacedId targetId=MdsValueKey.getNamespaceIdFromKey(targetType,new MDSKey(rowKey));
      String key=MdsValueKey.getMetadataKey(targetType,rowKey);
      String value=Bytes.toString(next.get(Bytes.toBytes(BusinessMetadataDataset.VALUE_COLUMN)));
      BusinessMetadataRecord record=new BusinessMetadataRecord(targetId,key,value);
      results.add(record);
    }
  }
  finally {
    scanner.close();
  }
  return results;
}