Program: 165523
Project: 165523
Buggy source:
public void actionPerformed(ActionEvent e){
  resetScrapeMovieActionCounters();
  this.guiMain.setMainGUIEnabled(false);
  this.guiMain.removeOldScrapedMovieReferences();
  clearOverrides();
  worker=new SwingWorker<Void,String>(){
    Movie javMovie=null;
    Movie data18Movie=null;
    @Override protected Void doInBackground(){
      for (int movieNumberInList=0; movieNumberInList < ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().size(); movieNumberInList++) {
        if (this.isCancelled()) {
          System.err.println("String_Node_Str");
          cancelRunningThreads();
          return null;
        }
        final int movieNumberInListFinal=movieNumberInList;
        ScrapeMovieAction.this.guiMain.getFrmMoviescraper().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        String currentFileName=ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString();
        initializeProgressMonitor(currentFileName);
        if (promptUserForURLWhenScraping && scrapeJAV) {
          try {
            DmmParsingProfile dmmPP=new DmmParsingProfile(!ScrapeMovieAction.this.guiMain.getPreferences().getScrapeInJapanese());
            JavLibraryParsingProfile jlPP=new JavLibraryParsingProfile();
            String searchStringDMM=dmmPP.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            SearchResult[] searchResultsDMM=dmmPP.getSearchResults(searchStringDMM);
            String searchStringJL=jlPP.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            if (searchResultsDMM != null && searchResultsDMM.length > 0) {
              SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsDMM,"String_Node_Str");
              if (searchResultFromUser != null)               overrideURLDMM=searchResultFromUser.getUrlPath();
            }
            if (!ScrapeMovieAction.this.guiMain.getPreferences().getScrapeInJapanese()) {
              SearchResult[] searchResultsJavLibStrings=jlPP.getSearchResults(searchStringJL);
              if (searchResultsJavLibStrings != null && searchResultsJavLibStrings.length > 0) {
                SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsJavLibStrings,"String_Node_Str");
                if (searchResultFromUser != null)                 overrideURLJavLibrary=searchResultFromUser.getUrlPath();
              }
            }
            if (overrideURLDMM == null && overrideURLJavLibrary == null)             continue;
          }
 catch (          IOException e2) {
            e2.printStackTrace();
          }
        }
 else         if (promptUserForURLWhenScraping && (scrapeData18Movie || scrapeData18WebContent)) {
          try {
            SiteParsingProfile data18ParsingProfile=null;
            if (scrapeData18Movie)             data18ParsingProfile=new Data18MovieParsingProfile();
 else             if (scrapeData18WebContent)             data18ParsingProfile=new Data18WebContentParsingProfile();
            String searchStringData18Movie=data18ParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            SearchResult[] searchResultData18Movie=data18ParsingProfile.getSearchResults(searchStringData18Movie);
            if (searchResultData18Movie != null && searchResultData18Movie.length > 0) {
              SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultData18Movie,"String_Node_Str");
              if (searchResultFromUser == null)               continue;
              overrideURLData18Movie=searchResultFromUser.getUrlPath();
            }
            if (scrapeData18Movie && ScrapeMovieAction.this.guiMain.getPreferences().getUseIAFDForActors()) {
              IAFDParsingProfile iafdParsingProfile=new IAFDParsingProfile();
              SearchResult[] searchResultsIAFD=iafdParsingProfile.getSearchResults(iafdParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList)));
              System.out.println(searchStringData18Movie);
              System.out.println(searchResultsIAFD);
              if (searchResultsIAFD != null && searchResultsIAFD.length > 0) {
                SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsIAFD,"String_Node_Str");
                if (searchResultFromUser == null)                 continue;
                overrideURLIAFD=searchResultFromUser.getUrlPath();
                if (!overrideURLIAFD.contains("String_Node_Str"))                 overrideURLIAFD="String_Node_Str" + overrideURLIAFD;
                System.out.println("String_Node_Str" + overrideURLIAFD);
              }
            }
          }
 catch (          IOException e1) {
            e1.printStackTrace();
          }
        }
        try {
          if (scrapeJAV)           javMovie=makeJavThreadsAndScrape(movieNumberInListFinal);
 else           if (scrapeData18Movie)           data18Movie=makeData18MovieThreadsAndScrape(movieNumberInListFinal,true);
 else           if (scrapeData18WebContent) {
            data18Movie=makeData18MovieThreadsAndScrape(movieNumberInListFinal,false);
          }
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        makeProgress(100,"String_Node_Str");
      }
      return null;
    }
    @Override protected void done(){
      if (manuallyPickPoster && data18Movie != null && data18Movie.getPosters() != null && data18Movie.getPosters().length > 1) {
        HashSet<Thumb> uniqueElements=new HashSet<Thumb>(Arrays.asList(data18Movie.getPosters()));
        uniqueElements.addAll(Arrays.asList(data18Movie.getExtraFanart()));
        ArrayList<Thumb> uniqueElementsList=(new ArrayList<Thumb>(uniqueElements));
        Thumb[] uniqueElementsArray=uniqueElementsList.toArray(new Thumb[uniqueElementsList.size()]);
        Thumb posterPicked=showArtPicker(uniqueElementsArray,"String_Node_Str");
        if (posterPicked != null) {
          ArrayList<Thumb> existingPosters=new ArrayList<Thumb>(Arrays.asList(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().getPosters()));
          existingPosters.remove(posterPicked);
          existingPosters.add(0,posterPicked);
          Thumb[] posterArray=new Thumb[existingPosters.size()];
          ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().setPosters(existingPosters.toArray(posterArray));
        }
      }
      if (manuallyPickFanart && data18Movie != null && data18Movie.getFanart() != null && data18Movie.getFanart().length > 1) {
        HashSet<Thumb> uniqueElements=new HashSet<Thumb>(Arrays.asList(data18Movie.getFanart()));
        uniqueElements.addAll(Arrays.asList(data18Movie.getExtraFanart()));
        ArrayList<Thumb> uniqueElementsList=(new ArrayList<Thumb>(uniqueElements));
        Thumb[] uniqueElementsArray=uniqueElementsList.toArray(new Thumb[uniqueElementsList.size()]);
        Thumb fanartPicked=showArtPicker(uniqueElementsArray,"String_Node_Str");
        if (fanartPicked != null) {
          ArrayList<Thumb> existingFanart=new ArrayList<Thumb>(Arrays.asList(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().getFanart()));
          existingFanart.remove(fanartPicked);
          existingFanart.add(0,fanartPicked);
          Thumb[] fanartArray=new Thumb[existingFanart.size()];
          ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().setFanart(existingFanart.toArray(fanartArray));
        }
      }
 else       if (manuallyPickFanart && javMovie != null) {
        Thumb fanartPicked=showArtPicker(ArrayUtils.addAll(javMovie.getFanart(),javMovie.getExtraFanart()),"String_Node_Str");
        if (fanartPicked != null)         javMovie.setFanart(ArrayUtils.toArray(fanartPicked));
      }
      if (!scrapeCanceled && (ScrapeMovieAction.this.guiMain.movieToWriteToDiskList == null || ScrapeMovieAction.this.guiMain.movieToWriteToDiskList.size() == 0)) {
        System.out.println("String_Node_Str");
        JOptionPane.showMessageDialog(ScrapeMovieAction.this.guiMain.getFrmMoviescraper(),"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE,null);
      }
      clearOverrides();
      ScrapeMovieAction.this.guiMain.updateAllFieldsOfFileDetailPanel(true);
      ScrapeMovieAction.this.guiMain.getFrmMoviescraper().setCursor(Cursor.getDefaultCursor());
      ScrapeMovieAction.this.guiMain.setMainGUIEnabled(true);
    }
  }
