Program: 66082
Project: 66082
Buggy source:
public static IBinding loadBinding(DataInputStream dis) throws IOException, DataException {
  int type=IOUtil.readInt(dis);
  String name=IOUtil.readString(dis);
  String function=IOUtil.readString(dis);
  IBaseExpression expr=ExprUtil.loadBaseExpr(dis);
  IBaseExpression filter=ExprUtil.loadBaseExpr(dis);
  Binding binding=new Binding(name);
  binding.setAggrFunction(function);
  binding.setDataType(type);
  binding.setExpression(expr);
  binding.setFilter(filter);
  int argSize=IOUtil.readInt(dis);
  for (int i=0; i < argSize; i++) {
    binding.addArgument(ExprUtil.loadBaseExpr(dis));
  }
  int aggrSize=IOUtil.readInt(dis);
  for (int i=0; i < aggrSize; i++) {
    binding.addAggregateOn(IOUtil.readString(dis));
  }
  if (VersionManager.getLatestVersion() >= VersionManager.VERSION_2_6_3_1) {
    boolean hasTimeFunction=IOUtil.readBool(dis);
    if (hasTimeFunction) {
      String timeDimensionName=IOUtil.readString(dis);
      TimeFunction time=new TimeFunction();
      if (timeDimensionName != null) {
        time.setTimeDimension(timeDimensionName);
        Date referenceDate=(Date)IOUtil.readObject(dis);
        time.setReferenceDate(new ReferenceDate(referenceDate));
        boolean containsBasePeriod=IOUtil.readBool(dis);
        if (containsBasePeriod) {
          TimePeriodType periodType=getPeriodType(IOUtil.readString(dis));
          int unit=IOUtil.readInt(dis);
          boolean isCurrent=IOUtil.readBool(dis);
          TimePeriod basedTimePeriod=new TimePeriod(unit,periodType,isCurrent);
          time.setBaseTimePeriod(basedTimePeriod);
        }
        boolean containsRelativePeriod=IOUtil.readBool(dis);
        if (containsRelativePeriod) {
          TimePeriodType periodType=getPeriodType(IOUtil.readString(dis));
          int unit=IOUtil.readInt(dis);
          TimePeriod relativeTimePeriod=new TimePeriod(unit,periodType);
          time.setRelativeTimePeriod(relativeTimePeriod);
        }
      }
      binding.setTimeFunction(time);
    }
  }
  return binding;
}

Fixed version (ground truth):
public static IBinding loadBinding(DataInputStream dis,int version) throws IOException, DataException {
  int type=IOUtil.readInt(dis);
  String name=IOUtil.readString(dis);
  String function=IOUtil.readString(dis);
  IBaseExpression expr=ExprUtil.loadBaseExpr(dis);
  IBaseExpression filter=ExprUtil.loadBaseExpr(dis);
  Binding binding=new Binding(name);
  binding.setAggrFunction(function);
  binding.setDataType(type);
  binding.setExpression(expr);
  binding.setFilter(filter);
  int argSize=IOUtil.readInt(dis);
  for (int i=0; i < argSize; i++) {
    binding.addArgument(ExprUtil.loadBaseExpr(dis));
  }
  int aggrSize=IOUtil.readInt(dis);
  for (int i=0; i < aggrSize; i++) {
    binding.addAggregateOn(IOUtil.readString(dis));
  }
  if (version >= VersionManager.VERSION_2_6_3_1) {
    boolean hasTimeFunction=IOUtil.readBool(dis);
    if (hasTimeFunction) {
      String timeDimensionName=IOUtil.readString(dis);
      TimeFunction time=new TimeFunction();
      if (timeDimensionName != null) {
        time.setTimeDimension(timeDimensionName);
        Date referenceDate=(Date)IOUtil.readObject(dis);
        time.setReferenceDate(new ReferenceDate(referenceDate));
        boolean containsBasePeriod=IOUtil.readBool(dis);
        if (containsBasePeriod) {
          TimePeriodType periodType=getPeriodType(IOUtil.readString(dis));
          int unit=IOUtil.readInt(dis);
          boolean isCurrent=IOUtil.readBool(dis);
          TimePeriod basedTimePeriod=new TimePeriod(unit,periodType,isCurrent);
          time.setBaseTimePeriod(basedTimePeriod);
        }
        boolean containsRelativePeriod=IOUtil.readBool(dis);
        if (containsRelativePeriod) {
          TimePeriodType periodType=getPeriodType(IOUtil.readString(dis));
          int unit=IOUtil.readInt(dis);
          TimePeriod relativeTimePeriod=new TimePeriod(unit,periodType);
          time.setRelativeTimePeriod(relativeTimePeriod);
        }
      }
      binding.setTimeFunction(time);
    }
  }
  return binding;
}