nus-yam/ex-repair huggingface dataset:
Program: 165497
Project: 165497
Buggy source:
protected void scrapeGeneric(SiteParsingProfile spp){
  scrapeActors=spp.scrapeActors();
  scrapeDirectors=spp.scrapeDirectors();
  scrapeExtraFanart=spp.scrapeExtraFanart();
  scrapeFanart=spp.scrapeFanart();
  scrapeGenres=spp.scrapeGenres();
  scrapeID=spp.scrapeID();
  scrapeMPAA=spp.scrapeMPAA();
  scrapeOriginalTitle=spp.scrapeOriginalTitle();
  scrapeOutline=spp.scrapeOutline();
  scrapePlot=spp.scrapePlot();
  scrapePosters=spp.scrapePosters();
  scrapeRating=spp.scrapeRating();
  scrapeRuntime=spp.scrapeRuntime();
  scrapeSet=spp.scrapeSet();
  scrapeSortTitle=spp.scrapeSortTitle();
  scrapeStudio=spp.scrapeStudio();
  scrapeTagline=spp.scrapeTagline();
  scrapeTitle=spp.scrapeTitle();
  scrapeTop250=spp.scrapeTop250();
  scrapeTrailer=spp.scrapeTrailer();
  scrapeVotes=spp.scrapeVotes();
  scrapeYear=spp.scrapeYear();
  MoviescraperPreferences scraperPreferences=new MoviescraperPreferences();
  if (scraperPreferences.getAppendIDToStartOfTitle() && scrapeID != null && scrapeID.getId() != null && scrapeID.getId().trim().length() > 0 && scrapeTitle != null && scrapeTitle.getTitle() != null && scrapeTitle.getTitle().length() > 0) {
    scrapeTitle.setTitle(scrapeID.getId() + "String_Node_Str" + scrapeTitle.getTitle());
  }
}

Fixed version (ground truth):
protected void scrapeGeneric(SiteParsingProfile spp){
  scrapeActors=spp.scrapeActors();
  scrapeDirectors=spp.scrapeDirectors();
  scrapeExtraFanart=spp.scrapeExtraFanart();
  scrapeFanart=spp.scrapeFanart();
  scrapeGenres=spp.scrapeGenres();
  scrapeID=spp.scrapeID();
  scrapeMPAA=spp.scrapeMPAA();
  scrapeOriginalTitle=spp.scrapeOriginalTitle();
  scrapeOutline=spp.scrapeOutline();
  scrapePlot=spp.scrapePlot();
  scrapePosters=spp.scrapePosters();
  scrapeRating=spp.scrapeRating();
  scrapeRuntime=spp.scrapeRuntime();
  scrapeSet=spp.scrapeSet();
  scrapeSortTitle=spp.scrapeSortTitle();
  scrapeStudio=spp.scrapeStudio();
  scrapeTagline=spp.scrapeTagline();
  scrapeTitle=spp.scrapeTitle();
  scrapeTop250=spp.scrapeTop250();
  scrapeTrailer=spp.scrapeTrailer();
  scrapeVotes=spp.scrapeVotes();
  scrapeYear=spp.scrapeYear();
  MoviescraperPreferences scraperPreferences=MoviescraperPreferences.getInstance();
  if (scraperPreferences.getAppendIDToStartOfTitle() && scrapeID != null && scrapeID.getId() != null && scrapeID.getId().trim().length() > 0 && scrapeTitle != null && scrapeTitle.getTitle() != null && scrapeTitle.getTitle().length() > 0) {
    scrapeTitle.setTitle(scrapeID.getId() + "String_Node_Str" + scrapeTitle.getTitle());
  }
}
Program: 165498
Project: 165498
Buggy source:
public MoviescraperPreferences(){
  super();
  setSanitizerForFilename(getSanitizerForFilename());
  setRenamerString(getRenamerString());
}

Fixed version (ground truth):
private MoviescraperPreferences(){
}
Program: 165499
Project: 165499
Buggy source:
public String getRenamerString(){
  return getStringValue(Key.renamerString,"String_Node_Str");
}

Fixed version (ground truth):
public static String getRenamerString(){
  return getStringValue(Key.renamerString,"String_Node_Str");
}
Program: 165500
Project: 165500
Buggy source:
public String getSanitizerForFilename(){
  return getStringValue(Key.sanitizerForFilename,"String_Node_Str");
}

