nus-yam/ex-repair huggingface dataset:
Program: 31406
Project: 31406
Buggy source:
private void startPostmaster() throws IOException {
  final StopWatch watch=new StopWatch();
  watch.start();
  Preconditions.checkState(!started.getAndSet(true),"String_Node_Str");
  final List<String> args=Lists.newArrayList(pgBin("String_Node_Str"),"String_Node_Str",dataDirectory.getPath(),"String_Node_Str",Joiner.on("String_Node_Str").join(createInitOptions()),"String_Node_Str");
  final ProcessBuilder builder=new ProcessBuilder(args);
  builder.redirectErrorStream(true);
  builder.redirectError(outputRedirector);
  builder.redirectOutput(outputRedirector);
  final Process postmaster=builder.start();
  if (outputRedirector.type() == ProcessBuilder.Redirect.Type.PIPE) {
    ProcessOutputLogger.logOutput(LOG,postmaster);
  }
  LOG.info("String_Node_Str",instanceId,postmaster.toString(),port,PG_STARTUP_WAIT_MS);
  Runtime.getRuntime().addShutdownHook(newCloserThread());
  waitForServerStartup(watch);
}

Fixed version (ground truth):
private void startPostmaster() throws IOException {
  final StopWatch watch=new StopWatch();
  watch.start();
  Preconditions.checkState(!started.getAndSet(true),"String_Node_Str");
  final List<String> args=Lists.newArrayList(pgBin("String_Node_Str"),"String_Node_Str",dataDirectory.getPath(),"String_Node_Str",Joiner.on("String_Node_Str").join(createInitOptions()),"String_Node_Str");
  final ProcessBuilder builder=new ProcessBuilder(args);
  builder.redirectErrorStream(true);
  builder.redirectError(errorRedirector);
  builder.redirectOutput(outputRedirector);
  final Process postmaster=builder.start();
  if (outputRedirector.type() == ProcessBuilder.Redirect.Type.PIPE) {
    ProcessOutputLogger.logOutput(LOG,postmaster);
  }
  LOG.info("String_Node_Str",instanceId,postmaster.toString(),port,PG_STARTUP_WAIT_MS);
  Runtime.getRuntime().addShutdownHook(newCloserThread());
  waitForServerStartup(watch);
}
Program: 31407
Project: 31407
Buggy source:
/** 
 * Unpack archive compressed by tar with bzip2 compression.
 * @param tbzPath The archive path.
 * @param targetDir The directory to extract the content to.
 */
private static void extractTbz(final String tbzPath,final String targetDir) throws IOException {
  try (final FileInputStream fin=new FileInputStream(tbzPath);final BufferedInputStream in=new BufferedInputStream(fin);final ByteArrayOutputStream tarOut=new ByteArrayOutputStream();final BZip2CompressorInputStream bzIn=new BZip2CompressorInputStream(in)){
    final byte[] buffer=new byte[4096];
    int n;
    while (-1 != (n=bzIn.read(buffer))) {
      tarOut.write(buffer,0,n);
    }
    final TarArchiveInputStream tarIn=new TarArchiveInputStream(new ByteArrayInputStream(tarOut.toByteArray()));
    TarArchiveEntry entry;
    String individualFile;
    int offset;
    FileOutputStream outputFile;
    while ((entry=tarIn.getNextTarEntry()) != null) {
      individualFile=entry.getName();
      LOG.debug(individualFile);
      final File fsObject=new File(targetDir + "String_Node_Str" + individualFile);
      if (entry.isFile()) {
        byte[] content=new byte[(int)entry.getSize()];
        offset=0;
        tarIn.read(content,offset,content.length - offset);
        mkdirs(fsObject.getParentFile());
        outputFile=new FileOutputStream(fsObject);
        IOUtils.write(content,outputFile);
        outputFile.close();
      }
 else       if (entry.isDirectory()) {
        mkdirs(fsObject);
      }
    }
    tarIn.close();
  }
 }

Fixed version (ground truth):
/** 
 * Unpack archive compressed by tar with bzip2 compression.
 * @param tbzPath The archive path.
 * @param targetDir The directory to extract the content to.
 */
private static void extractTbz(final String tbzPath,final String targetDir) throws IOException {
  try (final FileInputStream fin=new FileInputStream(tbzPath);final BufferedInputStream in=new BufferedInputStream(fin);final ByteArrayOutputStream tarOut=new ByteArrayOutputStream();final BZip2CompressorInputStream bzIn=new BZip2CompressorInputStream(in)){
    final byte[] buffer=new byte[4096];
    int n;
    while (-1 != (n=bzIn.read(buffer))) {
      tarOut.write(buffer,0,n);
    }
    final TarArchiveInputStream tarIn=new TarArchiveInputStream(new ByteArrayInputStream(tarOut.toByteArray()));
    TarArchiveEntry entry;
    String individualFile;
    int offset;
    FileOutputStream outputFile;
    while ((entry=tarIn.getNextTarEntry()) != null) {
      individualFile=entry.getName();
      LOG.debug(individualFile);
      final File fsObject=new File(targetDir + "String_Node_Str" + individualFile);
      if (entry.isFile()) {
        byte[] content=new byte[(int)entry.getSize()];
        offset=0;
        int read=tarIn.read(content,offset,content.length - offset);
        Preconditions.checkState(read != -1,"String_Node_Str",individualFile);
        mkdirs(fsObject.getParentFile());
        outputFile=new FileOutputStream(fsObject);
        IOUtils.write(content,outputFile);
        outputFile.close();
      }
 else       if (entry.isDirectory()) {
        mkdirs(fsObject);
      }
    }
    tarIn.close();
  }
 }
