Program: 9564
Project: 9564
Buggy source:
public void completeTypeBindings(){
  stepCompleted=BUILD_TYPE_HIERARCHY;
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    units[i].scope.checkAndSetImports();
  }
  stepCompleted=CHECK_AND_SET_IMPORTS;
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    units[i].scope.connectTypeHierarchy();
  }
  stepCompleted=CONNECT_TYPE_HIERARCHY;
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    units[i].scope.buildFieldsAndMethods();
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      factory.addSourceTypeBinding(b[j]);
    }
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      buildInterTypeAndPerClause(b[j].scope);
    }
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      resolvePointcutDeclarations(b[j].scope);
    }
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      addCrosscuttingStructures(b[j].scope);
    }
  }
  factory.finishTypeMungers();
  Collection typeMungers=factory.getTypeMungers();
  Collection declareParents=factory.getDeclareParents();
  doPendingWeaves();
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    weaveInterTypeDeclarations(units[i].scope,typeMungers,declareParents);
    units[i]=null;
  }
  stepCompleted=BUILD_FIELDS_AND_METHODS;
  lastCompletedUnitIndex=lastUnitIndex;
}

Fixed version (ground truth):
public void completeTypeBindings(){
  stepCompleted=BUILD_TYPE_HIERARCHY;
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    units[i].scope.checkAndSetImports();
  }
  stepCompleted=CHECK_AND_SET_IMPORTS;
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    units[i].scope.connectTypeHierarchy();
  }
  stepCompleted=CONNECT_TYPE_HIERARCHY;
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    units[i].scope.buildFieldsAndMethods();
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      factory.addSourceTypeBinding(b[j]);
    }
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      buildInterTypeAndPerClause(b[j].scope);
      addCrosscuttingStructures(b[j].scope);
    }
  }
  factory.finishTypeMungers();
  Collection typeMungers=factory.getTypeMungers();
  Collection declareParents=factory.getDeclareParents();
  doPendingWeaves();
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    weaveInterTypeDeclarations(units[i].scope,typeMungers,declareParents);
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      resolvePointcutDeclarations(b[j].scope);
    }
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    SourceTypeBinding[] b=units[i].scope.topLevelTypes;
    for (int j=0; j < b.length; j++) {
      addAdviceLikeDeclares(b[j].scope);
    }
  }
  for (int i=lastCompletedUnitIndex + 1; i <= lastUnitIndex; i++) {
    units[i]=null;
  }
  stepCompleted=BUILD_FIELDS_AND_METHODS;
  lastCompletedUnitIndex=lastUnitIndex;
}