Program: 51741
Project: 51741
Buggy source:
public static List<String> injectWorldIDMap(Map<String,Integer> dataList,int[] blockedIds,Map<String,String> blockAliases,Map<String,String> itemAliases,boolean injectFrozenData,boolean isLocalWorld){
  FMLLog.info("String_Node_Str",FMLCommonHandler.instance().getEffectiveSide().isServer() ? "String_Node_Str" : "String_Node_Str");
  Map<String,Integer[]> remaps=Maps.newHashMap();
  LinkedHashMap<String,Integer> missingMappings=new LinkedHashMap<String,Integer>();
  getMain().testConsistency();
  getMain().iBlockRegistry.dump();
  getMain().iItemRegistry.dump();
  GameData newData=new GameData();
  for (  int id : blockedIds) {
    newData.block(id);
  }
  for (  Map.Entry<String,String> entry : blockAliases.entrySet()) {
    newData.iBlockRegistry.addAlias(entry.getKey(),entry.getValue());
  }
  for (  Map.Entry<String,String> entry : itemAliases.entrySet()) {
    newData.iItemRegistry.addAlias(entry.getKey(),entry.getValue());
  }
  for (int pass=0; pass < 2; pass++) {
    boolean isBlock=(pass == 0);
    for (    Entry<String,Integer> entry : dataList.entrySet()) {
      String itemName=entry.getKey();
      int newId=entry.getValue();
      if ((itemName.charAt(0) == '\u0001') != isBlock)       continue;
      itemName=itemName.substring(1);
      int currId=isBlock ? getMain().iBlockRegistry.getId(itemName) : getMain().iItemRegistry.getId(itemName);
      if (currId == -1) {
        FMLLog.info("String_Node_Str",itemName);
        missingMappings.put(entry.getKey(),newId);
        continue;
      }
 else       if (currId != newId) {
        FMLLog.info("String_Node_Str",isBlock ? "String_Node_Str" : "String_Node_Str",itemName,currId,newId);
        remaps.put(itemName,new Integer[]{currId,newId});
      }
      if (isBlock) {
        Block block=getMain().iBlockRegistry.getRaw(itemName);
        if (block == null)         throw new IllegalStateException(String.format("String_Node_Str",itemName,currId));
        currId=newData.registerBlock(block,itemName,null,newId);
      }
 else {
        Item item=getMain().iItemRegistry.getRaw(itemName);
        if (item == null)         throw new IllegalStateException(String.format("String_Node_Str",itemName,currId));
        currId=newData.registerItem(item,itemName,null,newId);
      }
      if (currId != newId) {
        throw new IllegalStateException(String.format("String_Node_Str",isBlock ? "String_Node_Str" : "String_Node_Str",itemName,newId,isBlock ? newData.iBlockRegistry.get(newId) : newData.iItemRegistry.get(newId)));
      }
    }
  }
  List<String> missedMappings=Loader.instance().fireMissingMappingEvent(missingMappings,isLocalWorld,newData,remaps);
  if (!missedMappings.isEmpty())   return missedMappings;
  if (injectFrozenData) {
    FMLLog.info("String_Node_Str");
    Map<String,Integer> missingBlocks=frozen.iBlockRegistry.getEntriesNotIn(newData.iBlockRegistry);
    Map<String,Integer> missingItems=frozen.iItemRegistry.getEntriesNotIn(newData.iItemRegistry);
    for (int pass=0; pass < 2; pass++) {
      boolean isBlock=pass == 0;
      Map<String,Integer> missing=(pass == 0) ? missingBlocks : missingItems;
      for (      Entry<String,Integer> entry : missing.entrySet()) {
        String itemName=entry.getKey();
        int currId=entry.getValue();
        int newId;
        if (isBlock) {
          newId=newData.registerBlock(frozen.iBlockRegistry.get(itemName),itemName,null,currId);
        }
 else {
          newId=newData.registerItem(frozen.iItemRegistry.get(itemName),itemName,null,currId);
        }
        FMLLog.info("String_Node_Str",itemName,newId,currId);
        if (newId != currId) {
          remaps.put(itemName,new Integer[]{entry.getValue(),newId});
        }
      }
    }
  }
  newData.testConsistency();
  getMain().set(newData);
  getMain().iBlockRegistry.dump();
  getMain().iItemRegistry.dump();
  Loader.instance().fireRemapEvent(remaps);
  return ImmutableList.of();
}

