Program: 165506
Project: 165506
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,movieNumberInList,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().size());
    if (promptUserForURLWhenScraping && scrapeJAV) {
      try {
        DmmParsingProfile dmmParsingProfile=new DmmParsingProfile(!ScrapeMovieAction.this.guiMain.getPreferences().getScrapeInJapanese());
        if (guiMain.getPreferences().getPromptForUserProvidedURLWhenScraping()) {
          setOverridenSearchResult(dmmParsingProfile,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString());
        }
        if (dmmParsingProfile.getOverridenSearchResult() != null) {
          overrideURLDMM=dmmParsingProfile.getOverridenSearchResult().toString();
        }
 else {
          String searchStringDMM=dmmParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
          SearchResult[] searchResultsDMM=dmmParsingProfile.getSearchResults(searchStringDMM);
          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()) {
          JavLibraryParsingProfile javLibParsingProfile=new JavLibraryParsingProfile();
          if (guiMain.getPreferences().getPromptForUserProvidedURLWhenScraping()) {
            setOverridenSearchResult(javLibParsingProfile,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString());
          }
          if (javLibParsingProfile.getOverridenSearchResult() != null) {
            overrideURLJavLibrary=javLibParsingProfile.getOverridenSearchResult().toString();
          }
 else {
            String searchStringJL=javLibParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            SearchResult[] searchResultsJavLibStrings=javLibParsingProfile.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();
        if (guiMain.getPreferences().getPromptForUserProvidedURLWhenScraping()) {
          setOverridenSearchResult(data18ParsingProfile,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString());
        }
        if (data18ParsingProfile.getOverridenSearchResult() != null) {
          overrideURLData18Movie=data18ParsingProfile.getOverridenSearchResult().toString();
        }
 else {
          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(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);
      }
      clearOverrides();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
      clearOverrides();
    }
    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 dmmParsingProfile=new DmmParsingProfile(!ScrapeMovieAction.this.guiMain.getPreferences().getScrapeInJapanese());
        if (guiMain.getPreferences().getPromptForUserProvidedURLWhenScraping()) {
          setOverridenSearchResult(dmmParsingProfile,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString());
        }
        if (dmmParsingProfile.getOverridenSearchResult() != null) {
          overrideURLDMM=dmmParsingProfile.getOverridenSearchResult().toString();
        }
 else {
          String searchStringDMM=dmmParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
          SearchResult[] searchResultsDMM=dmmParsingProfile.getSearchResults(searchStringDMM);
          if (searchResultsDMM != null && searchResultsDMM.length > 0) {
            SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsDMM,"String_Node_Str");
            if (searchResultFromUser != null)             overrideURLDMM=searchResultFromUser.getUrlPath();
 else {
              guiMain.movieToWriteToDiskList.add(null);
              clearOverrides();
            }
          }
        }
        if (!ScrapeMovieAction.this.guiMain.getPreferences().getScrapeInJapanese()) {
          JavLibraryParsingProfile javLibParsingProfile=new JavLibraryParsingProfile();
          if (guiMain.getPreferences().getPromptForUserProvidedURLWhenScraping()) {
            setOverridenSearchResult(javLibParsingProfile,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString());
          }
          if (javLibParsingProfile.getOverridenSearchResult() != null) {
            overrideURLJavLibrary=javLibParsingProfile.getOverridenSearchResult().toString();
          }
 else {
            String searchStringJL=javLibParsingProfile.createSearchString(ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList));
            SearchResult[] searchResultsJavLibStrings=javLibParsingProfile.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) {
          guiMain.movieToWriteToDiskList.add(null);
          clearOverrides();
          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();
        if (guiMain.getPreferences().getPromptForUserProvidedURLWhenScraping()) {
          setOverridenSearchResult(data18ParsingProfile,ScrapeMovieAction.this.guiMain.getCurrentlySelectedMovieFileList().get(movieNumberInList).toString());
        }
        if (data18ParsingProfile.getOverridenSearchResult() != null) {
          overrideURLData18Movie=data18ParsingProfile.getOverridenSearchResult().toString();
        }
 else {
          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) {
              guiMain.movieToWriteToDiskList.add(null);
              clearOverrides();
              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(searchResultsIAFD);
          if (searchResultsIAFD != null && searchResultsIAFD.length > 0) {
            SearchResult searchResultFromUser=GUIMain.showOptionPane(searchResultsIAFD,"String_Node_Str");
            if (searchResultFromUser == null) {
              guiMain.movieToWriteToDiskList.add(null);
              clearOverrides();
              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);
      }
      clearOverrides();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
      clearOverrides();
    }
    makeProgress(100,"String_Node_Str");
  }
  return null;
}