Program: 165463
Project: 165463
Buggy source:
public void updateView(boolean forceUpdatePoster,GUIMain gui){
  boolean posterFileUpdateOccured=false;
  boolean fanartFileUpdateOccured=false;
  if (!forceUpdatePoster && gui.getCurrentlySelectedMovieFileList().size() > 0) {
    File potentialOtherPosterJpg=new File(Movie.getFileNameOfPoster(gui.getCurrentlySelectedMovieFileList().get(0),true));
    File potentialOtherFanartJpg=new File(Movie.getFileNameOfFanart(gui.getCurrentlySelectedMovieFileList().get(0),true));
    File standardPosterJpg=new File(Movie.getFileNameOfPoster(gui.getCurrentlySelectedMovieFileList().get(0),false));
    File standardFanartJpg=new File(Movie.getFileNameOfFanart(gui.getCurrentlySelectedMovieFileList().get(0),false));
    if (gui.getCurrentlySelectedPosterFileList().get(0).exists()) {
      try {
        BufferedImage img=ImageIO.read(gui.getCurrentlySelectedPosterFileList().get(0));
        if (img != null) {
          posterImage=img;
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          this.setNewPoster(scaledImage,false);
          posterFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (gui.getCurrentlySelectedFanartFileList().get(0).exists()) {
      try {
        BufferedImage img=ImageIO.read(gui.getCurrentlySelectedFanartFileList().get(0));
        if (img != null) {
          fanartImage=img;
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          if (scaledImage != null) {
            this.setNewFanart(scaledImage,false);
            fanartFileUpdateOccured=true;
          }
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (gui.getCurrentlySelectedMovieFileList().get(0).isDirectory() && potentialOtherPosterJpg.exists() && !posterFileUpdateOccured) {
      try {
        BufferedImage img=ImageIO.read(potentialOtherPosterJpg);
        if (img != null) {
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          this.setNewPoster(scaledImage,true);
          posterFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (gui.getCurrentlySelectedMovieFileList().get(0).isDirectory() && potentialOtherFanartJpg.exists() && !fanartFileUpdateOccured) {
      try {
        BufferedImage img=ImageIO.read(potentialOtherFanartJpg);
        if (img != null) {
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          this.setNewFanart(scaledImage,true);
          fanartFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (standardPosterJpg.exists() && !posterFileUpdateOccured) {
      try {
        this.setNewPoster(new ImageIcon(standardPosterJpg.getCanonicalPath()),true);
        posterFileUpdateOccured=true;
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (standardFanartJpg.exists() && !fanartFileUpdateOccured) {
      try {
        BufferedImage img=ImageIO.read(standardFanartJpg);
        if (img != null) {
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          this.setNewFanart(scaledImage,true);
          fanartFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  if (gui.movieToWriteToDiskList.size() > 0 && gui.movieToWriteToDiskList.get(0) != null && gui.movieToWriteToDiskList.get(0).hasPoster() && !posterFileUpdateOccured) {
    try {
      if (gui.getFileDetailPanel().currentMovie.getPosters().length > 0) {
        Image posterImage=gui.getFileDetailPanel().currentMovie.getPosters()[0].getThumbImage();
        ImageIcon newPosterIcon=new ImageIcon(posterImage);
        BufferedImage img=(BufferedImage)newPosterIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
        this.setNewPoster(scaledImage,true);
        posterFileUpdateOccured=true;
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    }
  }
  if (gui.movieToWriteToDiskList.size() > 0 && gui.movieToWriteToDiskList.get(0) != null && gui.movieToWriteToDiskList.get(0).hasFanart() && !fanartFileUpdateOccured) {
    try {
      if (gui.getFileDetailPanel().currentMovie.getFanart().length > 0) {
        Image fanartImage=gui.getFileDetailPanel().currentMovie.getFanart()[0].getThumbImage();
        ImageIcon newFanartIcon=new ImageIcon(fanartImage);
        BufferedImage img=(BufferedImage)newFanartIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
        this.setNewFanart(scaledImage,true);
        fanartImage=scaledImage;
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    }
  }
}

Fixed version (ground truth):
public void updateView(boolean forceUpdatePoster,GUIMain gui){
  boolean posterFileUpdateOccured=false;
  boolean fanartFileUpdateOccured=false;
  if (!forceUpdatePoster && gui.getCurrentlySelectedMovieFileList().size() > 0) {
    File potentialOtherPosterJpg=new File(Movie.getFileNameOfPoster(gui.getCurrentlySelectedMovieFileList().get(0),true));
    File potentialOtherFanartJpg=new File(Movie.getFileNameOfFanart(gui.getCurrentlySelectedMovieFileList().get(0),true));
    File standardPosterJpg=new File(Movie.getFileNameOfPoster(gui.getCurrentlySelectedMovieFileList().get(0),false));
    File standardFanartJpg=new File(Movie.getFileNameOfFanart(gui.getCurrentlySelectedMovieFileList().get(0),false));
    if (gui.getCurrentlySelectedPosterFileList().get(0).exists()) {
      try {
        BufferedImage img=ImageIO.read(gui.getCurrentlySelectedPosterFileList().get(0));
        if (img != null) {
          posterImage=img;
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          this.setNewPoster(scaledImage,false);
          posterFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (gui.getCurrentlySelectedFanartFileList().get(0).exists()) {
      try {
        BufferedImage img=ImageIO.read(gui.getCurrentlySelectedFanartFileList().get(0));
        if (img != null) {
          fanartImage=img;
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          if (scaledImage != null) {
            this.setNewFanart(scaledImage,false);
            fanartFileUpdateOccured=true;
          }
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (gui.getCurrentlySelectedMovieFileList().get(0).isDirectory() && potentialOtherPosterJpg.exists() && !posterFileUpdateOccured) {
      try {
        BufferedImage img=ImageIO.read(potentialOtherPosterJpg);
        if (img != null) {
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          this.setNewPoster(scaledImage,true);
          posterFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (gui.getCurrentlySelectedMovieFileList().get(0).isDirectory() && potentialOtherFanartJpg.exists() && !fanartFileUpdateOccured) {
      try {
        BufferedImage img=ImageIO.read(potentialOtherFanartJpg);
        if (img != null) {
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          this.setNewFanart(scaledImage,true);
          fanartFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (standardPosterJpg.exists() && !posterFileUpdateOccured) {
      try {
        this.setNewPoster(new ImageIcon(standardPosterJpg.getCanonicalPath()),true);
        posterFileUpdateOccured=true;
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
    if (standardFanartJpg.exists() && !fanartFileUpdateOccured) {
      try {
        BufferedImage img=ImageIO.read(standardFanartJpg);
        if (img != null) {
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          this.setNewFanart(scaledImage,true);
          fanartFileUpdateOccured=true;
        }
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  if (gui.movieToWriteToDiskList.size() > 0 && gui.movieToWriteToDiskList.get(0) != null && gui.movieToWriteToDiskList.get(0).hasPoster() && !posterFileUpdateOccured) {
    try {
      if (gui.getFileDetailPanel().currentMovie.getPosters().length > 0) {
        Image posterImage=gui.getFileDetailPanel().currentMovie.getPosters()[0].getThumbImage();
        ImageIcon newPosterIcon=new ImageIcon(posterImage);
        BufferedImage img=(BufferedImage)newPosterIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
        this.setNewPoster(scaledImage,true);
        posterFileUpdateOccured=true;
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    }
  }
  if (gui.movieToWriteToDiskList.size() > 0 && gui.movieToWriteToDiskList.get(0) != null && gui.movieToWriteToDiskList.get(0).hasFanart() && !fanartFileUpdateOccured) {
    try {
      if (gui.getFileDetailPanel().currentMovie.getFanart().length > 0) {
        fanartImage=gui.getFileDetailPanel().currentMovie.getFanart()[0].getThumbImage();
        ImageIcon newFanartIcon=new ImageIcon(fanartImage);
        BufferedImage img=(BufferedImage)newFanartIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
        fanartImage=img;
        this.setNewFanart(scaledImage,false);
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
    }
  }
}