Program: 53225
Project: 53225
Buggy source:
public void migrateAll(){
  System.out.println("String_Node_Str");
  Module[] jcrModules=jcrRepositoryModuleService.listModules();
  List<Module> modules=new ArrayList<Module>(Arrays.asList(jcrModules));
  Module globalModule=jcrRepositoryModuleService.loadGlobalModule();
  modules.add(globalModule);
  for (  Module jcrModule : modules) {
    for (ModuleIterator packageItems=rulesRepository.listModules(); packageItems.hasNext(); ) {
      ModuleItem packageItem=packageItems.next();
      if (packageItem.getUUID().equals(jcrModule.getUuid())) {
        jcrModule.setCatRules(packageItem.getCategoryRules());
        break;
      }
    }
  }
  for (  Module jcrModule : modules) {
    try {
      jcrModule.setName(migrationPathManager.normalizePackageName(jcrModule.getName()));
      List<String> formats=new ArrayList<String>();
      formats.add("String_Node_Str");
      AssetPageRequest request=new AssetPageRequest(jcrModule.getUuid(),formats,null,0,10);
      PageResponse<AssetPageRow> response=jcrRepositoryAssetService.findAssetPage(request);
      if (response.getTotalRowSize() > 0) {
        AssetPageRow row=response.getPageRowList().get(0);
        AssetItem assetItemJCR=rulesRepository.loadAssetByUUID(row.getUuid());
        header=assetItemJCR.getContent();
      }
    }
 catch (    SerializationException e) {
      Jcr2VfsMigrationApp.hasErrors=true;
      throw new IllegalStateException(e);
    }
    boolean hasMorePages=true;
    int startRowIndex=0;
    final int pageSize=100;
    PageResponse<AssetPageRow> response;
    while (hasMorePages) {
      AssetPageRequest request=new AssetPageRequest(jcrModule.getUuid(),null,null,startRowIndex,pageSize);
      String assetName="String_Node_Str";
      try {
        response=jcrRepositoryAssetService.findAssetPage(request);
        for (        AssetPageRow row : response.getPageRowList()) {
          AssetItem assetItemJCR=rulesRepository.loadAssetByUUID(row.getUuid());
          assetName=assetItemJCR.getName();
          System.out.format("String_Node_Str",assetItemJCR.getName(),assetItemJCR.getFormat());
          migrateAssetHistory(jcrModule,row.getUuid());
          migrate(jcrModule,assetItemJCR,null);
          System.out.format("String_Node_Str",assetItemJCR.getName(),assetItemJCR.getFormat());
        }
      }
 catch (      SerializationException e) {
        System.out.println("String_Node_Str" + assetName + "String_Node_Str"+ jcrModule.getName());
        Jcr2VfsMigrationApp.hasErrors=true;
        throw new IllegalStateException(e);
      }
catch (      Exception e) {
        System.out.println("String_Node_Str" + assetName + "String_Node_Str"+ jcrModule.getName());
        Jcr2VfsMigrationApp.hasErrors=true;
        throw new IllegalStateException(e);
      }
      if (response.isLastPage()) {
        hasMorePages=false;
      }
 else {
        startRowIndex+=pageSize;
      }
    }
    List<String> globals=GlobalParser.parseGlobals(header);
    if (globals.size() > 0) {
      globalMigrater.migrate(jcrModule,globals);
    }
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void migrateAll(){
  System.out.println("String_Node_Str");
  Module[] jcrModules=jcrRepositoryModuleService.listModules();
  List<Module> modules=new ArrayList<Module>(Arrays.asList(jcrModules));
  Module globalModule=jcrRepositoryModuleService.loadGlobalModule();
  modules.add(globalModule);
  for (  Module jcrModule : modules) {
    for (ModuleIterator packageItems=rulesRepository.listModules(); packageItems.hasNext(); ) {
      ModuleItem packageItem=packageItems.next();
      if (packageItem.getUUID().equals(jcrModule.getUuid())) {
        jcrModule.setCatRules(packageItem.getCategoryRules());
        break;
      }
    }
  }
  for (  Module jcrModule : modules) {
    try {
      jcrModule.setName(migrationPathManager.normalizePackageName(jcrModule.getName()));
      List<String> formats=new ArrayList<String>();
      formats.add("String_Node_Str");
      AssetPageRequest request=new AssetPageRequest(jcrModule.getUuid(),formats,null,0,10);
      PageResponse<AssetPageRow> response=jcrRepositoryAssetService.findAssetPage(request);
      if (response.getTotalRowSize() > 0) {
        AssetPageRow row=response.getPageRowList().get(0);
        AssetItem assetItemJCR=rulesRepository.loadAssetByUUID(row.getUuid());
        header=assetItemJCR.getContent();
      }
    }
 catch (    SerializationException e) {
      Jcr2VfsMigrationApp.hasErrors=true;
      throw new IllegalStateException(e);
    }
    boolean hasMorePages=true;
    int startRowIndex=0;
    final int pageSize=100;
    PageResponse<AssetPageRow> response;
    while (hasMorePages) {
      AssetPageRequest request=new AssetPageRequest(jcrModule.getUuid(),null,null,startRowIndex,pageSize);
      String assetName="String_Node_Str";
      try {
        response=jcrRepositoryAssetService.findAssetPage(request);
        for (        AssetPageRow row : response.getPageRowList()) {
          AssetItem assetItemJCR=rulesRepository.loadAssetByUUID(row.getUuid());
          assetName=assetItemJCR.getName();
          System.out.format("String_Node_Str",assetItemJCR.getName(),assetItemJCR.getFormat());
          migrateAssetHistory(jcrModule,row.getUuid());
          migrate(jcrModule,assetItemJCR,null);
          System.out.format("String_Node_Str");
        }
      }
 catch (      SerializationException e) {
        System.out.println("String_Node_Str" + assetName + "String_Node_Str"+ jcrModule.getName());
        Jcr2VfsMigrationApp.hasErrors=true;
        throw new IllegalStateException(e);
      }
catch (      Exception e) {
        System.out.println("String_Node_Str" + assetName + "String_Node_Str"+ jcrModule.getName());
        Jcr2VfsMigrationApp.hasErrors=true;
        throw new IllegalStateException(e);
      }
      if (response.isLastPage()) {
        hasMorePages=false;
      }
 else {
        startRowIndex+=pageSize;
      }
    }
    List<String> globals=GlobalParser.parseGlobals(header);
    if (globals.size() > 0) {
      globalMigrater.migrate(jcrModule,globals);
    }
  }
  System.out.println("String_Node_Str");
}