Program: 31408
Project: 31408
Buggy source:
private static List<String> system(String... command){
  try {
    final Process process=new ProcessBuilder(command).start();
    Preconditions.checkState(0 == process.waitFor(),"String_Node_Str",Arrays.asList(command),IOUtils.toString(process.getErrorStream()));
    try (InputStream stream=process.getInputStream()){
      return IOUtils.readLines(stream);
    }
   }
 catch (  final Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private static List<String> system(String... command){
  try {
    final ProcessBuilder builder=new ProcessBuilder(command);
    builder.redirectError(ProcessBuilder.Redirect.INHERIT);
    final Process process=builder.start();
    Preconditions.checkState(0 == process.waitFor(),"String_Node_Str",Arrays.asList(command),IOUtils.toString(process.getErrorStream()));
    try (InputStream stream=process.getInputStream()){
      return IOUtils.readLines(stream);
    }
   }
 catch (  final Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 31409
Project: 31409
Buggy source:
@Override public Response<Void> agentForceLeave(String node){
  RawResponse rawResponse=rawClient.makeGetRequest("String_Node_Str" + node);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}

Fixed version (ground truth):
@Override public Response<Void> agentForceLeave(String node){
  RawResponse rawResponse=rawClient.makePutRequest("String_Node_Str" + node);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}
Program: 31410
Project: 31410
Buggy source:
@Override public Response<Void> agentCheckDeregister(String checkId){
  RawResponse rawResponse=rawClient.makeGetRequest("String_Node_Str" + checkId);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}

Fixed version (ground truth):
@Override public Response<Void> agentCheckDeregister(String checkId){
  RawResponse rawResponse=rawClient.makePutRequest("String_Node_Str" + checkId);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}
Program: 31411
Project: 31411
Buggy source:
@Override public Response<Void> agentJoin(String address,boolean wan){
  UrlParameters wanParams=wan ? new SingleUrlParameters("String_Node_Str","String_Node_Str") : null;
  RawResponse rawResponse=rawClient.makeGetRequest("String_Node_Str" + address,wanParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}

Fixed version (ground truth):
@Override public Response<Void> agentJoin(String address,boolean wan){
  UrlParameters wanParams=wan ? new SingleUrlParameters("String_Node_Str","String_Node_Str") : null;
  RawResponse rawResponse=rawClient.makePutRequest("String_Node_Str" + address,wanParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}
Program: 31412
Project: 31412
Buggy source:
@Override public Response<Void> agentCheckPass(String checkId,String note){
  UrlParameters noteParams=note != null ? new SingleUrlParameters("String_Node_Str",note) : null;
  RawResponse rawResponse=rawClient.makeGetRequest("String_Node_Str" + checkId,noteParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}

Fixed version (ground truth):
@Override public Response<Void> agentCheckPass(String checkId,String note){
  UrlParameters noteParams=note != null ? new SingleUrlParameters("String_Node_Str",note) : null;
  RawResponse rawResponse=rawClient.makePutRequest("String_Node_Str" + checkId,noteParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}
Program: 31413
Project: 31413
Buggy source:
@Override public Response<Void> agentCheckFail(String checkId,String note){
  UrlParameters noteParams=note != null ? new SingleUrlParameters("String_Node_Str",note) : null;
  RawResponse rawResponse=rawClient.makeGetRequest("String_Node_Str" + checkId,noteParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}

Fixed version (ground truth):
@Override public Response<Void> agentCheckFail(String checkId,String note){
  UrlParameters noteParams=note != null ? new SingleUrlParameters("String_Node_Str",note) : null;
  RawResponse rawResponse=rawClient.makePutRequest("String_Node_Str" + checkId,noteParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}
Program: 31414
Project: 31414
Buggy source:
@Override public Response<Void> agentServiceDeregister(String serviceId,String token){
  UrlParameters tokenParam=token != null ? new SingleUrlParameters("String_Node_Str",token) : null;
  RawResponse rawResponse=rawClient.makeGetRequest("String_Node_Str" + serviceId,tokenParam);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}

Fixed version (ground truth):
@Override public Response<Void> agentServiceDeregister(String serviceId,String token){
  UrlParameters tokenParam=token != null ? new SingleUrlParameters("String_Node_Str",token) : null;
  RawResponse rawResponse=rawClient.makePutRequest("String_Node_Str" + serviceId,"String_Node_Str",tokenParam);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}
Program: 31415
Project: 31415
Buggy source:
@Override public Response<Void> agentCheckWarn(String checkId,String note){
  UrlParameters noteParams=note != null ? new SingleUrlParameters("String_Node_Str",note) : null;
  RawResponse rawResponse=rawClient.makeGetRequest("String_Node_Str" + checkId,noteParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}

Fixed version (ground truth):
@Override public Response<Void> agentCheckWarn(String checkId,String note){
  UrlParameters noteParams=note != null ? new SingleUrlParameters("String_Node_Str",note) : null;
  RawResponse rawResponse=rawClient.makePutRequest("String_Node_Str" + checkId,noteParams);
  if (rawResponse.getStatusCode() == 200) {
    return new Response<Void>(null,rawResponse);
  }
 else {
    throw new OperationException(rawResponse);
  }
}
Program: 31416
Project: 31416
Buggy source:
private void showCodeDialog(AnActionEvent event,final Project project,final VirtualFile selectedFile,Settings settings) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
  CodeGeneratorController codeGeneratorController=new CodeGeneratorController(getTemplateName(),getResourceProvidersFactory());
  String generatedCode=codeGeneratorController.generateCode(project,selectedFile,event.getData(PlatformDataKeys.EDITOR));
  final CodeDialogBuilder codeDialogBuilder=new CodeDialogBuilder(project,String.format(StringResources.TITLE_FORMAT_TEXT,selectedFile.getName()),generatedCode);
  codeDialogBuilder.addSourcePathSection(projectHelper.getSourceRootPathList(project,event),settings.getSourcePath());
  codeDialogBuilder.addPackageSection(packageHelper.getPackageName(project));
  codeDialogBuilder.addAction(StringResources.COPY_ACTION_LABEL,new Runnable(){
    @Override public void run(){
      ClipboardHelper.copy(getFinalCode(codeDialogBuilder));
      codeDialogBuilder.closeDialog();
    }
  }
);
  codeDialogBuilder.addAction(StringResources.CREATE_ACTION_LABEL,new Runnable(){
    @Override public void run(){
      try {
        createFileWithGeneratedCode(codeDialogBuilder,selectedFile,project);
      }
 catch (      IOException exception) {
        errorHandler.handleError(project,exception);
      }
    }
  }
,true);
  if (codeDialogBuilder.showDialog() == DialogWrapper.OK_EXIT_CODE) {
    settings.setSourcePath(codeDialogBuilder.getSourcePath());
  }
}

Fixed version (ground truth):
private void showCodeDialog(AnActionEvent event,final Project project,final VirtualFile selectedFile,Settings settings) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
  CodeGeneratorController codeGeneratorController=new CodeGeneratorController(getTemplateName(),getResourceProvidersFactory());
  String generatedCode=codeGeneratorController.generateCode(project,selectedFile,event.getData(PlatformDataKeys.EDITOR));
  final CodeDialogBuilder codeDialogBuilder=new CodeDialogBuilder(project,String.format(StringResources.TITLE_FORMAT_TEXT,selectedFile.getName()),generatedCode);
  codeDialogBuilder.addSourcePathSection(projectHelper.getSourceRootPathList(project,event),settings.getSourcePath());
  codeDialogBuilder.addPackageSection(packageHelper.getPackageName(project,event));
  codeDialogBuilder.addAction(StringResources.COPY_ACTION_LABEL,new Runnable(){
    @Override public void run(){
      ClipboardHelper.copy(getFinalCode(codeDialogBuilder));
      codeDialogBuilder.closeDialog();
    }
  }
);
  codeDialogBuilder.addAction(StringResources.CREATE_ACTION_LABEL,new Runnable(){
    @Override public void run(){
      try {
        createFileWithGeneratedCode(codeDialogBuilder,selectedFile,project);
      }
 catch (      IOException exception) {
        errorHandler.handleError(project,exception);
      }
    }
  }
,true);
  if (codeDialogBuilder.showDialog() == DialogWrapper.OK_EXIT_CODE) {
    settings.setSourcePath(codeDialogBuilder.getSourcePath());
  }
}
Program: 31417
Project: 31417
Buggy source:
private VirtualFile getManifestFileFromPath(Project project,String path){
  return project.getBaseDir().findFileByRelativePath(path + "String_Node_Str");
}

Fixed version (ground truth):
private VirtualFile getManifestFileFromPath(Project project,String path){
  return project.getBaseDir().findFileByRelativePath(path).findChild("String_Node_Str");
}
Program: 31418
Project: 31418
Buggy source:
private List<String> possiblePaths(){
  return Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private List<String> possiblePaths(Project project,AnActionEvent event){
  return projectHelper.getSourceRootPathList(project,event);
}
Program: 31419
Project: 31419
Buggy source:
public String getPackageName(Project project){
  try {
    for (    String path : possiblePaths()) {
      VirtualFile file=getManifestFileFromPath(project,path);
      if (file != null && file.exists()) {
        return packageExtractor.extractPackageFromManifestStream(file.getInputStream());
      }
    }
  }
 catch (  Exception ignored) {
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getPackageName(Project project,AnActionEvent event){
  try {
    for (    String path : possiblePaths(project,event)) {
      VirtualFile file=getManifestFileFromPath(project,path);
      if (file != null && file.exists()) {
        return packageExtractor.extractPackageFromManifestStream(file.getInputStream());
      }
    }
  }
 catch (  Exception ignored) {
  }
  return "String_Node_Str";
}
Program: 31420
Project: 31420
Buggy source:
public List<String> getSourceRootPathList(Project project,AnActionEvent event){
  List<String> sourceRoots=Lists.newArrayList();
  for (  VirtualFile virtualFile : getModuleRootManager(event).getSourceRoots(false)) {
    sourceRoots.add(virtualFile.getPath().replace(project.getBasePath(),"String_Node_Str"));
  }
  return sourceRoots;
}

Fixed version (ground truth):
public List<String> getSourceRootPathList(Project project,AnActionEvent event){
  List<String> sourceRoots=Lists.newArrayList();
  String projectPath=StringUtils.normalizePath(project.getBasePath());
  for (  VirtualFile virtualFile : getModuleRootManager(event).getSourceRoots(false)) {
    sourceRoots.add(StringUtils.normalizePath(virtualFile.getPath()).replace(projectPath,"String_Node_Str"));
  }
  return sourceRoots;
}
Program: 31421
Project: 31421
Buggy source:
private void addFallbackSubtypeInterpreter(ItemStack itemStack){
  if (!this.subtypeRegistry.hasSubtypeInterpreter(itemStack)) {
    if (itemStack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY,null)) {
      this.subtypeRegistry.registerSubtypeInterpreter(itemStack.getItem(),FluidSubtypeInterpreter.INSTANCE);
    }
  }
}

Fixed version (ground truth):
private void addFallbackSubtypeInterpreter(ItemStack itemStack){
  if (!this.subtypeRegistry.hasSubtypeInterpreter(itemStack)) {
    try {
      String info=FluidSubtypeInterpreter.INSTANCE.apply(itemStack);
      if (!ISubtypeRegistry.ISubtypeInterpreter.NONE.equals(info)) {
        this.subtypeRegistry.registerSubtypeInterpreter(itemStack.getItem(),FluidSubtypeInterpreter.INSTANCE);
      }
    }
 catch (    RuntimeException|LinkageError e) {
      String itemStackInfo=ErrorUtil.getItemStackInfo(itemStack);
      Log.get().error("String_Node_Str",itemStackInfo,e);
    }
  }
}
Program: 31422
Project: 31422
Buggy source:
/** 
 * Get information for error messages involving this ingredient. Be extremely careful not to crash here, get as much useful info as possible.
 */
String getErrorInfo(V ingredient);

Fixed version (ground truth):
/** 
 * Get information for error messages involving this ingredient. Be extremely careful not to crash here, get as much useful info as possible.
 */
String getErrorInfo(@Nullable V ingredient);
Program: 31423
Project: 31423
Buggy source:
@Override public String getErrorInfo(FluidStack ingredient){
  MoreObjects.ToStringHelper toStringHelper=MoreObjects.toStringHelper(FluidStack.class);
  Fluid fluid=ingredient.getFluid();
  if (fluid != null) {
    toStringHelper.add("String_Node_Str",fluid.getLocalizedName(ingredient));
  }
 else {
    toStringHelper.add("String_Node_Str","String_Node_Str");
  }
  toStringHelper.add("String_Node_Str",ingredient.amount);
  if (ingredient.tag != null) {
    toStringHelper.add("String_Node_Str",ingredient.tag);
  }
  return toStringHelper.toString();
}

Fixed version (ground truth):
@Override public String getErrorInfo(@Nullable FluidStack ingredient){
  if (ingredient == null) {
    return "String_Node_Str";
  }
  MoreObjects.ToStringHelper toStringHelper=MoreObjects.toStringHelper(FluidStack.class);
  Fluid fluid=ingredient.getFluid();
  if (fluid != null) {
    toStringHelper.add("String_Node_Str",fluid.getLocalizedName(ingredient));
  }
 else {
    toStringHelper.add("String_Node_Str","String_Node_Str");
  }
  toStringHelper.add("String_Node_Str",ingredient.amount);
  if (ingredient.tag != null) {
    toStringHelper.add("String_Node_Str",ingredient.tag);
  }
  return toStringHelper.toString();
}
Program: 31424
Project: 31424
Buggy source:
@Override public String getErrorInfo(ItemStack ingredient){
  return ErrorUtil.getItemStackInfo(ingredient);
}

Fixed version (ground truth):
@Override public String getErrorInfo(@Nullable ItemStack ingredient){
  return ErrorUtil.getItemStackInfo(ingredient);
}
Program: 31425
Project: 31425
Buggy source:
@Nullable private <T>IRecipeWrapper getRecipeWrapper(T recipe,Class<? extends T> recipeClass,String recipeCategoryUid){
  if (wrapperMap.containsKey(recipe)) {
    return wrapperMap.get(recipe);
  }
  IRecipeHandler<T> recipeHandler=getRecipeHandler(recipeClass,recipeCategoryUid);
  if (recipeHandler != null) {
    try {
      if (!recipeHandler.isRecipeValid(recipe)) {
        return null;
      }
    }
 catch (    RuntimeException|LinkageError e) {
      Log.get().error("String_Node_Str",e);
      return null;
    }
    try {
      IRecipeWrapper recipeWrapper=recipeHandler.getRecipeWrapper(recipe);
      wrapperMap.put(recipe,recipeWrapper);
      return recipeWrapper;
    }
 catch (    RuntimeException|LinkageError e) {
      logBrokenRecipeHandler(recipe,recipeHandler);
      return null;
    }
  }
 else   if (recipe instanceof IRecipeWrapper) {
    return (IRecipeWrapper)recipe;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Nullable private <T>IRecipeWrapper getRecipeWrapper(T recipe,Class<? extends T> recipeClass,String recipeCategoryUid){
  Map<Object,IRecipeWrapper> wrapperMap=wrapperMaps.computeIfAbsent(recipeCategoryUid,k -> new IdentityHashMap<>());
  IRecipeWrapper recipeWrapper=wrapperMap.get(recipe);
  if (recipeWrapper != null) {
    return recipeWrapper;
  }
  IRecipeHandler<T> recipeHandler=getRecipeHandler(recipeClass,recipeCategoryUid);
  if (recipeHandler != null) {
    try {
      if (!recipeHandler.isRecipeValid(recipe)) {
        return null;
      }
    }
 catch (    RuntimeException|LinkageError e) {
      Log.get().error("String_Node_Str",e);
      return null;
    }
    try {
      recipeWrapper=recipeHandler.getRecipeWrapper(recipe);
      wrapperMap.put(recipe,recipeWrapper);
      return recipeWrapper;
    }
 catch (    RuntimeException|LinkageError e) {
      logBrokenRecipeHandler(recipe,recipeHandler);
      return null;
    }
  }
 else   if (recipe instanceof IRecipeWrapper) {
    return (IRecipeWrapper)recipe;
  }
 else {
    return null;
  }
}
Program: 31426
Project: 31426
Buggy source:
private <T>void addRecipeUnchecked(T recipe,IRecipeWrapper recipeWrapper,IRecipeCategory recipeCategory){
  wrapperMap.put(recipe,recipeWrapper);
  Ingredients ingredients=getIngredients(recipeWrapper);
  recipeInputMap.addRecipe(recipeWrapper,recipeCategory,ingredients.getInputIngredients());
  recipeOutputMap.addRecipe(recipeWrapper,recipeCategory,ingredients.getOutputIngredients());
  recipeWrappersForCategories.put(recipeCategory,recipeWrapper);
  recipeCategoriesVisibleCache.clear();
}

Fixed version (ground truth):
private <T>void addRecipeUnchecked(T recipe,IRecipeWrapper recipeWrapper,IRecipeCategory recipeCategory){
  Map<Object,IRecipeWrapper> wrapperMap=wrapperMaps.computeIfAbsent(recipeCategory.getUid(),k -> new IdentityHashMap<>());
  wrapperMap.put(recipe,recipeWrapper);
  Ingredients ingredients=getIngredients(recipeWrapper);
  recipeInputMap.addRecipe(recipeWrapper,recipeCategory,ingredients.getInputIngredients());
  recipeOutputMap.addRecipe(recipeWrapper,recipeCategory,ingredients.getOutputIngredients());
  recipeWrappersForCategories.put(recipeCategory,recipeWrapper);
  recipeCategoriesVisibleCache.clear();
}
Program: 31427
Project: 31427
Buggy source:
@Nullable public IIngredientListElement getElementUnderMouse(){
  if (hovered != null) {
    IIngredientListElement element=hovered.getElement();
    if (element != null) {
      return element;
    }
  }
  return null;
}

Fixed version (ground truth):
@Nullable public IIngredientListElement getElementUnderMouse(){
  GuiIngredientFast hovered=guiIngredientList.getHovered(MouseHelper.getX(),MouseHelper.getY());
  if (hovered != null) {
    IIngredientListElement element=hovered.getElement();
    if (element != null) {
      return element;
    }
  }
  return null;
}
Program: 31428
Project: 31428
Buggy source:
public void draw(Minecraft minecraft,int mouseX,int mouseY){
  GlStateManager.disableBlend();
  if (shouldShowDeleteItemTooltip(minecraft)) {
    hovered=guiIngredientList.render(minecraft,false,mouseX,mouseY);
  }
 else {
    boolean mouseOver=isMouseOver(mouseX,mouseY);
    hovered=guiIngredientList.render(minecraft,mouseOver,mouseX,mouseY);
  }
  drawHighlightedIngredients();
  if (hovered != null) {
    hovered.drawHovered(minecraft);
  }
  GlStateManager.enableAlpha();
}

Fixed version (ground truth):
public void draw(Minecraft minecraft,int mouseX,int mouseY){
  GlStateManager.disableBlend();
  guiIngredientList.render(minecraft);
  if (!shouldShowDeleteItemTooltip(minecraft) && isMouseOver(mouseX,mouseY)) {
    GuiIngredientFast hovered=guiIngredientList.getHovered(mouseX,mouseY);
    if (hovered != null) {
      hovered.drawHighlight();
    }
  }
  GlStateManager.enableAlpha();
}
Program: 31429
Project: 31429
Buggy source:
public void drawTooltips(Minecraft minecraft,int mouseX,int mouseY){
  boolean mouseOver=isMouseOver(mouseX,mouseY);
  if (mouseOver && shouldShowDeleteItemTooltip(minecraft)) {
    String deleteItem=Translator.translateToLocal("String_Node_Str");
    TooltipRenderer.drawHoveringText(minecraft,deleteItem,mouseX,mouseY);
  }
  if (hovered != null) {
    hovered.drawTooltip(minecraft,mouseX,mouseY);
  }
}

Fixed version (ground truth):
public void drawTooltips(Minecraft minecraft,int mouseX,int mouseY){
  if (isMouseOver(mouseX,mouseY)) {
    if (shouldShowDeleteItemTooltip(minecraft)) {
      String deleteItem=Translator.translateToLocal("String_Node_Str");
      TooltipRenderer.drawHoveringText(minecraft,deleteItem,mouseX,mouseY);
    }
 else {
      GuiIngredientFast hovered=guiIngredientList.getHovered(mouseX,mouseY);
      if (hovered != null) {
        hovered.drawTooltip(minecraft,mouseX,mouseY);
      }
    }
  }
}
Program: 31430
Project: 31430
Buggy source:
@Override public void render(Minecraft minecraft,int xPosition,int yPosition,@Nullable ItemStack ingredient){
  if (ingredient != null) {
    RenderHelper.enableGUIStandardItemLighting();
    FontRenderer font=getFontRenderer(minecraft,ingredient);
    minecraft.getRenderItem().renderItemAndEffectIntoGUI(null,ingredient,xPosition,yPosition);
    minecraft.getRenderItem().renderItemOverlayIntoGUI(font,ingredient,xPosition,yPosition,null);
    GlStateManager.disableBlend();
    RenderHelper.disableStandardItemLighting();
  }
}

Fixed version (ground truth):
@Override public void render(Minecraft minecraft,int xPosition,int yPosition,@Nullable ItemStack ingredient){
  if (ingredient != null) {
    GlStateManager.enableDepth();
    RenderHelper.enableGUIStandardItemLighting();
    FontRenderer font=getFontRenderer(minecraft,ingredient);
    minecraft.getRenderItem().renderItemAndEffectIntoGUI(null,ingredient,xPosition,yPosition);
    minecraft.getRenderItem().renderItemOverlayIntoGUI(font,ingredient,xPosition,yPosition,null);
    GlStateManager.disableBlend();
    RenderHelper.disableStandardItemLighting();
  }
}
Program: 31431
Project: 31431
Buggy source:
@Nullable private GuiIngredientFast getHovered(int mouseX,int mouseY){
  for (  GuiIngredientFast guiItemStack : renderAll) {
    if (guiItemStack.isMouseOver(mouseX,mouseY)) {
      return guiItemStack;
    }
  }
  return null;
}

Fixed version (ground truth):
@Nullable public GuiIngredientFast getHovered(int mouseX,int mouseY){
  for (  GuiIngredientFast guiItemStack : renderAll) {
    if (guiItemStack.isMouseOver(mouseX,mouseY)) {
      return guiItemStack;
    }
  }
  return null;
}
Program: 31433
Project: 31433
Buggy source:
@Override public int getValue(){
  long worldTime=Minecraft.getMinecraft().world.getTotalWorldTime();
  long ticksPassed=worldTime - lastUpdateWorldTime;
  lastUpdateWorldTime=worldTime;
  tickCount+=ticksPassed;
  if (tickCount >= ticksPerCycle) {
    tickCount=0;
  }
  int value=Math.round(tickCount * maxValue / (float)ticksPerCycle);
  if (countDown) {
    return maxValue - value;
  }
 else {
    return value;
  }
}

Fixed version (ground truth):
public static int getValue(long startTime,long currentTime,int maxValue,int msPerCycle,boolean countDown){
  long msPassed=(currentTime - startTime) % msPerCycle;
  int value=(int)Math.floorDiv(msPassed * (maxValue + 1),msPerCycle);
  if (countDown) {
    return maxValue - value;
  }
 else {
    return value;
  }
}
Program: 31434
Project: 31434
Buggy source:
public TickTimer(int ticksPerCycle,int maxValue,boolean countDown){
  this.ticksPerCycle=ticksPerCycle;
  this.maxValue=maxValue;
  this.countDown=countDown;
}

Fixed version (ground truth):
public TickTimer(int ticksPerCycle,int maxValue,boolean countDown){
  this.msPerCycle=ticksPerCycle * 50;
  this.maxValue=maxValue;
  this.countDown=countDown;
  this.startTime=System.currentTimeMillis();
}
Program: 31435
Project: 31435
Buggy source:
@Override public void setRecipe(IRecipeLayout recipeLayout,BrewingRecipeWrapper recipeWrapper,IIngredients ingredients){
  IGuiItemStackGroup itemStacks=recipeLayout.getItemStacks();
  itemStacks.init(brewPotionSlot1,true,0,35);
  itemStacks.init(brewPotionSlot2,true,23,42);
  itemStacks.init(brewPotionSlot3,true,46,35);
  itemStacks.init(brewIngredientSlot,true,23,1);
  itemStacks.init(outputSlot,false,80,1);
  itemStacks.setBackground(outputSlot,slotDrawable);
  itemStacks.set(ingredients);
}

Fixed version (ground truth):
@Override public void setRecipe(IRecipeLayout recipeLayout,BrewingRecipeWrapper recipeWrapper,IIngredients ingredients){
  IGuiItemStackGroup itemStacks=recipeLayout.getItemStacks();
  itemStacks.init(brewPotionSlot1,true,0,36);
  itemStacks.init(brewPotionSlot2,true,23,43);
  itemStacks.init(brewPotionSlot3,true,46,36);
  itemStacks.init(brewIngredientSlot,true,23,2);
  itemStacks.init(outputSlot,false,80,2);
  itemStacks.setBackground(outputSlot,slotDrawable);
  itemStacks.set(ingredients);
}
Program: 31436
Project: 31436
Buggy source:
@Override public void drawExtras(Minecraft minecraft){
  blazeHeat.draw(minecraft,5,29);
  bubbles.draw(minecraft,8,0);
  arrow.draw(minecraft,42,1);
}

Fixed version (ground truth):
@Override public void drawExtras(Minecraft minecraft){
  blazeHeat.draw(minecraft,5,30);
  bubbles.draw(minecraft,8,0);
  arrow.draw(minecraft,42,2);
}
Program: 31437
Project: 31437
Buggy source:
public BrewingRecipeCategory(IGuiHelper guiHelper){
  ResourceLocation location=Constants.RECIPE_GUI_VANILLA;
  background=guiHelper.createDrawable(location,0,0,64,60,0,0,0,40);
  localizedName=Translator.translateToLocal("String_Node_Str");
  IDrawableStatic brewArrowDrawable=guiHelper.createDrawable(location,64,0,9,28);
  arrow=guiHelper.createAnimatedDrawable(brewArrowDrawable,400,IDrawableAnimated.StartDirection.TOP,false);
  IDrawableStatic brewBubblesDrawable=guiHelper.createDrawable(location,73,1,12,28);
  bubbles=guiHelper.createAnimatedDrawable(brewBubblesDrawable,20,IDrawableAnimated.StartDirection.BOTTOM,false);
  blazeHeat=guiHelper.createDrawable(location,64,29,18,4);
  slotDrawable=guiHelper.getSlotDrawable();
}

Fixed version (ground truth):
public BrewingRecipeCategory(IGuiHelper guiHelper){
  ResourceLocation location=Constants.RECIPE_GUI_VANILLA;
  background=guiHelper.createDrawable(location,0,0,64,60,1,0,0,40);
  localizedName=Translator.translateToLocal("String_Node_Str");
  IDrawableStatic brewArrowDrawable=guiHelper.createDrawable(location,64,0,9,28);
  arrow=guiHelper.createAnimatedDrawable(brewArrowDrawable,400,IDrawableAnimated.StartDirection.TOP,false);
  IDrawableStatic brewBubblesDrawable=guiHelper.createDrawable(location,73,0,12,29);
  ITickTimer bubblesTickTimer=new BrewingBubblesTickTimer(guiHelper);
  bubbles=new DrawableAnimated(brewBubblesDrawable,bubblesTickTimer,IDrawableAnimated.StartDirection.BOTTOM);
  blazeHeat=guiHelper.createDrawable(location,64,29,18,4);
  slotDrawable=guiHelper.getSlotDrawable();
}
Program: 31438
Project: 31438
Buggy source:
@Override public void drawInfo(Minecraft minecraft,int recipeWidth,int recipeHeight,int mouseX,int mouseY){
  flame.draw(minecraft,2,0);
  minecraft.fontRenderer.drawString(smeltCountString,24,8,Color.gray.getRGB());
  minecraft.fontRenderer.drawString(burnTimeString,24,18,Color.gray.getRGB());
}

Fixed version (ground truth):
@Override public void drawInfo(Minecraft minecraft,int recipeWidth,int recipeHeight,int mouseX,int mouseY){
  flame.draw(minecraft,1,0);
  minecraft.fontRenderer.drawString(smeltCountString,24,8,Color.gray.getRGB());
  minecraft.fontRenderer.drawString(burnTimeString,24,18,Color.gray.getRGB());
}
Program: 31439
Project: 31439
Buggy source:
public FuelRecipe(IGuiHelper guiHelper,Collection<ItemStack> input,int burnTime){
  List<ItemStack> inputList=new ArrayList<>(input);
  this.inputs=Collections.singletonList(inputList);
  if (burnTime == 200) {
    this.smeltCountString=Translator.translateToLocal("String_Node_Str");
  }
 else {
    NumberFormat numberInstance=NumberFormat.getNumberInstance();
    numberInstance.setMaximumFractionDigits(2);
    String smeltCount=numberInstance.format(burnTime / 200f);
    this.smeltCountString=Translator.translateToLocalFormatted("String_Node_Str",smeltCount);
  }
  this.burnTimeString=Translator.translateToLocalFormatted("String_Node_Str",burnTime);
  IDrawableStatic flameDrawable=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,176,114,14,14);
  this.flame=guiHelper.createAnimatedDrawable(flameDrawable,burnTime,IDrawableAnimated.StartDirection.TOP,true);
}

Fixed version (ground truth):
public FuelRecipe(IGuiHelper guiHelper,Collection<ItemStack> input,int burnTime){
  List<ItemStack> inputList=new ArrayList<>(input);
  this.inputs=Collections.singletonList(inputList);
  if (burnTime == 200) {
    this.smeltCountString=Translator.translateToLocal("String_Node_Str");
  }
 else {
    NumberFormat numberInstance=NumberFormat.getNumberInstance();
    numberInstance.setMaximumFractionDigits(2);
    String smeltCount=numberInstance.format(burnTime / 200f);
    this.smeltCountString=Translator.translateToLocalFormatted("String_Node_Str",smeltCount);
  }
  this.burnTimeString=Translator.translateToLocalFormatted("String_Node_Str",burnTime);
  IDrawableStatic flameDrawable=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,82,114,14,14);
  this.flame=guiHelper.createAnimatedDrawable(flameDrawable,burnTime,IDrawableAnimated.StartDirection.TOP,true);
}
Program: 31440
Project: 31440
Buggy source:
public FurnaceFuelCategory(IGuiHelper guiHelper){
  super(guiHelper);
  background=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,0,135,18,33,0,0,0,80);
  flameTransparentBackground=guiHelper.createDrawable(Constants.RECIPE_BACKGROUND,215,0,14,14);
  localizedName=Translator.translateToLocal("String_Node_Str");
}

Fixed version (ground truth):
public FurnaceFuelCategory(IGuiHelper guiHelper){
  super(guiHelper);
  background=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,0,134,18,34,0,0,0,80);
  flameTransparentBackground=guiHelper.createDrawable(Constants.RECIPE_BACKGROUND,215,0,14,14);
  localizedName=Translator.translateToLocal("String_Node_Str");
}
Program: 31441
Project: 31441
Buggy source:
@Override public void setRecipe(IRecipeLayout recipeLayout,FuelRecipe recipeWrapper,IIngredients ingredients){
  IGuiItemStackGroup guiItemStacks=recipeLayout.getItemStacks();
  guiItemStacks.init(fuelSlot,true,0,15);
  guiItemStacks.set(ingredients);
}

Fixed version (ground truth):
@Override public void setRecipe(IRecipeLayout recipeLayout,FuelRecipe recipeWrapper,IIngredients ingredients){
  IGuiItemStackGroup guiItemStacks=recipeLayout.getItemStacks();
  guiItemStacks.init(fuelSlot,true,0,16);
  guiItemStacks.set(ingredients);
}
Program: 31442
Project: 31442
Buggy source:
public FurnaceRecipeCategory(IGuiHelper guiHelper){
  staticFlame=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,82,114,14,14);
  animatedFlame=guiHelper.createAnimatedDrawable(staticFlame,300,IDrawableAnimated.StartDirection.TOP,true);
  IDrawableStatic arrowDrawable=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,176,128,24,17);
  this.arrow=guiHelper.createAnimatedDrawable(arrowDrawable,200,IDrawableAnimated.StartDirection.LEFT,false);
}

Fixed version (ground truth):
public FurnaceRecipeCategory(IGuiHelper guiHelper){
  staticFlame=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,82,114,14,14);
  animatedFlame=guiHelper.createAnimatedDrawable(staticFlame,300,IDrawableAnimated.StartDirection.TOP,true);
  IDrawableStatic arrowDrawable=guiHelper.createDrawable(Constants.RECIPE_GUI_VANILLA,82,128,24,17);
  this.arrow=guiHelper.createAnimatedDrawable(arrowDrawable,200,IDrawableAnimated.StartDirection.LEFT,false);
}
Program: 31443
Project: 31443
Buggy source:
@Override public void drawExtras(Minecraft minecraft){
  animatedFlame.draw(minecraft,2,20);
  arrow.draw(minecraft,24,18);
}

Fixed version (ground truth):
@Override public void drawExtras(Minecraft minecraft){
  animatedFlame.draw(minecraft,1,20);
  arrow.draw(minecraft,24,18);
}
Program: 31444
Project: 31444
Buggy source:
@SubscribeEvent public void onGuiKeyboardEvent(GuiScreenEvent.KeyboardInputEvent.Post event){
  if (inputHandler != null && !inputHandler.hasKeyboardFocus()) {
    if (inputHandler.handleKeyEvent()) {
      event.setCanceled(true);
    }
  }
}

Fixed version (ground truth):
/** 
 * Without focus, use Post
 */
@SubscribeEvent public void onGuiKeyboardEvent(GuiScreenEvent.KeyboardInputEvent.Post event){
  if (inputHandler != null && !inputHandler.hasKeyboardFocus()) {
    if (inputHandler.handleKeyEvent()) {
      event.setCanceled(true);
    }
  }
}
Program: 31445
Project: 31445
Buggy source:
@Override public boolean canSetFocusWithMouse(){
  return this.contents.canSetFocusWithMouse();
}

Fixed version (ground truth):
@Override public boolean canSetFocusWithMouse(){
  return this.isEnabled() && this.contents.canSetFocusWithMouse();
}
Program: 31446
Project: 31446
Buggy source:
public static void drawHoveringText(@Nullable ItemStack itemStack,Minecraft minecraft,List<String> textLines,int x,int y,FontRenderer font){
  ScaledResolution scaledresolution=new ScaledResolution(minecraft);
  GuiUtils.drawHoveringText(itemStack,textLines,x,y,scaledresolution.getScaledWidth(),scaledresolution.getScaledHeight(),-1,font);
}

Fixed version (ground truth):
public static void drawHoveringText(ItemStack itemStack,Minecraft minecraft,List<String> textLines,int x,int y,FontRenderer font){
  ScaledResolution scaledresolution=new ScaledResolution(minecraft);
  GuiUtils.drawHoveringText(itemStack,textLines,x,y,scaledresolution.getScaledWidth(),scaledresolution.getScaledHeight(),-1,font);
}
Program: 31447
Project: 31447
Buggy source:
@SubscribeEvent public void onGuiInit(GuiScreenEvent.InitGuiEvent.Post event){
  ItemListOverlay itemListOverlay=runtime.getItemListOverlay();
  GuiScreen gui=event.getGui();
  if (gui instanceof GuiContainer || gui instanceof RecipesGui) {
    ItemListOverlayInternal itemListOverlayInternal=itemListOverlay.create(gui);
    RecipeRegistry recipeRegistry=runtime.getRecipeRegistry();
    IIngredientRegistry ingredientRegistry=runtime.getIngredientRegistry();
    RecipesGui recipesGui=runtime.getRecipesGui();
    inputHandler=new InputHandler(recipeRegistry,ingredientRegistry,recipesGui,itemListOverlayInternal);
  }
 else {
    inputHandler=null;
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onGuiInit(GuiScreenEvent.InitGuiEvent.Post event){
  ItemListOverlay itemListOverlay=runtime.getItemListOverlay();
  GuiScreen gui=event.getGui();
  if (gui instanceof GuiContainer || gui instanceof RecipesGui) {
    ItemListOverlayInternal itemListOverlayInternal=itemListOverlay.create(gui);
    inputHandler=new InputHandler(runtime,itemListOverlayInternal);
  }
 else {
    inputHandler=null;
  }
}
Program: 31448
Project: 31448
Buggy source:
@SubscribeEvent public void onDrawBackgroundEventPost(GuiScreenEvent.BackgroundDrawnEvent event){
  ItemListOverlay itemListOverlay=runtime.getItemListOverlay();
  ItemListOverlayInternal itemListOverlayInternal=itemListOverlay.getInternal();
  if (itemListOverlayInternal != null) {
    GuiScreen gui=event.getGui();
    if (itemListOverlayInternal.hasScreenChanged(gui)) {
      itemListOverlayInternal=itemListOverlay.create(gui);
    }
    if (itemListOverlayInternal != null) {
      itemListOverlayInternal.drawScreen(gui.mc,event.getMouseX(),event.getMouseY());
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public void onDrawBackgroundEventPost(GuiScreenEvent.BackgroundDrawnEvent event){
  ItemListOverlay itemListOverlay=runtime.getItemListOverlay();
  ItemListOverlayInternal itemListOverlayInternal=itemListOverlay.getInternal();
  if (itemListOverlayInternal != null) {
    GuiScreen gui=event.getGui();
    if (itemListOverlayInternal.hasScreenChanged(gui)) {
      itemListOverlayInternal=itemListOverlay.create(gui);
      inputHandler=new InputHandler(runtime,itemListOverlayInternal);
    }
    if (itemListOverlayInternal != null) {
      itemListOverlayInternal.drawScreen(gui.mc,event.getMouseX(),event.getMouseY());
    }
  }
}
Program: 31449
Project: 31449
Buggy source:
@Nullable public ItemListOverlayInternal create(GuiScreen guiScreen){
  if (Config.isOverlayEnabled()) {
    GuiProperties guiProperties=GuiProperties.create(guiScreen);
    if (guiProperties != null) {
      final int columns=ItemListOverlayInternal.getColumns(guiProperties);
      if (columns >= 4) {
        return internal=new ItemListOverlayInternal(this,ingredientRegistry,guiScreen,guiProperties);
      }
    }
  }
  close();
  return null;
}

Fixed version (ground truth):
@Nullable public ItemListOverlayInternal create(GuiScreen guiScreen){
  if (Config.isOverlayEnabled()) {
    GuiProperties guiProperties=GuiProperties.create(guiScreen);
    if (guiProperties != null) {
      final int columns=ItemListOverlayInternal.getColumns(guiProperties);
      if (columns >= 4) {
        if (internal != null) {
          close();
        }
        internal=new ItemListOverlayInternal(this,ingredientRegistry,guiScreen,guiProperties);
        return internal;
      }
    }
  }
  close();
  return null;
}
Program: 31450
Project: 31450
Buggy source:
public InputHandler(RecipeRegistry recipeRegistry,IIngredientRegistry ingredientRegistry,RecipesGui recipesGui,@Nullable ItemListOverlayInternal itemListOverlayInternal){
  this.recipeRegistry=recipeRegistry;
  this.ingredientRegistry=ingredientRegistry;
  this.recipesGui=recipesGui;
  this.itemListOverlayInternal=itemListOverlayInternal;
  this.mouseHelper=new MouseHelper();
  showsRecipeFocuses.add(recipesGui);
  showsRecipeFocuses.add(itemListOverlayInternal);
  showsRecipeFocuses.add(new GuiContainerWrapper());
}

Fixed version (ground truth):
public InputHandler(JeiRuntime runtime,@Nullable ItemListOverlayInternal itemListOverlayInternal){
  this.recipeRegistry=runtime.getRecipeRegistry();
  this.ingredientRegistry=runtime.getIngredientRegistry();
  this.recipesGui=runtime.getRecipesGui();
  this.itemListOverlayInternal=itemListOverlayInternal;
  this.mouseHelper=new MouseHelper();
  showsRecipeFocuses.add(recipesGui);
  showsRecipeFocuses.add(itemListOverlayInternal);
  showsRecipeFocuses.add(new GuiContainerWrapper());
}
Program: 31452
Project: 31452
Buggy source:
/** 
 * Matches the highlight code in   {@link GuiContainer#drawScreen(int,int,float)}
 */
public void drawHighlight(){
  if (ingredient == null) {
    return;
  }
  GlStateManager.disableLighting();
  GlStateManager.disableDepth();
  GlStateManager.colorMask(true,true,true,false);
  GuiUtils.drawGradientRect(0,area.x,area.y,area.x + area.width,area.y + area.height,0x80FFFFFF,0x80FFFFFF);
  GlStateManager.colorMask(true,true,true,true);
  GlStateManager.enableLighting();
  GlStateManager.enableDepth();
}

Fixed version (ground truth):
/** 
 * Matches the highlight code in   {@link GuiContainer#drawScreen(int,int,float)}
 */
public void drawHighlight(){
  if (ingredient == null) {
    return;
  }
  GlStateManager.disableLighting();
  GlStateManager.disableDepth();
  GlStateManager.colorMask(true,true,true,false);
  GuiUtils.drawGradientRect(0,area.x,area.y,area.x + area.width,area.y + area.height,0x80FFFFFF,0x80FFFFFF);
  GlStateManager.colorMask(true,true,true,true);
  GlStateManager.enableDepth();
}
Program: 31455
Project: 31455
Buggy source:
@Override public void previousPage(){
  if (state == null) {
    return;
  }
  int pageCount=pageCount(recipesPerPage);
  state.pageIndex=(pageCount + state.pageIndex - 1) % pageCount;
  updateRecipes();
}

Fixed version (ground truth):
@Override public void previousPage(){
  if (state == null) {
    return;
  }
  int pageCount=pageCount(state.recipesPerPage);
  state.pageIndex=(pageCount + state.pageIndex - 1) % pageCount;
  updateRecipes();
}
Program: 31456
Project: 31456
Buggy source:
@Override public void nextPage(){
  if (state == null) {
    return;
  }
  int pageCount=pageCount(recipesPerPage);
  state.pageIndex=(state.pageIndex + 1) % pageCount;
  updateRecipes();
}

Fixed version (ground truth):
@Override public void nextPage(){
  if (state == null) {
    return;
  }
  int pageCount=pageCount(state.recipesPerPage);
  state.pageIndex=(state.pageIndex + 1) % pageCount;
  updateRecipes();
}
Program: 31457
Project: 31457
Buggy source:
@Override @Nonnull public List<RecipeLayout> getRecipeWidgets(int posX,int posY,int spacingY){
  if (state == null) {
    return Collections.emptyList();
  }
  List<RecipeLayout> recipeWidgets=new ArrayList<>();
  IRecipeCategory recipeCategory=getRecipeCategory();
  if (recipeCategory == null) {
    return recipeWidgets;
  }
  IRecipeRegistry recipeRegistry=Internal.getRuntime().getRecipeRegistry();
  int recipeWidgetIndex=0;
  for (int recipeIndex=state.pageIndex * recipesPerPage; recipeIndex < recipes.size() && recipeWidgets.size() < recipesPerPage; recipeIndex++) {
    Object recipe=recipes.get(recipeIndex);
    IRecipeWrapper recipeWrapper=getRecipeWrapper(recipeRegistry,recipe,recipe.getClass());
    if (recipeWrapper == null) {
      continue;
    }
    RecipeLayout recipeWidget=new RecipeLayout(recipeWidgetIndex++,posX,posY,recipeCategory,recipeWrapper,state.focus);
    recipeWidgets.add(recipeWidget);
    posY+=spacingY;
  }
  return recipeWidgets;
}

Fixed version (ground truth):
@Override @Nonnull public List<RecipeLayout> getRecipeWidgets(int posX,int posY,int spacingY){
  if (state == null) {
    return Collections.emptyList();
  }
  List<RecipeLayout> recipeWidgets=new ArrayList<>();
  IRecipeCategory recipeCategory=getRecipeCategory();
  if (recipeCategory == null) {
    return recipeWidgets;
  }
  IRecipeRegistry recipeRegistry=Internal.getRuntime().getRecipeRegistry();
  int recipeWidgetIndex=0;
  for (int recipeIndex=state.pageIndex * state.recipesPerPage; recipeIndex < recipes.size() && recipeWidgets.size() < state.recipesPerPage; recipeIndex++) {
    Object recipe=recipes.get(recipeIndex);
    IRecipeWrapper recipeWrapper=getRecipeWrapper(recipeRegistry,recipe,recipe.getClass());
    if (recipeWrapper == null) {
      continue;
    }
    RecipeLayout recipeWidget=new RecipeLayout(recipeWidgetIndex++,posX,posY,recipeCategory,recipeWrapper,state.focus);
    recipeWidgets.add(recipeWidget);
    posY+=spacingY;
  }
  return recipeWidgets;
}
Program: 31458
Project: 31458
Buggy source:
@Override public void setRecipesPerPage(int recipesPerPage){
  if (state == null) {
    return;
  }
  if (this.recipesPerPage != recipesPerPage) {
    int recipeIndex=state.pageIndex * this.recipesPerPage;
    state.pageIndex=recipeIndex / recipesPerPage;
    this.recipesPerPage=recipesPerPage;
    updateRecipes();
  }
}

Fixed version (ground truth):
@Override public void setRecipesPerPage(int recipesPerPage){
  if (state == null) {
    return;
  }
  if (state.recipesPerPage != recipesPerPage) {
    int recipeIndex=state.pageIndex * state.recipesPerPage;
    state.pageIndex=recipeIndex / recipesPerPage;
    state.recipesPerPage=recipesPerPage;
    updateRecipes();
  }
}