Program: 50410
Project: 50410
Buggy source:
private int constructTargetIndexPermutations(int mergedReferenceIndex,final IndexedIdentifier mergedTargetIdentifiers,final Int2IntMap mergedTargetLengths,final AlignmentReaderImpl reader){
  final int[] targetLengths=reader.getTargetLength();
  final int targetLengthCount=ArrayUtils.getLength(targetLengths);
  final Int2IntMap tempPermutation=new Int2IntOpenHashMap();
  final IndexedIdentifier targetIdentifers=reader.getTargetIdentifiers();
  final DoubleIndexedIdentifier backward=new DoubleIndexedIdentifier(targetIdentifers);
  for (int i=0; i < reader.getNumberOfTargets(); i++) {
    final int newIndex=mergedReferenceIndex++;
    tempPermutation.put(i,newIndex);
    final MutableString targetId=backward.getId(i);
    if (targetId != null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + targetId + "String_Node_Str"+ newIndex);
      }
      mergedTargetIdentifiers.put(targetId,newIndex);
      final int targetLength;
      if (i < targetLengthCount) {
        targetLength=targetLengths[i];
      }
 else {
        targetLength=0;
      }
      mergedTargetLengths.put(newIndex,targetLength);
    }
  }
  int size=0;
  for (  final int key : tempPermutation.keySet()) {
    size=Math.max(key + 1,size);
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + size);
  }
  final int[] newPermutation=new int[size];
  for (  final int key : tempPermutation.keySet()) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + key);
    }
    newPermutation[key]=tempPermutation.get(key);
  }
  referenceIndexPermutation.add(newPermutation);
  return mergedReferenceIndex;
}

Fixed version (ground truth):
private int constructTargetIndexPermutations(int mergedReferenceIndex,final IndexedIdentifier mergedTargetIdentifiers,final Int2IntMap mergedTargetLengths,final AlignmentReaderImpl reader){
  final int[] targetLengths=reader.getTargetLength();
  final int targetLengthCount=ArrayUtils.getLength(targetLengths);
  final Int2IntMap tempPermutation=new Int2IntOpenHashMap();
  final IndexedIdentifier targetIdentifers=reader.getTargetIdentifiers();
  final DoubleIndexedIdentifier backward=new DoubleIndexedIdentifier(targetIdentifers);
  for (int i=0; i < reader.getNumberOfTargets(); i++) {
    MutableString id=backward.size() != 0 ? backward.getId(i) : new MutableString(String.valueOf(mergedTargetIdentifiers.size()));
    final int newIndex=mergedTargetIdentifiers.registerIdentifier(id);
    tempPermutation.put(i,newIndex);
    final MutableString targetId=backward.getId(i);
    if (targetId != null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + targetId + "String_Node_Str"+ newIndex);
      }
      mergedTargetIdentifiers.registerIdentifier(targetId);
      final int targetLength;
      if (i < targetLengthCount) {
        targetLength=targetLengths[i];
      }
 else {
        targetLength=0;
      }
      mergedTargetLengths.put(newIndex,targetLength);
    }
 else {
    }
  }
  int size=0;
  for (  final int key : tempPermutation.keySet()) {
    size=Math.max(key + 1,size);
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + size);
  }
  final int[] newPermutation=new int[size];
  for (  final int key : tempPermutation.keySet()) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + key);
    }
    newPermutation[key]=tempPermutation.get(key);
  }
  referenceIndexPermutation.add(newPermutation);
  return mergedTargetIdentifiers.size();
}