Program: 31478
Project: 31478
Buggy source:
private void updateLayout(){
  if (recipeTypes.isEmpty())   return;
  IRecipeType recipeType=recipeTypes.get(recipeTypeIndex);
  title=recipeType.getLocalizedName();
switch (mode) {
case INPUT:
    recipes=JEIManager.recipeRegistry.getInputRecipes(recipeType,focusStack);
  break;
case OUTPUT:
recipes=JEIManager.recipeRegistry.getOutputRecipes(recipeType,focusStack);
break;
}
IDrawable recipeBackground=recipeType.getBackground();
recipesPerPage=(ySize - headerHeight) / (recipeBackground.getHeight() + borderPadding);
int recipeXOffset=(xSize - recipeBackground.getWidth()) / 2;
int recipeSpacing=(ySize - headerHeight - (recipesPerPage * recipeBackground.getHeight())) / (recipesPerPage + 1);
int posX=guiLeft + recipeXOffset;
int posY=guiTop + headerHeight + recipeSpacing;
recipeGuis.clear();
for (int i=0; i < recipesPerPage; i++) {
int recipeIndex=(pageIndex * recipesPerPage) + i;
if (recipeIndex >= recipes.size()) break;
Object recipe=recipes.get(recipeIndex);
IRecipeHelper recipeHelper=JEIManager.recipeRegistry.getRecipeHelper(recipe.getClass());
if (recipeHelper == null) {
Log.error("String_Node_Str" + recipe);
continue;
}
IRecipeGui recipeGui=recipeType.createGui();
recipeGui.setPosition(posX,posY);
posY+=recipeBackground.getHeight() + recipeSpacing;
IRecipeWrapper recipeWrapper=recipeHelper.getRecipeWrapper(recipe);
recipeGui.setRecipe(recipeWrapper,focusStack);
recipeGuis.add(recipeGui);
}
nextPage.enabled=previousPage.enabled=(pageCount() > 1);
nextRecipeType.enabled=previousRecipeType.enabled=(recipeTypes.size() > 1);
this.pageString=(pageIndex + 1) + "String_Node_Str" + pageCount();
}

Fixed version (ground truth):
private void updateLayout(){
  if (recipeTypes.isEmpty())   return;
  IRecipeType recipeType=recipeTypes.get(recipeTypeIndex);
  title=recipeType.getLocalizedName();
switch (mode) {
case INPUT:
    recipes=JEIManager.recipeRegistry.getInputRecipes(recipeType,focusStack);
  break;
case OUTPUT:
recipes=JEIManager.recipeRegistry.getOutputRecipes(recipeType,focusStack);
break;
}
IDrawable recipeBackground=recipeType.getBackground();
recipesPerPage=(ySize - headerHeight) / (recipeBackground.getHeight() + borderPadding);
int recipeXOffset=(xSize - recipeBackground.getWidth()) / 2;
int recipeSpacing=(ySize - headerHeight - (recipesPerPage * recipeBackground.getHeight())) / (recipesPerPage + 1);
int posX=guiLeft + recipeXOffset;
int posY=guiTop + headerHeight + recipeSpacing;
recipeGuis.clear();
for (int i=0; i < recipesPerPage; i++) {
int recipeIndex=(pageIndex * recipesPerPage) + i;
if (recipeIndex >= recipes.size()) break;
Object recipe=recipes.get(recipeIndex);
IRecipeHelper recipeHelper=JEIManager.recipeRegistry.getRecipeHelper(recipe.getClass());
if (recipeHelper == null) {
Log.error("String_Node_Str" + recipe);
continue;
}
PositionedRecipeGui recipeGui=new PositionedRecipeGui(recipeType.createGui());
recipeGui.setPosition(posX,posY);
posY+=recipeBackground.getHeight() + recipeSpacing;
IRecipeWrapper recipeWrapper=recipeHelper.getRecipeWrapper(recipe);
recipeGui.setRecipe(recipeWrapper,focusStack);
recipeGuis.add(recipeGui);
}
nextPage.enabled=previousPage.enabled=(pageCount() > 1);
nextRecipeType.enabled=previousRecipeType.enabled=(recipeTypes.size() > 1);
this.pageString=(pageIndex + 1) + "String_Node_Str" + pageCount();
}