Fixed version (ground truth):
public static List<String> injectWorldIDMap(Map<String,Integer> dataList,int[] blockedIds,Map<String,String> blockAliases,Map<String,String> itemAliases,boolean injectFrozenData,boolean isLocalWorld){
  FMLLog.info("String_Node_Str",FMLCommonHandler.instance().getEffectiveSide().isServer() ? "String_Node_Str" : "String_Node_Str");
  Map<String,Integer[]> remaps=Maps.newHashMap();
  LinkedHashMap<String,Integer> missingMappings=new LinkedHashMap<String,Integer>();
  getMain().testConsistency();
  getMain().iBlockRegistry.dump();
  getMain().iItemRegistry.dump();
  GameData newData=new GameData();
  for (  int id : blockedIds) {
    newData.block(id);
  }
  for (  Map.Entry<String,String> entry : blockAliases.entrySet()) {
    newData.iBlockRegistry.addAlias(entry.getKey(),entry.getValue());
  }
  for (  Map.Entry<String,String> entry : itemAliases.entrySet()) {
    newData.iItemRegistry.addAlias(entry.getKey(),entry.getValue());
  }
  for (int pass=0; pass < 2; pass++) {
    boolean isBlock=(pass == 0);
    for (    Entry<String,Integer> entry : dataList.entrySet()) {
      String itemName=entry.getKey();
      int newId=entry.getValue();
      if ((itemName.charAt(0) == '\u0001') != isBlock)       continue;
      itemName=itemName.substring(1);
      int currId=isBlock ? getMain().iBlockRegistry.getId(itemName) : getMain().iItemRegistry.getId(itemName);
      if (currId == -1) {
        FMLLog.info("String_Node_Str",itemName);
        missingMappings.put(entry.getKey(),newId);
        continue;
      }
 else       if (currId != newId) {
        FMLLog.info("String_Node_Str",isBlock ? "String_Node_Str" : "String_Node_Str",itemName,currId,newId);
        remaps.put(itemName,new Integer[]{currId,newId});
      }
      FMLControlledNamespacedRegistry<?> srcRegistry=isBlock ? getMain().iBlockRegistry : getMain().iItemRegistry;
      currId=newData.register(srcRegistry.getRaw(itemName),itemName,newId);
      if (currId != newId) {
        throw new IllegalStateException(String.format("String_Node_Str",isBlock ? "String_Node_Str" : "String_Node_Str",itemName,newId,isBlock ? newData.iBlockRegistry.get(newId) : newData.iItemRegistry.get(newId)));
      }
    }
  }
  List<String> missedMappings=Loader.instance().fireMissingMappingEvent(missingMappings,isLocalWorld,newData,remaps);
  if (!missedMappings.isEmpty())   return missedMappings;
  if (injectFrozenData) {
    FMLLog.info("String_Node_Str");
    Map<String,Integer> missingBlocks=frozen.iBlockRegistry.getEntriesNotIn(newData.iBlockRegistry);
    Map<String,Integer> missingItems=frozen.iItemRegistry.getEntriesNotIn(newData.iItemRegistry);
    for (int pass=0; pass < 2; pass++) {
      boolean isBlock=pass == 0;
      Map<String,Integer> missing=(pass == 0) ? missingBlocks : missingItems;
      for (      Entry<String,Integer> entry : missing.entrySet()) {
        String itemName=entry.getKey();
        int currId=entry.getValue();
        int newId;
        if (isBlock) {
          newId=newData.registerBlock(frozen.iBlockRegistry.get(itemName),itemName,null,currId);
        }
 else {
          newId=newData.registerItem(frozen.iItemRegistry.get(itemName),itemName,null,currId);
        }
        FMLLog.info("String_Node_Str",itemName,newId,currId);
        if (newId != currId) {
          remaps.put(itemName,new Integer[]{entry.getValue(),newId});
        }
      }
    }
  }
  newData.testConsistency();
  getMain().set(newData);
  getMain().iBlockRegistry.dump();
  getMain().iItemRegistry.dump();
  Loader.instance().fireRemapEvent(remaps);
  return ImmutableList.of();
}