Program: 165526
Project: 165526
Buggy source:
@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;
}

Fixed version (ground truth):
@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;
}