Fixed version (ground truth):
public static String getSanitizerForFilename(){
  return getStringValue(Key.sanitizerForFilename,"String_Node_Str");
}
Program: 165501
Project: 165501
Buggy source:
public void savePreferences(){
  try {
    programPreferences.storeToXML(new FileOutputStream(fileNameOfPreferences),"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void savePreferences(){
  try (FileOutputStream settingsOutputStream=new FileOutputStream(fileNameOfPreferences)){
    programPreferences.storeToXML(settingsOutputStream,"String_Node_Str");
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 165502
Project: 165502
Buggy source:
protected <K extends Key>String getStringValue(K preferenceName,String defaultValue){
  String fieldValue=preferenceName.getKey();
  String preferenceValue=programPreferences.getProperty(fieldValue);
  if (preferenceValue != null)   return preferenceValue;
  return defaultValue;
}

Fixed version (ground truth):
protected static <K extends Key>String getStringValue(K preferenceName,String defaultValue){
  String fieldValue=preferenceName.getKey();
  String preferenceValue=programPreferences.getProperty(fieldValue);
  if (preferenceValue != null)   return preferenceValue;
  return defaultValue;
}
Program: 165503
Project: 165503
Buggy source:
public Settings(){
  super();
}

Fixed version (ground truth):
protected Settings(){
}
Program: 165504
Project: 165504
Buggy source:
public static SearchResult showOptionPane(SearchResult[] searchResults,String siteName){
  if (searchResults.length > 0) {
    SelectionDialog selectionDialog=new SelectionDialog(searchResults,siteName);
    JOptionPane.showOptionDialog(null,selectionDialog,"String_Node_Str" + siteName,JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE,null,null,null);
    return selectionDialog.getSelectedValue();
  }
 else   return null;
}

Fixed version (ground truth):
public static SearchResult showOptionPane(SearchResult[] searchResults,String siteName){
  if (searchResults.length > 0) {
    SelectionDialog selectionDialog=new SelectionDialog(searchResults,siteName);
    int optionPicked=JOptionPane.showOptionDialog(null,selectionDialog,"String_Node_Str" + siteName,JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE,null,null,null);
    if (optionPicked == JOptionPane.CANCEL_OPTION)     return null;
    return selectionDialog.getSelectedValue();
  }
 else   return null;
}
Program: 165508
Project: 165508
Buggy source:
@Override public ArrayList<Actor> scrapeActors(){
  Elements elements=document.select("String_Node_Str");
  ArrayList<Actor> list=new ArrayList<>();
  if (elements != null) {
    for (    Element element : elements) {
      String href=element.attr("String_Node_Str");
      String name=WordUtils.capitalize(element.childNode(0).toString());
      Thumb thumb=null;
      try {
        Document actorDoc=Jsoup.connect(href).userAgent("String_Node_Str").ignoreHttpErrors(true).timeout(0).get();
        Element first=actorDoc.select("String_Node_Str").first();
        if (first != null) {
          String thumbURL=first.attr("String_Node_Str");
          thumb=new Thumb(thumbURL);
        }
        list.add(new Actor(name,null,thumb));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  return list;
}

Fixed version (ground truth):
@Override public ArrayList<Actor> scrapeActors(){
  Elements elements=document.select("String_Node_Str");
  ArrayList<Actor> list=new ArrayList<>();
  if (elements != null) {
    for (    Element element : elements) {
      String href=element.attr("String_Node_Str");
      String name=WordUtils.capitalize(element.text());
      Thumb thumb=null;
      try {
        Document actorDoc=Jsoup.connect(href).userAgent("String_Node_Str").ignoreHttpErrors(true).timeout(0).get();
        Element first=actorDoc.select("String_Node_Str").first();
        if (first != null) {
          String thumbURL=first.attr("String_Node_Str");
          thumb=new Thumb(thumbURL);
        }
        list.add(new Actor(name,null,thumb));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  return list;
}
Program: 165509
Project: 165509
Buggy source:
@Override public String createSearchString(File file){
  String fileID=findIDTagFromFile(file).toLowerCase();
  if (fileID != null) {
    englishPage="String_Node_Str" + fileID + "String_Node_Str";
    japanesePage="String_Node_Str" + fileID + "String_Node_Str";
    try {
      japaneseDocument=Jsoup.connect(japanesePage).timeout(0).get();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    if (scrapeInEnglish) {
      return englishPage;
    }
 else {
      return japanesePage;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String createSearchString(File file){
  String fileID=findIDTagFromFile(file).toLowerCase();
  if (fileID != null) {
    englishPage="String_Node_Str" + fileID + "String_Node_Str";
    japanesePage="String_Node_Str" + fileID + "String_Node_Str";
    try {
      japaneseDocument=Jsoup.connect(japanesePage).timeout(0).get();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    if (scrapingLanguage == Language.ENGLISH) {
      return englishPage;
    }
 else {
      return japanesePage;
    }
  }
  return null;
}
Program: 165510
Project: 165510
Buggy source:
@Override public OriginalTitle scrapeOriginalTitle(){
  if (!scrapeInEnglish)   return new OriginalTitle(scrapeTitle().getTitle());
 else {
    Document originalDocument=document;
    document=japaneseDocument;
    OriginalTitle originalTitle=new OriginalTitle(scrapeTitle().getTitle());
    document=originalDocument;
    return originalTitle;
  }
}

Fixed version (ground truth):
@Override public OriginalTitle scrapeOriginalTitle(){
  if (scrapingLanguage == Language.JAPANESE)   return new OriginalTitle(scrapeTitle().getTitle());
 else {
    Document originalDocument=document;
    document=japaneseDocument;
    OriginalTitle originalTitle=new OriginalTitle(scrapeTitle().getTitle());
    document=originalDocument;
    return originalTitle;
  }
}
Program: 165511
Project: 165511
Buggy source:
@Override public SiteParsingProfile newInstance(){
  return new HeyzoParsingProfile(scrapeInEnglish);
}

Fixed version (ground truth):
@Override public SiteParsingProfile newInstance(){
  return new HeyzoParsingProfile();
}
Program: 165512
Project: 165512
Buggy source:
public HeyzoParsingProfile(boolean scrapeInEnglish){
  this.scrapeInEnglish=scrapeInEnglish;
}

Fixed version (ground truth):
public HeyzoParsingProfile(){
  super();
}
Program: 165513
Project: 165513
Buggy source:
@Override public Votes scrapeVotes(){
  Element votesElement=document.select("String_Node_Str").first();
  String votes=votesElement.text();
  votes=votes.substring(2,votes.indexOf('v') - 1);
  return new Votes(votes);
}

Fixed version (ground truth):
@Override public Votes scrapeVotes(){
  Element votesElement=document.select("String_Node_Str").first();
  if (votesElement != null) {
    String votes=votesElement.text();
    votes=votes.substring(2,votes.indexOf('v') - 1);
    return new Votes(votes);
  }
  return Votes.BLANK_VOTES;
}
Program: 165514
Project: 165514
Buggy source:
@Override public Rating scrapeRating(){
  Element ratingElement=document.select("String_Node_Str").first();
  String ratingImgUrl=ratingElement.attr("String_Node_Str");
  String ratingIntegerIntegerPart=ratingImgUrl.substring(ratingImgUrl.length() - 7,ratingImgUrl.length() - 6);
  String ratingDecimalIntegerPart=ratingImgUrl.substring(ratingImgUrl.length() - 5,ratingImgUrl.length() - 4);
  return new Rating(5.0,ratingIntegerIntegerPart + "String_Node_Str" + ratingDecimalIntegerPart);
}

Fixed version (ground truth):
@Override public Rating scrapeRating(){
  Element ratingElement=document.select("String_Node_Str").first();
  if (ratingElement != null) {
    String ratingImgUrl=ratingElement.attr("String_Node_Str");
    String ratingIntegerIntegerPart=ratingImgUrl.substring(ratingImgUrl.length() - 7,ratingImgUrl.length() - 6);
    String ratingDecimalIntegerPart=ratingImgUrl.substring(ratingImgUrl.length() - 5,ratingImgUrl.length() - 4);
    return new Rating(5.0,ratingIntegerIntegerPart + "String_Node_Str" + ratingDecimalIntegerPart);
  }
  return Rating.BLANK_RATING;
}
Program: 165516
Project: 165516
Buggy source:
@Override public String createSearchString(File file){
  String fileID=findIDTagFromFile(file);
  if (fileID == null)   return null;
  fileID=fileID.toLowerCase();
  if (fileID != null) {
    englishPage="String_Node_Str" + fileID + "String_Node_Str";
    japanesePage="String_Node_Str" + fileID + "String_Node_Str";
    if (scrapeInEnglish) {
      return englishPage;
    }
 else {
      return japanesePage;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String createSearchString(File file){
  String fileID=findIDTagFromFile(file);
  if (fileID == null)   return null;
  fileID=fileID.toLowerCase();
  if (fileID != null) {
    englishPage="String_Node_Str" + fileID + "String_Node_Str";
    japanesePage="String_Node_Str" + fileID + "String_Node_Str";
    if (scrapingLanguage == Language.ENGLISH) {
      return englishPage;
    }
 else {
      return japanesePage;
    }
  }
  return null;
}
Program: 165517
Project: 165517
Buggy source:
@Override public Title scrapeTitle(){
  Element titleElement=document.select("String_Node_Str").first();
  String id=scrapeID().getId();
  String title=titleElement.text().trim();
  title=title.replaceAll(Pattern.quote("String_Node_Str"),"String_Node_Str");
  title=title.replaceAll(Pattern.quote("String_Node_Str"),"String_Node_Str");
  if (title.equals("String_Node_Str"))   title=title + "String_Node_Str" + id;
 else   title=title + "String_Node_Str" + id;
  return new Title(title);
}

Fixed version (ground truth):
@Override public Title scrapeTitle(){
  Element titleElement=document.select("String_Node_Str").first();
  if (titleElement != null) {
    String id=scrapeID().getId();
    String title=titleElement.text().trim();
    title=title.replaceAll(Pattern.quote("String_Node_Str"),"String_Node_Str");
    title=title.replaceAll(Pattern.quote("String_Node_Str"),"String_Node_Str");
    if (title.equals("String_Node_Str"))     title=title + "String_Node_Str" + id;
 else     title=title + "String_Node_Str" + id;
    return new Title(title);
  }
  return new Title("String_Node_Str");
}
Program: 165518
Project: 165518
Buggy source:
@Override public OriginalTitle scrapeOriginalTitle(){
  if (!scrapeInEnglish)   return new OriginalTitle(scrapeTitle().getTitle());
 else {
    Document originalDocument=document;
    try {
      document=Jsoup.connect(japanesePage).get();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    OriginalTitle originalTitle=new OriginalTitle(scrapeTitle().getTitle());
    document=originalDocument;
    return originalTitle;
  }
}

Fixed version (ground truth):
@Override public OriginalTitle scrapeOriginalTitle(){
  if (scrapingLanguage == Language.JAPANESE)   return new OriginalTitle(scrapeTitle().getTitle());
 else {
    Document originalDocument=document;
    try {
      document=Jsoup.connect(japanesePage).get();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    OriginalTitle originalTitle=new OriginalTitle(scrapeTitle().getTitle());
    document=originalDocument;
    return originalTitle;
  }
}
Program: 165519
Project: 165519
Buggy source:
@BeforeClass public static void initialize(){
  profile=new OnePondoParsingProfile(scrapeInEnglish);
  String searchString=profile.createSearchString(file);
  System.out.println(searchString);
  Document document=SpecificScraperAction.downloadDocument(searchString);
  profile.setDocument(document);
}

Fixed version (ground truth):
@BeforeClass public static void initialize(){
  profile=new OnePondoParsingProfile();
  String searchString=profile.createSearchString(file);
  System.out.println(searchString);
  Document document=SpecificScraperAction.downloadDocument(searchString);
  profile.setDocument(document);
}
Program: 165520
Project: 165520
Buggy source:
/** 
 * @param japanesePersonName - Name of the person to translate. Method works best if the name is hiragana or katakana
 * @return The name of person in Romaji
 */
public static String translateJapanesePersonNameToRomaji(String japanesePersonName){
  for (int i=0; i < japanesePersonName.length(); i++) {
    if (JapaneseCharacter.isKanji(japanesePersonName.charAt(i)))     return translateStringJapaneseToEnglish(japanesePersonName);
  }
  String romaji=WordUtils.capitalize(JapaneseCharacter.convertToRomaji(japanesePersonName)).trim();
  if (romaji != null)   return romaji;
 else   return translateStringJapaneseToEnglish(japanesePersonName);
}

Fixed version (ground truth):
/** 
 * @param japanesePersonName - Name of the person to translate. Method works best if the name is hiragana or katakana
 * @return The name of person in Romaji
 */
public static String translateJapanesePersonNameToRomaji(String japanesePersonName){
  for (int i=0; i < japanesePersonName.length(); i++) {
    if (JapaneseCharacter.isKanji(japanesePersonName.charAt(i)))     return translateStringJapaneseToEnglish(japanesePersonName);
  }
  String romaji=JapaneseCharacter.convertToRomaji(japanesePersonName);
  if (romaji != null) {
    romaji=WordUtils.capitalize(romaji).trim();
    return romaji;
  }
 else   return translateStringJapaneseToEnglish(japanesePersonName);
}
Program: 165521
Project: 165521
Buggy source:
public ProgressMonitor getProgressMonitor(){
  return progressMonitor;
}

Fixed version (ground truth):
public ProgressMonitor getProgressMonitor(){
  if (progressMonitor == null)   progressMonitor=new ProgressMonitor(frmMoviescraper);
  return progressMonitor;
}
Program: 165524
Project: 165524
Buggy source:
private void initializeProgressMonitor(String fileName){
  this.guiMain.setProgressMonitor(new ProgressMonitor(this.guiMain.getFrmMoviescraper(),"String_Node_Str" + fileName,"String_Node_Str",0,100));
  this.guiMain.getProgressMonitor().setMillisToDecideToPopup(0);
  this.guiMain.getProgressMonitor().setMillisToPopup(0);
  progress=0;
  this.guiMain.getProgressMonitor().setProgress(0);
}

Fixed version (ground truth):
private void initializeProgressMonitor(String fileName,int currentIndex,int totalItems){
  String text;
  if (totalItems == 1)   text="String_Node_Str" + fileName;
 else   text=String.format("String_Node_Str",currentIndex + 1,totalItems,fileName);
  this.guiMain.getProgressMonitor().start(text);
  progress=0;
}
Program: 165525
Project: 165525
Buggy source:
public void makeProgress(int amount,String note){
  if (this.guiMain.getProgressMonitor().isCanceled()) {
    cancelRunningThreads();
    return;
  }
  if (progress < 100) {
    if (amount + progress <= 100) {
      progress+=amount;
      this.guiMain.getProgressMonitor().setProgress(progress);
      this.guiMain.getProgressMonitor().setNote("String_Node_Str" + progress + "String_Node_Str"+ note);
    }
 else {
      progress=100;
      this.guiMain.getProgressMonitor().setNote("String_Node_Str" + progress + "String_Node_Str"+ note);
      this.guiMain.getProgressMonitor().setProgress(progress);
    }
  }
}

Fixed version (ground truth):
public void makeProgress(int amount,String note){
  if (this.guiMain.getProgressMonitor().isCanceled()) {
    cancelRunningThreads();
    return;
  }
  if (progress < 100) {
    if (amount + progress <= 100) {
      progress+=amount;
    }
 else {
      progress=100;
    }
    this.guiMain.getProgressMonitor().update(progress,note);
  }
}
Program: 165528
Project: 165528
Buggy source:
@Override public Icon getIcon(File iconType) throws IOException {
  if (iconType.isDirectory())   return FileSystemView.getFileSystemView().getSystemIcon(iconType);
  if (FilenameUtils.getExtension(iconType.getName()) != "String_Node_Str") {
    String mimeType=Files.probeContentType(iconType.toPath());
    if (mimeType != null) {
      for (      String type : new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"})       if (mimeType.startsWith(type + "String_Node_Str"))       return createIcon(type);
    }
  }
  return createIcon("String_Node_Str");
}

Fixed version (ground truth):
@Override public Icon getIcon(File iconType) throws IOException {
  if (iconType.isDirectory())   return FileSystemView.getFileSystemView().getSystemIcon(iconType);
  String name=FilenameUtils.getName(iconType.getName());
  String ext=FilenameUtils.getExtension(iconType.getName());
  if (ext != "String_Node_Str" && !name.startsWith("String_Node_Str")) {
    String mimeType=Files.probeContentType(iconType.toPath());
    if (mimeType != null) {
      for (      String type : new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"})       if (mimeType.startsWith(type + "String_Node_Str"))       return createIcon(type);
    }
  }
  return createIcon("String_Node_Str");
}
Program: 165529
Project: 165529
Buggy source:
public static Icon getIconFromCache(File iconType) throws IOException {
  String key=iconType.isDirectory() ? "String_Node_Str" : FilenameUtils.getExtension(iconType.getName());
  if (cache.containsKey(key)) {
    return cache.get(key);
  }
 else {
    Icon iconToCache=iconProvider.getIcon(iconType);
    cache.put(key,iconToCache);
    return iconToCache;
  }
}

Fixed version (ground truth):
public static Icon getIconFromCache(File iconType) throws IOException {
  String name=FilenameUtils.getName(iconType.getName());
  String ext=FilenameUtils.getExtension(iconType.getName());
  String key=iconType.isDirectory() ? "String_Node_Str" : name.startsWith("String_Node_Str") ? "String_Node_Str" : ext;
  if (cache.containsKey(key)) {
    return cache.get(key);
  }
 else {
    Icon iconToCache=iconProvider.getIcon(iconType);
    cache.put(key,iconToCache);
    return iconToCache;
  }
}
Program: 165530
Project: 165530
Buggy source:
public List<CSVRecord> readFromCSVFile(String filePath) throws IOException {
  URL url=getClass().getResource(filePath);
  File file=new File(url.getPath());
  FileReader fileReader=new FileReader(file);
  CSVFormat format=CSVFormat.RFC4180.withDelimiter(',').withCommentMarker('#');
  CSVParser parser=new CSVParser(fileReader,format);
  List<CSVRecord> csvRecords=parser.getRecords();
  parser.close();
  return csvRecords;
}

Fixed version (ground truth):
public List<CSVRecord> readFromCSVFile(String filePath) throws IOException {
  InputStream inputStream=getClass().getResourceAsStream(filePath);
  CSVFormat format=CSVFormat.RFC4180.withDelimiter(',').withCommentMarker('#');
  CSVParser parser=new CSVParser(new InputStreamReader(inputStream),format);
  List<CSVRecord> csvRecords=parser.getRecords();
  parser.close();
  return csvRecords;
}
Program: 165531
Project: 165531
Buggy source:
private ImageIcon getImageIconForLabelName(Actor currentActor){
  if (currentActor.getThumb() != null) {
    if (currentlySelectedActorsFolderList != null && currentlySelectedActorsFolderList.get(0).isDirectory()) {
      String currentActorNameAsPotentialFileName=currentActor.getName().replace(' ','_');
      File[] listFiles=currentlySelectedActorsFolderList.get(0).listFiles();
      for (      File currentFile : listFiles) {
        if (currentFile.isFile() && FilenameUtils.removeExtension(currentFile.getName()).equals(currentActorNameAsPotentialFileName)) {
          return new ImageIcon(currentFile.getPath());
        }
      }
    }
 else {
      return currentActor.getThumb().getImageIconThumbImage();
    }
  }
  return new ImageIcon();
}

Fixed version (ground truth):
private ImageIcon getImageIconForLabelName(Actor currentActor){
  if (currentActor.getThumb() != null) {
    if (currentlySelectedActorsFolderList != null && currentlySelectedActorsFolderList.size() > 0 && currentlySelectedActorsFolderList.get(0).isDirectory()) {
      String currentActorNameAsPotentialFileName=currentActor.getName().replace(' ','_');
      File[] listFiles=currentlySelectedActorsFolderList.get(0).listFiles();
      for (      File currentFile : listFiles) {
        if (currentFile.isFile() && FilenameUtils.removeExtension(currentFile.getName()).equals(currentActorNameAsPotentialFileName)) {
          return new ImageIcon(currentFile.getPath());
        }
      }
    }
 else {
      return currentActor.getThumb().getImageIconThumbImage();
    }
  }
  return new ImageIcon();
}
Program: 165535
Project: 165535
Buggy source:
public static Image getImageFromCache(URL url) throws IOException {
  if (cache.containsKey(url)) {
    return cache.get(url);
  }
 else {
    Image imageFromUrl=ImageIO.read(url);
    cache.put(url,imageFromUrl);
    return imageFromUrl;
  }
}

Fixed version (ground truth):
public static Image getImageFromCache(URL url) throws IOException {
  if (cache.containsKey(url)) {
    return cache.get(url);
  }
 else {
    Image imageFromUrl=ImageIO.read(url);
    if (imageFromUrl != null) {
      cache.put(url,imageFromUrl);
      return imageFromUrl;
    }
 else {
      Image blankImage=new BufferedImage(0,0,BufferedImage.TYPE_INT_RGB);
      cache.put(url,blankImage);
      return blankImage;
    }
  }
}
Program: 165538
Project: 165538
Buggy source:
public static String findIDTagFromFile(File file){
  String fileNameNoExtension;
  if (file.isFile())   fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
 else   fileNameNoExtension=file.getName();
  String fileNameNoExtensionNoDiscNumber=stripDiscNumber(fileNameNoExtension);
  String[] splitFileName=fileNameNoExtensionNoDiscNumber.split("String_Node_Str");
  String lastWord=splitFileName[0];
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  return lastWord;
}

Fixed version (ground truth):
public static String findIDTagFromFile(File file){
  String fileNameNoExtension;
  if (file.isFile())   fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
 else   fileNameNoExtension=file.getName();
  String fileNameNoExtensionNoDiscNumber=stripDiscNumber(fileNameNoExtension);
  String[] splitFileName=fileNameNoExtensionNoDiscNumber.split("String_Node_Str");
  String lastWord=splitFileName[splitFileName.length - 1];
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  return lastWord;
}
Program: 165539
Project: 165539
Buggy source:
private void updateFileListModel(File currentlySelectedDirectory,boolean keepSelectionsAndReferences){
  File[] filesToList=showFileListSorted(currentlySelectedDirectory);
  List<File> selectValuesListBeforeUpdate=fileList.getSelectedValuesList();
  listModelFiles.removeAllElements();
  for (  File file : filesToList) {
    listModelFiles.addElement(file);
  }
  if (!keepSelectionsAndReferences) {
    removeOldScrapedMovieReferences();
    removeOldSelectedFileReferences();
  }
  ListSelectionListener[] fileListSelectionListener=null;
  if (keepSelectionsAndReferences) {
    fileListSelectionListener=fileList.getListSelectionListeners();
    fileList.removeListSelectionListener(fileList.getListSelectionListeners()[0]);
    ;
  }
  for (  File currentValueToSelect : selectValuesListBeforeUpdate) {
    fileList.setSelectedValue(currentValueToSelect,false);
  }
  if (keepSelectionsAndReferences && fileListSelectionListener != null) {
    fileList.addListSelectionListener(fileListSelectionListener[0]);
  }
}

Fixed version (ground truth):
private void updateFileListModel(File currentlySelectedDirectory,boolean keepSelectionsAndReferences){
  File[] filesToList=showFileListSorted(currentlySelectedDirectory);
  List<File> selectValuesListBeforeUpdate=fileList.getSelectedValuesList();
  ListSelectionListener[] fileListSelectionListener=null;
  if (keepSelectionsAndReferences) {
    fileListSelectionListener=fileList.getListSelectionListeners();
    fileList.removeListSelectionListener(fileList.getListSelectionListeners()[0]);
    ;
  }
  listModelFiles.removeAllElements();
  for (  File file : filesToList) {
    listModelFiles.addElement(file);
  }
  if (!keepSelectionsAndReferences) {
    removeOldScrapedMovieReferences();
    removeOldSelectedFileReferences();
  }
  for (  File currentValueToSelect : selectValuesListBeforeUpdate) {
    fileList.setSelectedValue(currentValueToSelect,false);
  }
  if (keepSelectionsAndReferences && fileListSelectionListener != null) {
    fileList.addListSelectionListener(fileListSelectionListener[0]);
  }
}
Program: 165540
Project: 165540
Buggy source:
private void writeExtraFanart(File destinationDirectory,int movieNumberInList) throws IOException {
  updateExtraFanartFolder(destinationDirectory);
  System.out.println("String_Node_Str" + movieToWriteToDiskList.get(movieNumberInList).getExtraFanart().length);
  if (movieToWriteToDiskList != null && movieToWriteToDiskList.size() > 0 && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart() != null && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart().length > 0) {
    FileUtils.forceMkdir(currentlySelectedExtraFanartFolderList.get(movieNumberInList));
    int currentExtraFanartNumber=1;
    for (    Thumb currentExtraFanart : movieToWriteToDiskList.get(movieNumberInList).getExtraFanart()) {
      File fileNameToWrite=new File(currentlySelectedExtraFanartFolderList.get(movieNumberInList).getPath() + "String_Node_Str" + "String_Node_Str"+ currentExtraFanartNumber+ "String_Node_Str");
      if (!fileNameToWrite.exists()) {
        System.out.println("String_Node_Str" + fileNameToWrite);
        currentExtraFanart.writeImageToFile(fileNameToWrite);
      }
      currentExtraFanartNumber++;
    }
  }
}

Fixed version (ground truth):
private void writeExtraFanart(File destinationDirectory,int movieNumberInList) throws IOException {
  updateExtraFanartFolder(destinationDirectory);
  if (movieToWriteToDiskList != null && movieToWriteToDiskList.size() > 0 && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart() != null && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart().length > 0) {
    FileUtils.forceMkdir(currentlySelectedExtraFanartFolderList.get(movieNumberInList));
    int currentExtraFanartNumber=1;
    for (    Thumb currentExtraFanart : movieToWriteToDiskList.get(movieNumberInList).getExtraFanart()) {
      File fileNameToWrite=new File(currentlySelectedExtraFanartFolderList.get(movieNumberInList).getPath() + "String_Node_Str" + "String_Node_Str"+ currentExtraFanartNumber+ "String_Node_Str");
      if (!fileNameToWrite.exists()) {
        System.out.println("String_Node_Str" + fileNameToWrite);
        currentExtraFanart.writeImageToFile(fileNameToWrite);
      }
      currentExtraFanartNumber++;
    }
  }
}
Program: 165541
Project: 165541
Buggy source:
public File[] actorFolderFiles(int movieNumberInList){
  ArrayList<File> actorFiles=new ArrayList<File>();
  if (movieToWriteToDiskList != null && movieToWriteToDiskList.size() > 0 && movieToWriteToDiskList.get(movieNumberInList).getActors() != null) {
    if (currentlySelectedActorsFolderList != null && currentlySelectedActorsFolderList.get(movieNumberInList).isDirectory()) {
      for (      Actor currentActor : movieToWriteToDiskList.get(movieNumberInList).getActors()) {
        String currentActorNameAsPotentialFileName=currentActor.getName().replace(' ','_');
        File[] listFiles=currentlySelectedActorsFolderList.get(movieNumberInList).listFiles();
        for (        File currentFile : listFiles) {
          if (currentFile.isFile() && FilenameUtils.removeExtension(currentFile.getName()).equals(currentActorNameAsPotentialFileName)) {
            actorFiles.add(currentFile);
          }
        }
      }
    }
  }
  return actorFiles.toArray(new File[actorFiles.size()]);
}

Fixed version (ground truth):
public File[] actorFolderFiles(int movieNumberInList){
  ArrayList<File> actorFiles=new ArrayList<File>();
  System.out.println("String_Node_Str" + movieToWriteToDiskList);
  if (movieToWriteToDiskList != null && movieToWriteToDiskList.size() > 0 && movieToWriteToDiskList.get(movieNumberInList).getActors() != null) {
    if (currentlySelectedActorsFolderList != null && currentlySelectedActorsFolderList.get(movieNumberInList).isDirectory()) {
      for (      Actor currentActor : movieToWriteToDiskList.get(movieNumberInList).getActors()) {
        String currentActorNameAsPotentialFileName=currentActor.getName().replace(' ','_');
        File[] listFiles=currentlySelectedActorsFolderList.get(movieNumberInList).listFiles();
        for (        File currentFile : listFiles) {
          if (currentFile.isFile() && FilenameUtils.removeExtension(currentFile.getName()).equals(currentActorNameAsPotentialFileName)) {
            actorFiles.add(currentFile);
          }
        }
      }
    }
  }
  return actorFiles.toArray(new File[actorFiles.size()]);
}
Program: 165543
Project: 165543
Buggy source:
public Component getListCellRendererComponent(JList<? extends SearchResult> list,SearchResult value,int index,boolean isSelected,boolean cellHasFocus){
  SearchResult entry=(SearchResult)value;
  if (entry.getLabel().length() > 0)   setText("String_Node_Str" + "String_Node_Str" + entry.getLabel() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ entry.getUrlPath()+ "String_Node_Str"+ "String_Node_Str");
 else   setText(entry.getUrlPath());
  if (entry.getPreviewImage().getThumbURL() != null)   setIcon(entry.getPreviewImage().getImageIconThumbImage());
  if (isSelected) {
    setBackground(HIGHLIGHT_COLOR);
    setForeground(Color.white);
  }
 else {
    setBackground(Color.white);
    setForeground(Color.black);
  }
  return this;
}

Fixed version (ground truth):
public Component getListCellRendererComponent(JList<? extends SearchResult> list,SearchResult value,int index,boolean isSelected,boolean cellHasFocus){
  SearchResult entry=(SearchResult)value;
  if (entry.getLabel().length() > 0)   setText("String_Node_Str" + "String_Node_Str" + entry.getLabel() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ entry.getUrlPath()+ "String_Node_Str"+ "String_Node_Str");
 else   setText(entry.getUrlPath());
  if (entry.getPreviewImage() != null && entry.getPreviewImage().getThumbURL() != null)   setIcon(entry.getPreviewImage().getImageIconThumbImage());
  if (isSelected) {
    setBackground(HIGHLIGHT_COLOR);
    setForeground(Color.white);
  }
 else {
    setBackground(Color.white);
    setForeground(Color.black);
  }
  return this;
}
Program: 165544
Project: 165544
Buggy source:
@Override public void mousePressed(MouseEvent e){
  if (e.getClickCount() >= 2) {
    @SuppressWarnings("String_Node_Str") JList<File> theList=(JList<File>)e.getSource();
    try {
      File doubleClickedFile=theList.getSelectedValue();
      if (doubleClickedFile != null && doubleClickedFile.exists() && doubleClickedFile.isDirectory()) {
        try {
          currentlySelectedDirectoryList=doubleClickedFile;
          frmMoviescraper.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
          updateFileListModel(currentlySelectedDirectoryList);
        }
  finally {
          preferences.setLastUsedDirectory(currentlySelectedDirectoryList);
          frmMoviescraper.setCursor(Cursor.getDefaultCursor());
        }
      }
 else {
        Desktop.getDesktop().open(theList.getSelectedValue());
      }
    }
 catch (    IOException e1) {
      e1.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void mousePressed(MouseEvent e){
  if (e.getClickCount() >= 2) {
    @SuppressWarnings("String_Node_Str") JList<File> theList=(JList<File>)e.getSource();
    try {
      File doubleClickedFile=theList.getSelectedValue();
      if (doubleClickedFile != null && doubleClickedFile.exists() && doubleClickedFile.isDirectory()) {
        try {
          currentlySelectedDirectoryList=doubleClickedFile;
          frmMoviescraper.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
          updateFileListModel(currentlySelectedDirectoryList,false);
        }
  finally {
          preferences.setLastUsedDirectory(currentlySelectedDirectoryList);
          frmMoviescraper.setCursor(Cursor.getDefaultCursor());
        }
      }
 else {
        Desktop.getDesktop().open(theList.getSelectedValue());
      }
    }
 catch (    IOException e1) {
      e1.printStackTrace();
    }
  }
}
Program: 165545
Project: 165545
Buggy source:
private void updateFileListModel(File currentlySelectedDirectory){
  File[] filesToList=showFileListSorted(currentlySelectedDirectory);
  List<File> selectValuesListBeforeUpdate=fileList.getSelectedValuesList();
  listModelFiles.removeAllElements();
  for (  File file : filesToList) {
    listModelFiles.addElement(file);
  }
  removeOldScrapedMovieReferences();
  removeOldSelectedFileReferences();
  for (  File currentValueToSelect : selectValuesListBeforeUpdate) {
    fileList.setSelectedValue(currentValueToSelect,false);
  }
}

Fixed version (ground truth):
private void updateFileListModel(File currentlySelectedDirectory,boolean keepSelectionsAndReferences){
  File[] filesToList=showFileListSorted(currentlySelectedDirectory);
  List<File> selectValuesListBeforeUpdate=fileList.getSelectedValuesList();
  listModelFiles.removeAllElements();
  for (  File file : filesToList) {
    listModelFiles.addElement(file);
  }
  if (!keepSelectionsAndReferences) {
    removeOldScrapedMovieReferences();
    removeOldSelectedFileReferences();
  }
  ListSelectionListener[] fileListSelectionListener=null;
  if (keepSelectionsAndReferences) {
    fileListSelectionListener=fileList.getListSelectionListeners();
    fileList.removeListSelectionListener(fileList.getListSelectionListeners()[0]);
    ;
  }
  for (  File currentValueToSelect : selectValuesListBeforeUpdate) {
    fileList.setSelectedValue(currentValueToSelect,false);
  }
  if (keepSelectionsAndReferences && fileListSelectionListener != null) {
    fileList.addListSelectionListener(fileListSelectionListener[0]);
  }
}
Program: 165547
Project: 165547
Buggy source:
private void writeExtraFanart(File destinationDirectory,int movieNumberInList) throws IOException {
  updateExtraFanartFolder(destinationDirectory);
  if (movieToWriteToDiskList != null && movieToWriteToDiskList.size() > 0 && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart() != null && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart().length > 0) {
    FileUtils.forceMkdir(currentlySelectedExtraFanartFolderList.get(movieNumberInList));
    int currentExtraFanartNumber=1;
    for (    Thumb currentExtraFanart : movieToWriteToDiskList.get(movieNumberInList).getExtraFanart()) {
      File fileNameToWrite=new File(currentlySelectedExtraFanartFolderList.get(movieNumberInList).getPath() + "String_Node_Str" + "String_Node_Str"+ currentExtraFanartNumber+ "String_Node_Str");
      if (!fileNameToWrite.exists()) {
        System.out.println("String_Node_Str" + fileNameToWrite);
        currentExtraFanart.writeImageToFile(fileNameToWrite);
      }
      currentExtraFanartNumber++;
    }
  }
}

Fixed version (ground truth):
private void writeExtraFanart(File destinationDirectory,int movieNumberInList) throws IOException {
  updateExtraFanartFolder(destinationDirectory);
  System.out.println("String_Node_Str" + movieToWriteToDiskList.get(movieNumberInList).getExtraFanart().length);
  if (movieToWriteToDiskList != null && movieToWriteToDiskList.size() > 0 && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart() != null && movieToWriteToDiskList.get(movieNumberInList).getExtraFanart().length > 0) {
    FileUtils.forceMkdir(currentlySelectedExtraFanartFolderList.get(movieNumberInList));
    int currentExtraFanartNumber=1;
    for (    Thumb currentExtraFanart : movieToWriteToDiskList.get(movieNumberInList).getExtraFanart()) {
      File fileNameToWrite=new File(currentlySelectedExtraFanartFolderList.get(movieNumberInList).getPath() + "String_Node_Str" + "String_Node_Str"+ currentExtraFanartNumber+ "String_Node_Str");
      if (!fileNameToWrite.exists()) {
        System.out.println("String_Node_Str" + fileNameToWrite);
        currentExtraFanart.writeImageToFile(fileNameToWrite);
      }
      currentExtraFanartNumber++;
    }
  }
}
Program: 165548
Project: 165548
Buggy source:
@Override public void actionPerformed(ActionEvent arg0){
  try {
    File parentDirectory=currentlySelectedDirectoryList.getParentFile();
    if (parentDirectory != null && parentDirectory.exists()) {
      currentlySelectedDirectoryList=parentDirectory;
      frmMoviescraper.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      updateFileListModel(currentlySelectedDirectoryList);
    }
  }
  finally {
    preferences.setLastUsedDirectory(currentlySelectedDirectoryList);
    frmMoviescraper.setCursor(Cursor.getDefaultCursor());
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent arg0){
  try {
    File parentDirectory=currentlySelectedDirectoryList.getParentFile();
    if (parentDirectory != null && parentDirectory.exists()) {
      currentlySelectedDirectoryList=parentDirectory;
      frmMoviescraper.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      updateFileListModel(currentlySelectedDirectoryList,false);
    }
  }
  finally {
    preferences.setLastUsedDirectory(currentlySelectedDirectoryList);
    frmMoviescraper.setCursor(Cursor.getDefaultCursor());
  }
}
Program: 165551
Project: 165551
Buggy source:
@Override public String createSearchString(File file){
  String fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
  fileNameNoExtension=findIDTagFromFile(file);
  return fileNameNoExtension;
}

Fixed version (ground truth):
@Override public String createSearchString(File file){
  String fileNameNoExtension=findIDTagFromFile(file);
  return fileNameNoExtension;
}
Program: 165552
Project: 165552
Buggy source:
@Override public ArrayList<Actor> scrapeActors(){
  Elements actorElements=document.select("String_Node_Str");
  ArrayList<Actor> actorList=new ArrayList<Actor>(actorElements.size());
  try {
    for (    Element actorElement : actorElements) {
      String currentActorName=actorElement.select("String_Node_Str").first().text();
      String currentActorDetailFileNameURL=actorElement.select("String_Node_Str").attr("String_Node_Str");
      currentActorDetailFileNameURL=currentActorDetailFileNameURL.substring(currentActorDetailFileNameURL.indexOf('=') + 1);
      currentActorDetailFileNameURL="String_Node_Str" + currentActorDetailFileNameURL + "String_Node_Str";
      Actor currentActor=new Actor(currentActorName,"String_Node_Str",new Thumb(currentActorDetailFileNameURL));
      actorList.add(currentActor);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return actorList;
}

Fixed version (ground truth):
@Override public ArrayList<Actor> scrapeActors(){
  Elements actorElements=document.select("String_Node_Str");
  if (actorElements != null) {
    ArrayList<Actor> actorList=new ArrayList<Actor>(actorElements.size());
    try {
      for (      Element actorElement : actorElements) {
        String currentActorName=actorElement.select("String_Node_Str").first().text();
        String currentActorDetailFileNameURL=actorElement.select("String_Node_Str").attr("String_Node_Str");
        currentActorDetailFileNameURL=currentActorDetailFileNameURL.substring(currentActorDetailFileNameURL.indexOf('=') + 1);
        currentActorDetailFileNameURL="String_Node_Str" + currentActorDetailFileNameURL + "String_Node_Str";
        Actor currentActor=new Actor(currentActorName,"String_Node_Str",new Thumb(currentActorDetailFileNameURL));
        actorList.add(currentActor);
      }
      return actorList;
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  return new ArrayList<Actor>();
}
Program: 165553
Project: 165553
Buggy source:
@Override public String createSearchString(File file){
  String fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
  fileNameNoExtension=findIDTagFromFile(file);
  URLCodec codec=new URLCodec();
  try {
    String fileNameURLEncoded=codec.encode(fileNameNoExtension);
    return "String_Node_Str" + fileNameURLEncoded + "String_Node_Str";
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public String createSearchString(File file){
  String fileNameNoExtension=findIDTagFromFile(file);
  URLCodec codec=new URLCodec();
  try {
    String fileNameURLEncoded=codec.encode(fileNameNoExtension);
    return "String_Node_Str" + fileNameURLEncoded + "String_Node_Str";
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 165554
Project: 165554
Buggy source:
@Override public String createSearchString(File file){
  String fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
  fileNameNoExtension=findIDTagFromFile(file);
  URLCodec codec=new URLCodec();
  try {
    String fileNameURLEncoded=codec.encode(fileNameNoExtension);
    String searchTerm="String_Node_Str" + siteLanguageToScrape + "String_Node_Str"+ fileNameURLEncoded;
    return searchTerm;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public String createSearchString(File file){
  String fileNameNoExtension=findIDTagFromFile(file);
  URLCodec codec=new URLCodec();
  try {
    String fileNameURLEncoded=codec.encode(fileNameNoExtension);
    String searchTerm="String_Node_Str" + siteLanguageToScrape + "String_Node_Str"+ fileNameURLEncoded;
    return searchTerm;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 165555
Project: 165555
Buggy source:
@Override public String createSearchString(File file){
  String fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
  fileNameNoExtension=findIDTagFromFile(file);
  URLCodec codec=new URLCodec();
  try {
    String fileNameURLEncoded=codec.encode(fileNameNoExtension);
    String searchTerm="String_Node_Str" + siteLanguageToScrape + "String_Node_Str"+ fileNameURLEncoded;
    return searchTerm;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
@Override public String createSearchString(File file){
  String fileNameNoExtension=findIDTagFromFile(file);
  URLCodec codec=new URLCodec();
  try {
    String fileNameURLEncoded=codec.encode(fileNameNoExtension);
    String searchTerm="String_Node_Str" + siteLanguageToScrape + "String_Node_Str"+ fileNameURLEncoded;
    return searchTerm;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 165556
Project: 165556
Buggy source:
public static String findIDTagFromFile(File file){
  String fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
  String fileNameNoExtensionNoDiscNumber=stripDiscNumber(fileNameNoExtension);
  String[] splitFileName=fileNameNoExtensionNoDiscNumber.split("String_Node_Str");
  String lastWord=splitFileName[splitFileName.length - 1];
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  return lastWord;
}

Fixed version (ground truth):
public static String findIDTagFromFile(File file){
  String fileNameNoExtension;
  if (file.isFile())   fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
 else   fileNameNoExtension=file.getName();
  String fileNameNoExtensionNoDiscNumber=stripDiscNumber(fileNameNoExtension);
  String[] splitFileName=fileNameNoExtensionNoDiscNumber.split("String_Node_Str");
  String lastWord=splitFileName[splitFileName.length - 1];
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  lastWord=lastWord.replace("String_Node_Str","String_Node_Str");
  return lastWord;
}
Program: 165557
Project: 165557
Buggy source:
@Override public String createSearchString(File file){
  String fileNameNoExtension=FilenameUtils.removeExtension(file.getName());
  fileNameNoExtension=findIDTagFromFile(file);
  return fileNameNoExtension;
}

Fixed version (ground truth):
@Override public String createSearchString(File file){
  String fileNameNoExtension=findIDTagFromFile(file);
  return fileNameNoExtension;
}
Program: 165558
Project: 165558
Buggy source:
public final static String sanitizeString(String inputString){
  return inputString.replace("String_Node_Str","String_Node_Str").trim();
}

Fixed version (ground truth):
public final static String sanitizeString(String inputString){
  if (inputString != null)   return inputString.replace("String_Node_Str","String_Node_Str").trim();
 else   return null;
}