;
  worker.execute();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  resetScrapeMovieActionCounters();
  this.guiMain.setMainGUIEnabled(false);
  this.guiMain.removeOldScrapedMovieReferences();
  clearOverrides();
  worker=new SwingWorker<Void,String>(){
    Movie javMovie=null;
    Movie data18Movie=null;
    @Override protected Void doInBackground(){
      for (int movieNumberInList=0; movieNumberInList < ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().size(); movieNumberInList++) {
        if (this.isCancelled()) {
          System.err.println("String_Node_Str");
          cancelRunningThreads();
          return null;
        }
        final int movieNumberInListFinal=movieNumberInList;
        ScrapeMovieAction.this.guiMain.getFrmMoviescraper().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        String currentFileName=ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString();
        initializeProgressMonitor(currentFileName,movieNumberInList,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().size());
        if (promptUserForURLWhenScraping && scrapeJAV) {
          try {
            DmmParsingProfile dmmPP=new DmmParsingProfile(!ScrapeMovieAction.this.guiMain.getPreferences().getScrapeInJapanese());
            JavLibraryParsingProfile jlPP=new JavLibraryParsingProfile();
            String searchStringDMM=dmmPP.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            SearchResult[] searchResultsDMM=dmmPP.getSearchResults(searchStringDMM);
            String searchStringJL=jlPP.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            if (searchResultsDMM != null && searchResultsDMM.length > 0) {
              SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsDMM,"String_Node_Str");
              if (searchResultFromUser != null)               overrideURLDMM=searchResultFromUser.getUrlPath();
            }
            if (!ScrapeMovieAction.this.guiMain.getPreferences().getScrapeInJapanese()) {
              SearchResult[] searchResultsJavLibStrings=jlPP.getSearchResults(searchStringJL);
              if (searchResultsJavLibStrings != null && searchResultsJavLibStrings.length > 0) {
                SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsJavLibStrings,"String_Node_Str");
                if (searchResultFromUser != null)                 overrideURLJavLibrary=searchResultFromUser.getUrlPath();
              }
            }
            if (overrideURLDMM == null && overrideURLJavLibrary == null)             continue;
          }
 catch (          IOException e2) {
            e2.printStackTrace();
          }
        }
 else         if (promptUserForURLWhenScraping && (scrapeData18Movie || scrapeData18WebContent)) {
          try {
            SiteParsingProfile data18ParsingProfile=null;
            if (scrapeData18Movie)             data18ParsingProfile=new Data18MovieParsingProfile();
 else             if (scrapeData18WebContent)             data18ParsingProfile=new Data18WebContentParsingProfile();
            String searchStringData18Movie=data18ParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            SearchResult[] searchResultData18Movie=data18ParsingProfile.getSearchResults(searchStringData18Movie);
            if (searchResultData18Movie != null && searchResultData18Movie.length > 0) {
              SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultData18Movie,"String_Node_Str");
              if (searchResultFromUser == null)               continue;
              overrideURLData18Movie=searchResultFromUser.getUrlPath();
            }
            if (scrapeData18Movie && ScrapeMovieAction.this.guiMain.getPreferences().getUseIAFDForActors()) {
              IAFDParsingProfile iafdParsingProfile=new IAFDParsingProfile();
              SearchResult[] searchResultsIAFD=iafdParsingProfile.getSearchResults(iafdParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList)));
              System.out.println(searchStringData18Movie);
              System.out.println(searchResultsIAFD);
              if (searchResultsIAFD != null && searchResultsIAFD.length > 0) {
                SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsIAFD,"String_Node_Str");
                if (searchResultFromUser == null)                 continue;
                overrideURLIAFD=searchResultFromUser.getUrlPath();
                if (!overrideURLIAFD.contains("String_Node_Str"))                 overrideURLIAFD="String_Node_Str" + overrideURLIAFD;
                System.out.println("String_Node_Str" + overrideURLIAFD);
              }
            }
          }
 catch (          IOException e1) {
            e1.printStackTrace();
          }
        }
        try {
          if (scrapeJAV)           javMovie=makeJavThreadsAndScrape(movieNumberInListFinal);
 else           if (scrapeData18Movie)           data18Movie=makeData18MovieThreadsAndScrape(movieNumberInListFinal,true);
 else           if (scrapeData18WebContent) {
            data18Movie=makeData18MovieThreadsAndScrape(movieNumberInListFinal,false);
          }
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        makeProgress(100,"String_Node_Str");
      }
      return null;
    }
    @Override protected void done(){
      guiMain.getProgressMonitor().stop();
      if (manuallyPickPoster && data18Movie != null && data18Movie.getPosters() != null && data18Movie.getPosters().length > 1) {
        HashSet<Thumb> uniqueElements=new HashSet<Thumb>(Arrays.asList(data18Movie.getPosters()));
        uniqueElements.addAll(Arrays.asList(data18Movie.getExtraFanart()));
        ArrayList<Thumb> uniqueElementsList=(new ArrayList<Thumb>(uniqueElements));
        Thumb[] uniqueElementsArray=uniqueElementsList.toArray(new Thumb[uniqueElementsList.size()]);
        Thumb posterPicked=showArtPicker(uniqueElementsArray,"String_Node_Str");
        if (posterPicked != null) {
          ArrayList<Thumb> existingPosters=new ArrayList<Thumb>(Arrays.asList(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().getPosters()));
          existingPosters.remove(posterPicked);
          existingPosters.add(0,posterPicked);
          Thumb[] posterArray=new Thumb[existingPosters.size()];
          ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().setPosters(existingPosters.toArray(posterArray));
        }
      }
      if (manuallyPickFanart && data18Movie != null && data18Movie.getFanart() != null && data18Movie.getFanart().length > 1) {
        HashSet<Thumb> uniqueElements=new HashSet<Thumb>(Arrays.asList(data18Movie.getFanart()));
        uniqueElements.addAll(Arrays.asList(data18Movie.getExtraFanart()));
        ArrayList<Thumb> uniqueElementsList=(new ArrayList<Thumb>(uniqueElements));
        Thumb[] uniqueElementsArray=uniqueElementsList.toArray(new Thumb[uniqueElementsList.size()]);
        Thumb fanartPicked=showArtPicker(uniqueElementsArray,"String_Node_Str");
        if (fanartPicked != null) {
          ArrayList<Thumb> existingFanart=new ArrayList<Thumb>(Arrays.asList(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().getFanart()));
          existingFanart.remove(fanartPicked);
          existingFanart.add(0,fanartPicked);
          Thumb[] fanartArray=new Thumb[existingFanart.size()];
          ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieData18Movie().setFanart(existingFanart.toArray(fanartArray));
        }
      }
 else       if (manuallyPickFanart && javMovie != null) {
        Thumb fanartPicked=showArtPicker(ArrayUtils.addAll(javMovie.getFanart(),javMovie.getExtraFanart()),"String_Node_Str");
        if (fanartPicked != null)         javMovie.setFanart(ArrayUtils.toArray(fanartPicked));
      }
      if (!scrapeCanceled && (ScrapeMovieAction.this.guiMain.movieToWriteToDiskList == null || ScrapeMovieAction.this.guiMain.movieToWriteToDiskList.size() == 0)) {
        System.out.println("String_Node_Str");
        JOptionPane.showMessageDialog(ScrapeMovieAction.this.guiMain.getFrmMoviescraper(),"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE,null);
      }
      clearOverrides();
      ScrapeMovieAction.this.guiMain.updateAllFieldsOfFileDetailPanel(true);
      ScrapeMovieAction.this.guiMain.getFrmMoviescraper().setCursor(Cursor.getDefaultCursor());
      ScrapeMovieAction.this.guiMain.setMainGUIEnabled(true);
    }
  }
;
  worker.execute();
}