Program: 165546
Project: 165546
Buggy source:
protected void updateAllFieldsOfFileDetailPanel(boolean forceUpdatePoster){
  if (movieToWriteToDiskList == null || movieToWriteToDiskList.size() == 0) {
    clearAllFieldsOfSite1Movie();
  }
 else   if (movieToWriteToDiskList != null && movieToWriteToDiskList.get(0) != null) {
    clearAllFieldsOfSite1Movie();
    fileDetailPanel.setCurrentMovie(movieToWriteToDiskList.get(0));
    if (movieToWriteToDiskList != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(movieToWriteToDiskList.get(0).getTitle());
    if (currentlySelectedMovieDMM != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieDMM.getTitle());
    if (currentlySelectedMovieJavLibrary != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieJavLibrary.getTitle());
    if (currentlySelectedMovieSquarePlus != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieSquarePlus.getTitle());
    if (currentlySelectedMovieActionJav != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieActionJav.getTitle());
    if (currentlySelectedMovieJavZoo != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieJavZoo.getTitle());
    if (fileDetailPanel.getCurrentMovie().getAllTitles().size() > 0)     fileDetailPanel.setTitleEditable(true);
    fileDetailPanel.getCurrentMovie().setOriginalTitle(movieToWriteToDiskList.get(0).getOriginalTitle());
    if (movieToWriteToDiskList.get(0).getId() != null)     fileDetailPanel.getCurrentMovie().setId(movieToWriteToDiskList.get(0).getId());
    if (movieToWriteToDiskList.get(0).getStudio() != null)     fileDetailPanel.getCurrentMovie().setStudio(movieToWriteToDiskList.get(0).getStudio());
    if (movieToWriteToDiskList.get(0).getYear() != null)     fileDetailPanel.getCurrentMovie().setYear(movieToWriteToDiskList.get(0).getYear());
    if (movieToWriteToDiskList.get(0).getPlot() != null)     fileDetailPanel.getCurrentMovie().setPlot(movieToWriteToDiskList.get(0).getPlot());
    if (movieToWriteToDiskList.get(0).getSet() != null)     fileDetailPanel.getCurrentMovie().setSet(movieToWriteToDiskList.get(0).getSet());
    fileDetailPanel.getCurrentMovie().setGenres(movieToWriteToDiskList.get(0).getGenres());
    fileDetailPanel.getCurrentMovie().setActors(movieToWriteToDiskList.get(0).getActors());
    boolean posterFileUpdateOccured=false;
    boolean fanartFileUpdateOccured=false;
    if (!forceUpdatePoster) {
      File potentialOtherPosterJpg=new File(Movie.getFileNameOfPoster(currentlySelectedMovieFileList.get(0),true));
      File potentialOtherFanartJpg=new File(Movie.getFileNameOfFanart(currentlySelectedMovieFileList.get(0),true));
      File standardPosterJpg=new File(Movie.getFileNameOfPoster(currentlySelectedMovieFileList.get(0),false));
      File standardFanartJpg=new File(Movie.getFileNameOfFanart(currentlySelectedMovieFileList.get(0),false));
      if (currentlySelectedPosterFileList.get(0).exists()) {
        try {
          BufferedImage img=ImageIO.read(currentlySelectedPosterFileList.get(0));
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          artWorkPanel.setNewPoster(scaledImage);
          posterFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (currentlySelectedFanartFileList.get(0).exists()) {
        try {
          BufferedImage img=ImageIO.read(currentlySelectedFanartFileList.get(0));
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          artWorkPanel.setNewFanart(scaledImage);
          fanartFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (currentlySelectedMovieFileList.get(0).isDirectory() && potentialOtherPosterJpg.exists() && !posterFileUpdateOccured) {
        try {
          BufferedImage img=ImageIO.read(potentialOtherPosterJpg);
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          artWorkPanel.setNewPoster(scaledImage);
          posterFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (currentlySelectedMovieFileList.get(0).isDirectory() && potentialOtherFanartJpg.exists() && !fanartFileUpdateOccured) {
        try {
          BufferedImage img=ImageIO.read(potentialOtherFanartJpg);
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          artWorkPanel.setNewFanart(scaledImage);
          fanartFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (standardPosterJpg.exists() && !posterFileUpdateOccured) {
        try {
          artWorkPanel.setNewPoster(new ImageIcon(standardPosterJpg.getCanonicalPath()));
          posterFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (standardFanartJpg.exists() && !fanartFileUpdateOccured) {
        try {
          BufferedImage img=ImageIO.read(standardFanartJpg);
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          artWorkPanel.setNewFanart(scaledImage);
          fanartFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
    if (movieToWriteToDiskList.get(0).hasPoster() && !posterFileUpdateOccured) {
      try {
        Image posterImage=movieToWriteToDiskList.get(0).getPosters()[0].getThumbImage();
        ImageIcon newPosterIcon=new ImageIcon(posterImage);
        BufferedImage img=(BufferedImage)newPosterIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
        artWorkPanel.setNewPoster(scaledImage);
        posterFileUpdateOccured=true;
      }
 catch (      IOException e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
    if (movieToWriteToDiskList.get(0).hasFanart() && !fanartFileUpdateOccured) {
      System.out.println("String_Node_Str");
      try {
        Image fanartImage=movieToWriteToDiskList.get(0).getFanart()[0].getThumbImage();
        ImageIcon newFanartIcon=new ImageIcon(fanartImage);
        BufferedImage img=(BufferedImage)newFanartIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
        artWorkPanel.setNewFanart(scaledImage);
        fanartImage=scaledImage;
      }
 catch (      IOException e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
  fileDetailPanel.updateView();
}

Fixed version (ground truth):
protected void updateAllFieldsOfFileDetailPanel(boolean forceUpdatePoster){
  if (movieToWriteToDiskList == null || movieToWriteToDiskList.size() == 0) {
    clearAllFieldsOfFileDetailPanel();
  }
 else   if (movieToWriteToDiskList != null && movieToWriteToDiskList.get(0) != null) {
    clearAllFieldsOfFileDetailPanel();
    fileDetailPanel.setCurrentMovie(movieToWriteToDiskList.get(0));
    if (movieToWriteToDiskList != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(movieToWriteToDiskList.get(0).getTitle());
    if (currentlySelectedMovieDMM != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieDMM.getTitle());
    if (currentlySelectedMovieJavLibrary != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieJavLibrary.getTitle());
    if (currentlySelectedMovieSquarePlus != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieSquarePlus.getTitle());
    if (currentlySelectedMovieActionJav != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieActionJav.getTitle());
    if (currentlySelectedMovieJavZoo != null)     fileDetailPanel.getCurrentMovie().getAllTitles().add(currentlySelectedMovieJavZoo.getTitle());
    if (fileDetailPanel.getCurrentMovie().getAllTitles().size() > 0)     fileDetailPanel.setTitleEditable(true);
    fileDetailPanel.getCurrentMovie().setOriginalTitle(movieToWriteToDiskList.get(0).getOriginalTitle());
    if (movieToWriteToDiskList.get(0).getId() != null)     fileDetailPanel.getCurrentMovie().setId(movieToWriteToDiskList.get(0).getId());
    if (movieToWriteToDiskList.get(0).getStudio() != null)     fileDetailPanel.getCurrentMovie().setStudio(movieToWriteToDiskList.get(0).getStudio());
    if (movieToWriteToDiskList.get(0).getYear() != null)     fileDetailPanel.getCurrentMovie().setYear(movieToWriteToDiskList.get(0).getYear());
    if (movieToWriteToDiskList.get(0).getPlot() != null)     fileDetailPanel.getCurrentMovie().setPlot(movieToWriteToDiskList.get(0).getPlot());
    if (movieToWriteToDiskList.get(0).getSet() != null)     fileDetailPanel.getCurrentMovie().setSet(movieToWriteToDiskList.get(0).getSet());
    fileDetailPanel.getCurrentMovie().setGenres(movieToWriteToDiskList.get(0).getGenres());
    fileDetailPanel.getCurrentMovie().setActors(movieToWriteToDiskList.get(0).getActors());
    boolean posterFileUpdateOccured=false;
    boolean fanartFileUpdateOccured=false;
    if (!forceUpdatePoster) {
      File potentialOtherPosterJpg=new File(Movie.getFileNameOfPoster(currentlySelectedMovieFileList.get(0),true));
      File potentialOtherFanartJpg=new File(Movie.getFileNameOfFanart(currentlySelectedMovieFileList.get(0),true));
      File standardPosterJpg=new File(Movie.getFileNameOfPoster(currentlySelectedMovieFileList.get(0),false));
      File standardFanartJpg=new File(Movie.getFileNameOfFanart(currentlySelectedMovieFileList.get(0),false));
      if (currentlySelectedPosterFileList.get(0).exists()) {
        try {
          BufferedImage img=ImageIO.read(currentlySelectedPosterFileList.get(0));
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          artWorkPanel.setNewPoster(scaledImage);
          posterFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (currentlySelectedFanartFileList.get(0).exists()) {
        try {
          BufferedImage img=ImageIO.read(currentlySelectedFanartFileList.get(0));
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          artWorkPanel.setNewFanart(scaledImage);
          fanartFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (currentlySelectedMovieFileList.get(0).isDirectory() && potentialOtherPosterJpg.exists() && !posterFileUpdateOccured) {
        try {
          BufferedImage img=ImageIO.read(potentialOtherPosterJpg);
          BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
          artWorkPanel.setNewPoster(scaledImage);
          posterFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (currentlySelectedMovieFileList.get(0).isDirectory() && potentialOtherFanartJpg.exists() && !fanartFileUpdateOccured) {
        try {
          BufferedImage img=ImageIO.read(potentialOtherFanartJpg);
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          artWorkPanel.setNewFanart(scaledImage);
          fanartFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (standardPosterJpg.exists() && !posterFileUpdateOccured) {
        try {
          artWorkPanel.setNewPoster(new ImageIcon(standardPosterJpg.getCanonicalPath()));
          posterFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
      if (standardFanartJpg.exists() && !fanartFileUpdateOccured) {
        try {
          BufferedImage img=ImageIO.read(standardFanartJpg);
          BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
          artWorkPanel.setNewFanart(scaledImage);
          fanartFileUpdateOccured=true;
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
    if (movieToWriteToDiskList.get(0).hasPoster() && !posterFileUpdateOccured) {
      try {
        Image posterImage=movieToWriteToDiskList.get(0).getPosters()[0].getThumbImage();
        ImageIcon newPosterIcon=new ImageIcon(posterImage);
        BufferedImage img=(BufferedImage)newPosterIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToPoster(img);
        artWorkPanel.setNewPoster(scaledImage);
        posterFileUpdateOccured=true;
      }
 catch (      IOException e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
    if (movieToWriteToDiskList.get(0).hasFanart() && !fanartFileUpdateOccured) {
      System.out.println("String_Node_Str");
      try {
        Image fanartImage=movieToWriteToDiskList.get(0).getFanart()[0].getThumbImage();
        ImageIcon newFanartIcon=new ImageIcon(fanartImage);
        BufferedImage img=(BufferedImage)newFanartIcon.getImage();
        BufferedImage scaledImage=ArtWorkPanel.resizeToFanart(img);
        artWorkPanel.setNewFanart(scaledImage);
        fanartImage=scaledImage;
      }
 catch (      IOException e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(null,ExceptionUtils.getStackTrace(e),"String_Node_Str",JOptionPane.ERROR_MESSAGE);
      }
    }
  }
  fileDetailPanel.updateView();
}