Program: 158167
Project: 158167
Buggy source:
public static void loadImages(){
  renameSymbols(getSymbolsPath() + File.separator + "String_Node_Str");
  smallSymbolsFound=loadSymbolsImages(15);
  mediumSymbolsFound=loadSymbolsImages(25);
  List<String> setCodes=ExpansionRepository.instance.getSetCodes();
  if (setCodes == null) {
    LOGGER.warn("String_Node_Str");
    return;
  }
  for (  String set : setCodes) {
    String[] codes=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    Map<String,Image> rarityImages=new HashMap<>();
    setImages.put(set,rarityImages);
    for (    String rarityCode : codes) {
      File file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set+ "String_Node_Str"+ rarityCode+ "String_Node_Str");
      try {
        Image image=UI.getImageIcon(file.getAbsolutePath()).getImage();
        int width=image.getWidth(null);
        if (width > 21) {
          int h=image.getHeight(null);
          if (h > 0) {
            Rectangle r=new Rectangle(21,(int)(h * 21.0f / width));
            BufferedImage resized=ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image,BufferedImage.TYPE_INT_ARGB),r);
            rarityImages.put(set,resized);
          }
        }
 else {
          rarityImages.put(rarityCode,image);
        }
      }
 catch (      Exception e) {
      }
    }
    try {
      File file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL);
      if (!file.exists()) {
        file.mkdirs();
      }
      for (      String code : codes) {
        file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + set+ "String_Node_Str"+ code+ "String_Node_Str");
        if (file.exists()) {
          continue;
        }
        file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set+ "String_Node_Str"+ code+ "String_Node_Str");
        Image image=UI.getImageIcon(file.getAbsolutePath()).getImage();
        try {
          int width=image.getWidth(null);
          int height=image.getHeight(null);
          if (height > 0) {
            int dx=0;
            if (set.equals("String_Node_Str") || set.equals("String_Node_Str") || set.equals("String_Node_Str")) {
              dx=6;
            }
            Rectangle r=new Rectangle(15 + dx,(int)(height * (15.0f + dx) / width));
            BufferedImage resized=ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image,BufferedImage.TYPE_INT_ARGB),r);
            File newFile=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + File.separator+ set+ "String_Node_Str"+ code+ "String_Node_Str");
            ImageIO.write(resized,"String_Node_Str",newFile);
          }
        }
 catch (        Exception e) {
          if (file.exists()) {
            file.delete();
          }
        }
      }
    }
 catch (    Exception e) {
    }
  }
  File file;
  for (  String set : ExpansionRepository.instance.getSetCodes()) {
    file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL);
    if (!file.exists()) {
      break;
    }
    file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + set+ "String_Node_Str");
    try {
      Image image=UI.getImageIcon(file.getAbsolutePath()).getImage();
      int width=image.getWidth(null);
      int height=image.getHeight(null);
      setImagesExist.put(set,new Dimension(width,height));
    }
 catch (    Exception e) {
    }
  }
}

Fixed version (ground truth):
public static void loadImages(){
  renameSymbols(getSymbolsPath() + File.separator + "String_Node_Str");
  smallSymbolsFound=loadSymbolsImages(15);
  mediumSymbolsFound=loadSymbolsImages(25);
  List<String> setCodes=ExpansionRepository.instance.getSetCodes();
  if (setCodes == null) {
    LOGGER.warn("String_Node_Str");
    return;
  }
  for (  String set : setCodes) {
    if (withoutSymbols.contains(set)) {
      continue;
    }
    String[] codes;
    if (onlyMythics.contains(set)) {
      codes=new String[]{"String_Node_Str"};
    }
 else {
      codes=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
    }
    Map<String,Image> rarityImages=new HashMap<>();
    setImages.put(set,rarityImages);
    for (    String rarityCode : codes) {
      File file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set+ "String_Node_Str"+ rarityCode+ "String_Node_Str");
      try {
        Image image=UI.getImageIcon(file.getAbsolutePath()).getImage();
        int width=image.getWidth(null);
        if (width > 21) {
          int h=image.getHeight(null);
          if (h > 0) {
            Rectangle r=new Rectangle(21,(int)(h * 21.0f / width));
            BufferedImage resized=ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image,BufferedImage.TYPE_INT_ARGB),r);
            rarityImages.put(rarityCode,resized);
          }
        }
 else {
          rarityImages.put(rarityCode,image);
        }
      }
 catch (      Exception e) {
      }
    }
    try {
      File file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL);
      if (!file.exists()) {
        file.mkdirs();
      }
      for (      String code : codes) {
        file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + set+ "String_Node_Str"+ code+ "String_Node_Str");
        if (file.exists()) {
          continue;
        }
        file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET + set+ "String_Node_Str"+ code+ "String_Node_Str");
        Image image=UI.getImageIcon(file.getAbsolutePath()).getImage();
        try {
          int width=image.getWidth(null);
          int height=image.getHeight(null);
          if (height > 0) {
            int dx=0;
            if (set.equals("String_Node_Str") || set.equals("String_Node_Str") || set.equals("String_Node_Str")) {
              dx=6;
            }
            Rectangle r=new Rectangle(15 + dx,(int)(height * (15.0f + dx) / width));
            BufferedImage resized=ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image,BufferedImage.TYPE_INT_ARGB),r);
            File newFile=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + File.separator+ set+ "String_Node_Str"+ code+ "String_Node_Str");
            ImageIO.write(resized,"String_Node_Str",newFile);
          }
        }
 catch (        Exception e) {
          if (file.exists()) {
            file.delete();
          }
        }
      }
    }
 catch (    Exception e) {
    }
  }
  File file;
  for (  String set : ExpansionRepository.instance.getSetCodes()) {
    file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL);
    if (!file.exists()) {
      break;
    }
    file=new File(getSymbolsPath() + Constants.RESOURCE_PATH_SET_SMALL + set+ "String_Node_Str");
    try {
      Image image=UI.getImageIcon(file.getAbsolutePath()).getImage();
      int width=image.getWidth(null);
      int height=image.getHeight(null);
      setImagesExist.put(set,new Dimension(width,height));
    }
 catch (    Exception e) {
    }
  }
}