Program: 30590
Project: 30590
Buggy source:
public void validateChromosomeCounts(){
  if (!hasGenotypes())   return;
  if (hasAttribute(VCFConstants.ALLELE_NUMBER_KEY)) {
    int reportedAN=Integer.valueOf(getAttribute(VCFConstants.ALLELE_NUMBER_KEY).toString());
    int observedAN=getCalledChrCount();
    if (reportedAN != observedAN)     throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedAN,observedAN));
  }
  if (hasAttribute(VCFConstants.ALLELE_COUNT_KEY)) {
    ArrayList<Integer> observedACs=new ArrayList<Integer>();
    if (getAlternateAlleles().size() > 0) {
      for (      Allele allele : getAlternateAlleles()) {
        observedACs.add(getCalledChrCount(allele));
      }
    }
 else {
      observedACs.add(0);
    }
    if (getAttribute(VCFConstants.ALLELE_COUNT_KEY) instanceof List) {
      Collections.sort(observedACs);
      List reportedACs=(List)getAttribute(VCFConstants.ALLELE_COUNT_KEY);
      Collections.sort(reportedACs);
      if (observedACs.size() != reportedACs.size())       throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedACs.size(),observedACs.size()));
      for (int i=0; i < observedACs.size(); i++) {
        if (Integer.valueOf(reportedACs.get(i).toString()) != observedACs.get(i))         throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedACs.get(i),observedACs.get(i)));
      }
    }
 else {
      if (observedACs.size() != 1)       throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart()));
      int reportedAC=Integer.valueOf(getAttribute(VCFConstants.ALLELE_COUNT_KEY).toString());
      if (reportedAC != observedACs.get(0))       throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedAC,observedACs.get(0)));
    }
  }
}

Fixed version (ground truth):
public void validateChromosomeCounts(){
  if (!hasGenotypes())   return;
  if (hasAttribute(VCFConstants.ALLELE_NUMBER_KEY)) {
    int reportedAN=Integer.valueOf(getAttribute(VCFConstants.ALLELE_NUMBER_KEY).toString());
    int observedAN=getCalledChrCount();
    if (reportedAN != observedAN)     throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedAN,observedAN));
  }
  if (hasAttribute(VCFConstants.ALLELE_COUNT_KEY)) {
    ArrayList<Integer> observedACs=new ArrayList<Integer>();
    if (getAlternateAlleles().size() > 0) {
      for (      Allele allele : getAlternateAlleles()) {
        observedACs.add(getCalledChrCount(allele));
      }
    }
 else {
      observedACs.add(0);
    }
    if (getAttribute(VCFConstants.ALLELE_COUNT_KEY) instanceof List) {
      final List reportedACs=(List)getAttribute(VCFConstants.ALLELE_COUNT_KEY);
      if (observedACs.size() != reportedACs.size())       throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedACs.size(),observedACs.size()));
      for (int i=0; i < observedACs.size(); i++) {
        final int reportedAC=Integer.valueOf(reportedACs.get(i).toString());
        if (reportedAC != observedACs.get(i))         throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedAC,observedACs.get(i)));
      }
    }
 else {
      if (observedACs.size() != 1)       throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart()));
      int reportedAC=Integer.valueOf(getAttribute(VCFConstants.ALLELE_COUNT_KEY).toString());
      if (reportedAC != observedACs.get(0))       throw new TribbleException.InternalCodecException(String.format("String_Node_Str",getChr(),getStart(),reportedAC,observedACs.get(0)));
    }
  }
}