Program: 5430
Project: 5430
Buggy source:
/** 
 * Returns metadata for a given set of entities
 * @param targetIds entities for which metadata is required
 * @return map of entitiyId to set of metadata for that entity
 */
public Set<Metadata> getMetadata(Set<? extends NamespacedEntityId> targetIds){
  if (targetIds.isEmpty()) {
    return Collections.emptySet();
  }
  List<ImmutablePair<byte[],byte[]>> fuzzyKeys=new ArrayList<>();
  for (  NamespacedEntityId targetId : targetIds) {
    fuzzyKeys.add(getFuzzyKeyFor(targetId));
  }
  Collections.sort(fuzzyKeys,FUZZY_KEY_COMPARATOR);
  Multimap<NamespacedEntityId,MetadataEntry> metadataMap=HashMultimap.create();
  byte[] start=fuzzyKeys.get(0).getFirst();
  byte[] end=Bytes.stopKeyForPrefix(fuzzyKeys.get(fuzzyKeys.size() - 1).getFirst());
  try (Scanner scan=indexedTable.scan(new Scan(start,end,new FuzzyRowFilter(fuzzyKeys)))){
    Row next;
    while ((next=scan.next()) != null) {
      MetadataEntry metadataEntry=convertRow(next);
      if (metadataEntry != null) {
        metadataMap.put(metadataEntry.getTargetId(),metadataEntry);
      }
    }
  }
   Set<Metadata> metadataSet=new HashSet<>();
  for (  Map.Entry<NamespacedEntityId,Collection<MetadataEntry>> entry : metadataMap.asMap().entrySet()) {
    Map<String,String> properties=new HashMap<>();
    Set<String> tags=Collections.emptySet();
    for (    MetadataEntry metadataEntry : entry.getValue()) {
      if (TAGS_KEY.equals(metadataEntry.getKey())) {
        tags=splitTags(metadataEntry.getValue());
      }
 else {
        properties.put(metadataEntry.getKey(),metadataEntry.getValue());
      }
    }
    metadataSet.add(new Metadata(entry.getKey(),properties,tags));
  }
  return metadataSet;
}

Fixed version (ground truth):
/** 
 * Returns metadata for a given set of entities
 * @param targetIds entities for which metadata is required
 * @return map of entitiyId to set of metadata for that entity
 */
public Set<Metadata> getMetadata(Set<? extends NamespacedEntityId> targetIds){
  if (targetIds.isEmpty()) {
    return Collections.emptySet();
  }
  List<ImmutablePair<byte[],byte[]>> fuzzyKeys=new ArrayList<>(targetIds.size());
  for (  NamespacedEntityId targetId : targetIds) {
    fuzzyKeys.add(getFuzzyKeyFor(targetId));
  }
  Collections.sort(fuzzyKeys,FUZZY_KEY_COMPARATOR);
  Multimap<NamespacedEntityId,MetadataEntry> metadataMap=HashMultimap.create();
  byte[] start=fuzzyKeys.get(0).getFirst();
  byte[] end=Bytes.stopKeyForPrefix(fuzzyKeys.get(fuzzyKeys.size() - 1).getFirst());
  try (Scanner scan=indexedTable.scan(new Scan(start,end,new FuzzyRowFilter(fuzzyKeys)))){
    Row next;
    while ((next=scan.next()) != null) {
      MetadataEntry metadataEntry=convertRow(next);
      if (metadataEntry != null) {
        metadataMap.put(metadataEntry.getTargetId(),metadataEntry);
      }
    }
  }
   Set<Metadata> metadataSet=new HashSet<>();
  for (  Map.Entry<NamespacedEntityId,Collection<MetadataEntry>> entry : metadataMap.asMap().entrySet()) {
    Map<String,String> properties=new HashMap<>();
    Set<String> tags=Collections.emptySet();
    for (    MetadataEntry metadataEntry : entry.getValue()) {
      if (TAGS_KEY.equals(metadataEntry.getKey())) {
        tags=splitTags(metadataEntry.getValue());
      }
 else {
        properties.put(metadataEntry.getKey(),metadataEntry.getValue());
      }
    }
    metadataSet.add(new Metadata(entry.getKey(),properties,tags));
  }
  return metadataSet;
}