nus-yam/ex-repair huggingface dataset:
Program: 168175
Project: 168175
Buggy source:
private void writeToFile(String senatorOutputDir,String fileName,String[] contents) throws IOException {
  ConsoleView.printlInConsoleln("String_Node_Str" + senatorOutputDir + File.separator+ fileName);
  BufferedWriter bw=new BufferedWriter(new FileWriter(new File(senatorOutputDir + System.getProperty("String_Node_Str") + fileName)));
  bw.write(contents[0]);
  bw.newLine();
  bw.newLine();
  bw.write(contents[1]);
  bw.close();
  totalFilesDownloaded++;
}

Fixed version (ground truth):
private void writeToFile(String senatorOutputDir,String fileName,String[] contents) throws IOException {
  fileName=fileName.replaceAll("String_Node_Str","String_Node_Str");
  ConsoleView.printlInConsoleln("String_Node_Str" + senatorOutputDir + File.separator+ fileName);
  BufferedWriter bw=new BufferedWriter(new FileWriter(new File(senatorOutputDir + System.getProperty("String_Node_Str") + fileName)));
  bw.write(contents[0]);
  bw.newLine();
  bw.newLine();
  bw.write(contents[1]);
  bw.close();
  totalFilesDownloaded++;
}
Program: 168193
Project: 168193
Buggy source:
private boolean canProceedCluster(){
  NlputilsFormComposite.updateStatusMessage(getViewSite(),null,null);
  boolean canProceed=true;
  form.getMessageManager().removeMessage("String_Node_Str");
  form.getMessageManager().removeMessage("String_Node_Str");
  form.getMessageManager().removeMessage("String_Node_Str");
  form.getMessageManager().removeMessage("String_Node_Str");
  String message=OutputPathValidation.getInstance().validateOutputDirectory(layoutData.getOutputLabel().getText(),"String_Node_Str");
  if (message != null) {
    message=layoutData.getOutputLabel().getText() + "String_Node_Str" + message;
    form.getMessageManager().addMessage("String_Node_Str",message,null,IMessageProvider.ERROR);
    canProceed=false;
  }
  String inputMessage=OutputPathValidation.getInstance().validateOutputDirectory(inputLayoutData.getOutputLabel().getText(),"String_Node_Str");
  if (inputMessage != null) {
    inputMessage=layoutData.getOutputLabel().getText() + "String_Node_Str" + inputMessage;
    form.getMessageManager().addMessage("String_Node_Str",inputMessage,null,IMessageProvider.ERROR);
    canProceed=false;
  }
  if (prefixTxt.getText().length() < 1) {
    form.getMessageManager().addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR);
    canProceed=false;
  }
  if (Integer.parseInt(numberOfTopics.getText()) < 1) {
    form.getMessageManager().addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR);
    canProceed=false;
  }
  return canProceed;
}

Fixed version (ground truth):
private boolean canProceedCluster(){
  NlputilsFormComposite.updateStatusMessage(getViewSite(),null,null);
  boolean canProceed=true;
  form.getMessageManager().removeMessage("String_Node_Str");
  form.getMessageManager().removeMessage("String_Node_Str");
  form.getMessageManager().removeMessage("String_Node_Str");
  form.getMessageManager().removeMessage("String_Node_Str");
  String message=OutputPathValidation.getInstance().validateOutputDirectory(layoutData.getOutputLabel().getText(),"String_Node_Str");
  if (message != null) {
    message=layoutData.getOutputLabel().getText() + "String_Node_Str" + message;
    form.getMessageManager().addMessage("String_Node_Str",message,null,IMessageProvider.ERROR);
    canProceed=false;
  }
  String inputMessage=OutputPathValidation.getInstance().validateOutputDirectory(inputLayoutData.getOutputLabel().getText(),"String_Node_Str");
  if (inputMessage != null) {
    inputMessage=inputLayoutData.getOutputLabel().getText() + "String_Node_Str" + inputMessage;
    form.getMessageManager().addMessage("String_Node_Str",inputMessage,null,IMessageProvider.ERROR);
    canProceed=false;
  }
  if (prefixTxt.getText().length() < 1) {
    form.getMessageManager().addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR);
    canProceed=false;
  }
  if (Integer.parseInt(numberOfTopics.getText()) < 1) {
    form.getMessageManager().addMessage("String_Node_Str","String_Node_Str",null,IMessageProvider.ERROR);
    canProceed=false;
  }
  return canProceed;
}
Program: 168195
Project: 168195
Buggy source:
protected boolean updateLocationTree(String path){
  if (this.locationPaths == null) {
    this.locationPaths=new ArrayList<TreeParent>();
  }
  if (!path.equals("String_Node_Str")) {
    if (this.locationPaths.contains(path)) {
      return false;
    }
    TreeParent node=new TreeParent(path);
    if (new File(path).isDirectory()) {
      processSubFiles(node);
    }
    this.locationPaths.add(node);
    this.fTreeViewer.refresh();
    this.fTreeViewer.setChecked(node,true);
    fTreeViewer.setSubtreeChecked(node,true);
  }
  return true;
}

Fixed version (ground truth):
protected boolean updateLocationTree(String[] path){
  if (this.locationPaths == null) {
    this.locationPaths=new ArrayList<TreeParent>();
  }
  if (!path.equals("String_Node_Str")) {
    if (checkExistensence(path)) {
      return false;
    }
    for (    String file : path) {
      TreeParent node=new TreeParent(file);
      if (new File(file).isDirectory()) {
        processSubFiles(node);
      }
      this.locationPaths.add(node);
      this.fTreeViewer.refresh();
      this.fTreeViewer.setChecked(node,true);
      fTreeViewer.setSubtreeChecked(node,true);
    }
  }
  return true;
}
Program: 168196
Project: 168196
Buggy source:
/** 
 * Sets up the tree viewer using the given tree
 * @param tree
 */
private void initializeTreeViewer(Composite tree){
  fTreeViewer=new CheckboxTreeViewer(tree,SWT.NONE);
  fTreeViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  fTreeViewer.setContentProvider(new TargetLocationContentProvider());
  fTreeViewer.setLabelProvider(new TargetLocationLabelProvider());
  if (this.locationPaths == null) {
    this.locationPaths=new ArrayList<TreeParent>();
  }
  this.fTreeViewer.setInput(this.locationPaths);
  fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      updateButtons();
    }
  }
);
  fTreeViewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      if (!event.getSelection().isEmpty()) {
        handleEdit();
      }
    }
  }
);
  fTreeViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      fTreeViewer.setSubtreeChecked(event.getElement(),event.getChecked());
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Sets up the tree viewer using the given tree
 * @param tree
 */
private void initializeTreeViewer(Composite tree){
  fTreeViewer=new CheckboxTreeViewer(tree,SWT.NONE | SWT.MULTI);
  fTreeViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
  fTreeViewer.setContentProvider(new TargetLocationContentProvider());
  fTreeViewer.setLabelProvider(new TargetLocationLabelProvider());
  if (this.locationPaths == null) {
    this.locationPaths=new ArrayList<TreeParent>();
  }
  this.fTreeViewer.setInput(this.locationPaths);
  fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      updateButtons();
    }
  }
);
  fTreeViewer.addDoubleClickListener(new IDoubleClickListener(){
    public void doubleClick(    DoubleClickEvent event){
      if (!event.getSelection().isEmpty()) {
        handleEdit();
      }
    }
  }
);
  fTreeViewer.addCheckStateListener(new ICheckStateListener(){
    public void checkStateChanged(    CheckStateChangedEvent event){
      fTreeViewer.setSubtreeChecked(event.getElement(),event.getChecked());
    }
  }
);
}
Program: 168198
Project: 168198
Buggy source:
public CrawlerJob(String filter,String outputDir,String crawlUrl,String url,IProgressMonitor monitor){
  this.filter=filter;
  this.outputDir=outputDir;
  this.truncate=false;
  this.downloadAudio=false;
  this.baseUrl=crawlUrl;
  this.url=url;
  this.monitor=monitor;
}

Fixed version (ground truth):
public CrawlerJob(String filter,String outputDir,String crawlUrl,String url,IProgressMonitor monitor,boolean downloadAudio,boolean truncate){
  this.filter=filter;
  this.outputDir=outputDir;
  this.truncate=truncate;
  this.downloadAudio=downloadAudio;
  this.baseUrl=crawlUrl;
  this.url=url;
  this.monitor=monitor;
}
Program: 168199
Project: 168199
Buggy source:
public void looper(IProgressMonitor monitor) throws IOException {
  int noOfPages=0;
  Document doc=Jsoup.connect(url).timeout(10 * 1000).get();
  Elements pages=doc.getElementsByClass("String_Node_Str");
  if (!pages.isEmpty()) {
    Element pageList=pages.get(0);
    Pattern pattern=Pattern.compile("String_Node_Str");
    Matcher matcher=pattern.matcher(pageList.toString());
    if (matcher.find()) {
      noOfPages=Integer.parseInt(matcher.group(1));
    }
  }
  monitor.beginTask("String_Node_Str",noOfPages);
  if (monitor.isCanceled()) {
    throw new OperationCanceledException();
  }
  for (int i=0; i <= noOfPages; i++) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    monitor.subTask("String_Node_Str" + url);
    new CrawlerJob(this.filter,getOutputDir(),this.baseUrl,url + "String_Node_Str" + i,monitor).run();
    monitor.worked(1);
  }
}

Fixed version (ground truth):
public void looper(IProgressMonitor monitor) throws IOException {
  int noOfPages=0;
  Document doc=Jsoup.connect(url).timeout(10 * 1000).get();
  Elements pages=doc.getElementsByClass("String_Node_Str");
  if (!pages.isEmpty()) {
    Element pageList=pages.get(0);
    Pattern pattern=Pattern.compile("String_Node_Str");
    Matcher matcher=pattern.matcher(pageList.toString());
    if (matcher.find()) {
      noOfPages=Integer.parseInt(matcher.group(1));
    }
  }
  monitor.beginTask("String_Node_Str",noOfPages);
  if (monitor.isCanceled()) {
    throw new OperationCanceledException();
  }
  for (int i=0; i <= noOfPages; i++) {
    if (monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    monitor.subTask("String_Node_Str" + url);
    new CrawlerJob(this.filter,getOutputDir(),this.baseUrl,url + "String_Node_Str" + i,monitor,isDownloadAudio(),isTruncate()).run();
    monitor.worked(1);
  }
}
Program: 168204
Project: 168204
Buggy source:
private void validateTextbox(Text textBox,String label){
  if (textBox.getText().isEmpty()) {
    form.getMessageManager().removeMessage(label);
    return;
  }
  File tempFile=new File(textBox.getText());
  if (!tempFile.exists() || !tempFile.isDirectory()) {
    form.getMessageManager().addMessage(label,label + "String_Node_Str",null,IMessageProvider.ERROR);
  }
 else {
    form.getMessageManager().removeMessage(label);
  }
}

Fixed version (ground truth):
/** 
 * To validate the given text box
 * @param textBox
 * @param label
 */
private void validateTextbox(Text textBox,String label){
  if (textBox.getText().isEmpty()) {
    form.getMessageManager().removeMessage(label);
    return;
  }
  File tempFile=new File(textBox.getText());
  if (!tempFile.exists() || !tempFile.isDirectory()) {
    form.getMessageManager().addMessage(label,label + "String_Node_Str",null,IMessageProvider.ERROR);
  }
 else {
    form.getMessageManager().removeMessage(label);
  }
}
Program: 168205
Project: 168205
Buggy source:
private boolean isDirectoryValid(String path){
  if (path.isEmpty())   return false;
  File tempFile=new File(path);
  if (!tempFile.exists() || !tempFile.isDirectory())   return false;
 else   return true;
}

Fixed version (ground truth):
/** 
 * To check whether the given path is a valid directory
 * @param path
 * @return
 */
private boolean isDirectoryValid(String path){
  if (path.isEmpty())   return false;
  File tempFile=new File(path);
  if (!tempFile.exists() || !tempFile.isDirectory())   return false;
 else   return true;
}
Program: 168209
Project: 168209
Buggy source:
/** 
 * @param client
 */
private void createPreprocessLink(Composite client){
  Composite clientLink=toolkit.createComposite(client);
  GridLayoutFactory.fillDefaults().equalWidth(false).numColumns(2).applyTo(clientLink);
  GridDataFactory.fillDefaults().grab(false,false).span(1,1).applyTo(clientLink);
  preprocessEnabled=toolkit.createButton(clientLink,"String_Node_Str",SWT.CHECK);
  GridDataFactory.fillDefaults().grab(false,false).span(1,1).applyTo(preprocessEnabled);
  final Hyperlink link=toolkit.createHyperlink(clientLink,"String_Node_Str",SWT.NONE);
  link.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
  link.addHyperlinkListener(new IHyperlinkListener(){
    public void linkEntered(    HyperlinkEvent e){
    }
    public void linkExited(    HyperlinkEvent e){
    }
    public void linkActivated(    HyperlinkEvent e){
      String id="String_Node_Str";
      PreferencesUtil.createPreferenceDialogOn(link.getShell(),id,new String[]{id},null).open();
    }
  }
);
  GridDataFactory.fillDefaults().grab(true,false).span(1,1).applyTo(link);
}

Fixed version (ground truth):
/** 
 * To create hyperlink
 * @param client
 */
private void createPreprocessLink(Composite client){
  Composite clientLink=toolkit.createComposite(client);
  GridLayoutFactory.fillDefaults().equalWidth(false).numColumns(2).applyTo(clientLink);
  GridDataFactory.fillDefaults().grab(false,false).span(1,1).applyTo(clientLink);
  preprocessEnabled=toolkit.createButton(clientLink,"String_Node_Str",SWT.CHECK);
  GridDataFactory.fillDefaults().grab(false,false).span(1,1).applyTo(preprocessEnabled);
  final Hyperlink link=toolkit.createHyperlink(clientLink,"String_Node_Str",SWT.NONE);
  link.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
  link.addHyperlinkListener(new IHyperlinkListener(){
    public void linkEntered(    HyperlinkEvent e){
    }
    public void linkExited(    HyperlinkEvent e){
    }
    public void linkActivated(    HyperlinkEvent e){
      String id="String_Node_Str";
      PreferencesUtil.createPreferenceDialogOn(link.getShell(),id,new String[]{id},null).open();
    }
  }
);
  GridDataFactory.fillDefaults().grab(true,false).span(1,1).applyTo(link);
}
Program: 168213
Project: 168213
Buggy source:
@Override public void createPartControl(Composite parent){
  classPathCount=0;
  toolkit=createFormBodySection(parent,"String_Node_Str");
  Section section=toolkit.createSection(form.getBody(),Section.TITLE_BAR | Section.EXPANDED);
  GridDataFactory.fillDefaults().grab(true,false).span(3,1).applyTo(section);
  section.setExpanded(true);
  ScrolledComposite sc=new ScrolledComposite(section,SWT.H_SCROLL | SWT.V_SCROLL);
  sc.setExpandHorizontal(true);
  sc.setExpandVertical(true);
  GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).applyTo(sc);
  NlputilsFormComposite.createEmptyRow(toolkit,sc);
  Composite client=toolkit.createComposite(form.getBody());
  GridLayoutFactory.fillDefaults().equalWidth(true).numColumns(1).applyTo(client);
  GridDataFactory.fillDefaults().grab(true,false).span(1,1).applyTo(client);
  GridLayout layout=new GridLayout();
  layout.numColumns=3;
  createInputSection(client,toolkit,layout,"String_Node_Str","String_Node_Str");
  createOutputSection(client,toolkit,layout,"String_Node_Str","String_Node_Str");
  addButtonsToToolBar();
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  classPathCount=0;
  toolkit=createFormBodySection(parent,"String_Node_Str");
  Section section=toolkit.createSection(form.getBody(),Section.TITLE_BAR | Section.EXPANDED);
  GridDataFactory.fillDefaults().grab(true,false).span(3,1).applyTo(section);
  section.setExpanded(true);
  ScrolledComposite sc=new ScrolledComposite(section,SWT.H_SCROLL | SWT.V_SCROLL);
  sc.setExpandHorizontal(true);
  sc.setExpandVertical(true);
  GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).applyTo(sc);
  NlputilsFormComposite.createEmptyRow(toolkit,sc);
  Composite client=toolkit.createComposite(form.getBody());
  GridLayoutFactory.fillDefaults().equalWidth(true).numColumns(1).applyTo(client);
  GridDataFactory.fillDefaults().grab(true,false).span(1,1).applyTo(client);
  GridLayout layout=new GridLayout();
  layout.numColumns=3;
  createInputSection(client,toolkit,layout,"String_Node_Str","String_Node_Str");
  createTestSection(client,toolkit,layout,"String_Node_Str","String_Node_Str");
  createOutputSection(client,toolkit,layout,"String_Node_Str","String_Node_Str");
  addButtonsToToolBar();
}
Program: 168217
Project: 168217
Buggy source:
private void getContent(String bookUri,String bookDir,String authorDir) throws IOException {
  BufferedWriter csvWriter=null;
  appendLog("String_Node_Str" + bookDir + "String_Node_Str");
  try {
    System.out.println(bookUri);
    csvWriter=new BufferedWriter(new FileWriter(new File(authorDir + System.getProperty("String_Node_Str") + bookDir+ "String_Node_Str")));
    Document doc=Jsoup.connect(bookUri).timeout(10 * 10000).get();
    Elements content=doc.getElementsByTag("String_Node_Str");
    for (    Element c : content) {
      csvWriter.write(c.text() + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    appendLog("String_Node_Str" + bookDir);
  }
 finally {
    if (csvWriter != null)     csvWriter.close();
  }
}

Fixed version (ground truth):
private void getContent(String bookUri,String bookDir,String authorDir) throws IOException {
  BufferedWriter csvWriter=null;
  appendLog("String_Node_Str" + bookDir + "String_Node_Str");
  try {
    csvWriter=new BufferedWriter(new FileWriter(new File(authorDir + System.getProperty("String_Node_Str") + bookDir+ "String_Node_Str")));
    Document doc=Jsoup.connect(bookUri).timeout(10 * 10000).get();
    Elements content=doc.getElementsByTag("String_Node_Str");
    if (content.size() == 0) {
      if (csvWriter != null)       csvWriter.close();
      getBookContent(bookUri,bookDir,authorDir);
      return;
    }
    for (    Element c : content) {
      csvWriter.write(c.text() + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    getBookContent(bookUri,bookDir,authorDir);
  }
 finally {
    if (csvWriter != null)     csvWriter.close();
  }
}
Program: 168218
Project: 168218
Buggy source:
public static void main(String[] args) throws IOException {
  LatinCrawler lc=new LatinCrawler();
  lc.outputDir="String_Node_Str";
  lc.initialize("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  LatinCrawler lc=new LatinCrawler();
  lc.outputDir="String_Node_Str";
  lc.authorNames.add("String_Node_Str");
  lc.getContent("String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 168220
Project: 168220
Buggy source:
public LatinCrawler(){
  authorNames=new ArrayList<String>();
  authorUrl=new ArrayList<String>();
}

Fixed version (ground truth):
public LatinCrawler(){
  authorNames=new HashSet<String>();
  skipBooks=new HashSet<String>();
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
  skipBooks.add("String_Node_Str");
}
Program: 168222
Project: 168222
Buggy source:
private void getContent(String bookUri,String bookDir,String authorDir) throws IOException {
  BufferedWriter csvWriter=null;
  System.out.println("String_Node_Str" + bookDir + "String_Node_Str");
  appendLog("String_Node_Str" + bookDir + "String_Node_Str");
  try {
    System.out.println(bookUri);
    csvWriter=new BufferedWriter(new FileWriter(new File(authorDir + System.getProperty("String_Node_Str") + bookDir+ "String_Node_Str")));
    Document doc=Jsoup.connect(bookUri).timeout(10 * 10000).get();
    Elements content=doc.getElementsByTag("String_Node_Str");
    for (    Element c : content) {
      csvWriter.write(c.text() + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + bookDir + e);
    appendLog("String_Node_Str" + bookDir);
  }
 finally {
    if (csvWriter != null)     csvWriter.close();
  }
}

Fixed version (ground truth):
private void getContent(String bookUri,String bookDir,String authorDir) throws IOException {
  BufferedWriter csvWriter=null;
  appendLog("String_Node_Str" + bookDir + "String_Node_Str");
  try {
    csvWriter=new BufferedWriter(new FileWriter(new File(authorDir + System.getProperty("String_Node_Str") + bookDir+ "String_Node_Str")));
    Document doc=Jsoup.connect(bookUri).timeout(10 * 10000).get();
    Elements content=doc.getElementsByTag("String_Node_Str");
    for (    Element c : content) {
      csvWriter.write(c.text() + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    appendLog("String_Node_Str" + bookDir);
  }
 finally {
    if (csvWriter != null)     csvWriter.close();
  }
}
Program: 168223
Project: 168223
Buggy source:
public static void main(String[] args) throws IOException {
  LatinCrawler lc=new LatinCrawler();
  lc.outputDir="String_Node_Str";
  lc.getBooks("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  LatinCrawler lc=new LatinCrawler();
  lc.outputDir="String_Node_Str";
  lc.authorNames.add("String_Node_Str");
  lc.getBooks("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 168224
Project: 168224
Buggy source:
public void getAllAuthors() throws IOException {
  int i, size=0;
  String name, url;
  Document doc=Jsoup.connect("String_Node_Str").timeout(10 * 1000).get();
  Elements authorsList=doc.getElementsByTag("String_Node_Str");
  System.out.println(authorsList);
  size=authorsList.size();
  String[] authorString=new String[size];
  for (i=0; i < size; i++) {
    name=authorsList.get(i).text();
    url="String_Node_Str" + authorsList.get(i).attr("String_Node_Str");
    authorUrl.add(url);
    authorNames.add(name);
    if (name.equals("String_Node_Str") || url.equals("String_Node_Str"))     continue;
    String aurl=outputDir + File.separator + name;
    File authorDir=new File(aurl);
    if (!authorDir.exists()) {
      authorDir.mkdirs();
    }
    System.out.println("String_Node_Str" + name + "String_Node_Str");
    appendLog("String_Node_Str" + name + "String_Node_Str");
    getBooks(name,url,aurl,name);
  }
  return;
}

Fixed version (ground truth):
public void getAllAuthors() throws IOException {
  int i, size=0;
  String name, url;
  Document doc=Jsoup.connect("String_Node_Str").timeout(10 * 1000).get();
  Elements authorsList=doc.getElementsByTag("String_Node_Str");
  size=authorsList.size();
  int count=0;
  for (i=0; i < size; i++) {
    name=authorsList.get(i).text();
    url="String_Node_Str" + authorsList.get(i).attr("String_Node_Str");
    authorNames.add(name);
    if (skipBooks.contains(name))     continue;
    String aurl=outputDir + File.separator + name;
    File authorDir=new File(aurl);
    if (!authorDir.exists()) {
      authorDir.mkdirs();
    }
    appendLog("String_Node_Str" + name + "String_Node_Str");
    getBooks(name,url,aurl,name);
  }
  Element secondList=doc.getElementsByTag("String_Node_Str").get(1);
  Elements auth2List=secondList.getElementsByTag("String_Node_Str");
  for (  Element auth : auth2List) {
    name=auth.text();
    url=auth.getElementsByTag("String_Node_Str").attr("String_Node_Str");
    if (authorNames.contains(name))     continue;
    authorNames.add(name);
    if (skipBooks.contains(name))     continue;
    String aurl=outputDir + File.separator + name;
    File authorDir=new File(aurl);
    if (!authorDir.exists()) {
      authorDir.mkdirs();
    }
    appendLog("String_Node_Str" + name + "String_Node_Str");
    getBooks(name,url,aurl,name);
  }
  return;
}
Program: 168228
Project: 168228
Buggy source:
@Override public void mouseUp(MouseEvent e){
  ppDir=txtInputDir.getText();
  ppSeedFile=txtSeedFile.getText();
  if (btnPreprocess.getSelection()) {
    if (ppService.options == null) {
      System.out.println("String_Node_Str");
      appendLog("String_Node_Str");
      GlobalPresserSettings.ppService.setOptions(shell);
    }
    IEclipseContext iEclipseContext=context;
    ContextInjectionFactory.inject(ppService,iEclipseContext);
    appendLog("String_Node_Str");
    System.out.println("String_Node_Str");
    try {
      ppDir=ppService.doPreprocessing(txtInputDir.getText());
      ppSeedFile=ppService.doPreprocessing(txtSeedFile.getText());
    }
 catch (    IOException e1) {
      e1.printStackTrace();
    }
  }
  long startTime=System.currentTimeMillis();
  appendLog("String_Node_Str");
  invokeLDA();
  appendLog("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  if (btnPreprocess.getSelection() && ppService.doCleanUp()) {
    ppService.clean(ppDir);
    System.out.println("String_Node_Str" + ppDir);
    appendLog("String_Node_Str" + ppDir);
    ppService.clean(ppSeedFile);
    System.out.println("String_Node_Str" + ppSeedFile);
    appendLog("String_Node_Str" + ppSeedFile);
  }
  appendLog("String_Node_Str");
}

Fixed version (ground truth):
@Override public void mouseUp(MouseEvent e){
  ppDir=txtInputDir.getText();
  ppSeedFile=txtSeedFile.getText();
  if (btnPreprocess.getSelection()) {
    ppService=GlobalPresserSettings.ppService;
    if (ppService.options == null) {
      System.out.println("String_Node_Str");
      appendLog("String_Node_Str");
      GlobalPresserSettings.ppService.setOptions(shell);
    }
    IEclipseContext iEclipseContext=context;
    ContextInjectionFactory.inject(ppService,iEclipseContext);
    appendLog("String_Node_Str");
    System.out.println("String_Node_Str");
    try {
      ppDir=ppService.doPreprocessing(txtInputDir.getText());
      ppSeedFile=ppService.doPreprocessing(txtSeedFile.getText());
    }
 catch (    IOException e1) {
      e1.printStackTrace();
    }
  }
  long startTime=System.currentTimeMillis();
  appendLog("String_Node_Str");
  invokeLDA();
  appendLog("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  if (btnPreprocess.getSelection() && ppService.doCleanUp()) {
    ppService.clean(ppDir);
    System.out.println("String_Node_Str" + ppDir);
    appendLog("String_Node_Str" + ppDir);
    ppService.clean(ppSeedFile);
    System.out.println("String_Node_Str" + ppSeedFile);
    appendLog("String_Node_Str" + ppSeedFile);
  }
  appendLog("String_Node_Str");
}
Program: 168230
Project: 168230
Buggy source:
@Override public void mouseUp(MouseEvent e){
  appendLog("String_Node_Str");
  String f=combo.getText();
  if (f.equals("String_Node_Str")) {
    if (btnCases.getSelection())     f="String_Node_Str";
 else     f="String_Node_Str";
  }
  long startTime=System.currentTimeMillis();
  SupremeCrawler sc=new SupremeCrawler(combo.getText(),txtOutput.getText(),btnTruncate.getSelection(),btnDownloadAudio.getSelection());
  IEclipseContext iEclipseContext=context;
  ContextInjectionFactory.inject(sc,iEclipseContext);
  try {
    sc.looper();
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  appendLog("String_Node_Str" + (System.currentTimeMillis() - startTime) / (float)1000 + "String_Node_Str");
  appendLog("String_Node_Str");
}

Fixed version (ground truth):
@Override public void mouseUp(MouseEvent e){
  if (txtOutput.getText() == null || txtOutput.getText().length() < 2) {
    MessageBox mBox=new MessageBox(shell,SWT.OK);
    mBox.setMessage("String_Node_Str");
    mBox.open();
    return;
  }
  appendLog("String_Node_Str");
  String f=combo.getText();
  if (f.equals("String_Node_Str")) {
    if (btnCases.getSelection())     f="String_Node_Str";
 else     f="String_Node_Str";
  }
  long startTime=System.currentTimeMillis();
  SupremeCrawler sc=new SupremeCrawler(combo.getText(),txtOutput.getText(),btnTruncate.getSelection(),btnDownloadAudio.getSelection());
  IEclipseContext iEclipseContext=context;
  ContextInjectionFactory.inject(sc,iEclipseContext);
  try {
    sc.looper();
  }
 catch (  IOException e1) {
    e1.printStackTrace();
  }
  appendLog("String_Node_Str" + (System.currentTimeMillis() - startTime) / (float)1000 + "String_Node_Str");
  appendLog("String_Node_Str");
}
Program: 168236
Project: 168236
Buggy source:
@Override public void mouseUp(MouseEvent e){
  Preprocess pp=new Preprocess(inputFiles,stopwordsFile,outputDirectory,txtSuffix.getText(),txtDelimiters.getText(),btnDoLowercase.getSelection(),btnStemming.getSelection(),cmbStemLang.getText());
  IEclipseContext iEclipseContext=context;
  ContextInjectionFactory.inject(pp,iEclipseContext);
  try {
    long startTime=System.currentTimeMillis();
    int result=pp.doPreprocess();
    if (result == -1 || result == -2 || result == -3)     appendLog("String_Node_Str");
 else     appendLog("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  }
 catch (  Exception ioe) {
    ioe.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void mouseUp(MouseEvent e){
  Preprocess pp=new Preprocess(inputFiles,txtStopWords.getText(),txtOutput.getText(),txtSuffix.getText(),txtDelimiters.getText(),btnDoLowercase.getSelection(),btnStemming.getSelection(),cmbStemLang.getText());
  IEclipseContext iEclipseContext=context;
  ContextInjectionFactory.inject(pp,iEclipseContext);
  try {
    long startTime=System.currentTimeMillis();
    int result=pp.doPreprocess();
    if (result == -1 || result == -2 || result == -3)     appendLog("String_Node_Str");
 else     appendLog("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  }
 catch (  Exception ioe) {
    ioe.printStackTrace();
  }
}
Program: 168246
Project: 168246
Buggy source:
public int loadPretrainedModel(String label1,String label2,String modelFilePath,String hashmapPath) throws FileNotFoundException, IOException, ClassNotFoundException {
  int ret=0;
  System.out.println("String_Node_Str" + modelFilePath);
  this.modelFile=new File(modelFilePath);
  File hashmap=new File(hashmapPath);
  System.out.println("String_Node_Str" + hashmap.getAbsolutePath());
  ObjectInputStream ois=new ObjectInputStream(new FileInputStream(hashmap));
  this.featureMap=(HashMap<String,Integer>)ois.readObject();
  Calendar cal=Calendar.getInstance();
  dateString="String_Node_Str" + (cal.get(Calendar.MONTH) + 1) + "String_Node_Str"+ cal.get(Calendar.DATE)+ "String_Node_Str"+ cal.get(Calendar.YEAR);
  this.intermediatePath=System.getProperty("String_Node_Str") + "String_Node_Str" + label1+ "String_Node_Str"+ label2+ "String_Node_Str"+ dateString+ "String_Node_Str"+ System.currentTimeMillis();
  return ret;
}

Fixed version (ground truth):
public int loadPretrainedModel(String label1,String label2,String modelFilePath,String hashmapPath) throws FileNotFoundException, IOException, ClassNotFoundException {
  int ret=0;
  System.out.println("String_Node_Str" + modelFilePath);
  this.modelFile=new File(modelFilePath);
  File hashmap=new File(hashmapPath);
  System.out.println("String_Node_Str" + hashmap.getAbsolutePath());
  ObjectInputStream ois=new ObjectInputStream(new FileInputStream(hashmap));
  this.featureMap=(HashMap<String,Integer>)ois.readObject();
  Calendar cal=Calendar.getInstance();
  dateString="String_Node_Str" + (cal.get(Calendar.MONTH) + 1) + "String_Node_Str"+ cal.get(Calendar.DATE)+ "String_Node_Str"+ cal.get(Calendar.YEAR);
  this.intermediatePath=System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str") + label1+ "String_Node_Str"+ label2+ "String_Node_Str"+ dateString+ "String_Node_Str"+ System.currentTimeMillis();
  return ret;
}
Program: 168248
Project: 168248
Buggy source:
/** 
 * Retrieves the output directory for the main module
 * @param project Project
 * @return String value
 */
private String getMainOutputDirectory(Project project){
  final CompilerManager compilerManager=CompilerManager.getInstance(project);
  final Module[] modules=ModuleManager.getInstance(project).getModules();
  final ModuleCompileScope compileScope=new ModuleCompileScope(project,modules,false);
  final Module mainModule=modules[0];
  CompileTask compileTask=new CompileTask(){
    public boolean execute(    CompileContext compileContext){
      VirtualFile mainOutputDirectory=compileContext.getModuleOutputDirectory(mainModule);
      JettyRunnerEditor.this.mainOutputDirectory=mainOutputDirectory.getPresentableUrl();
      return true;
    }
  }
;
  compilerManager.executeTask(compileTask,compileScope,"String_Node_Str",null);
  return this.mainOutputDirectory;
}

Fixed version (ground truth):
/** 
 * Retrieves the output directory for the main module
 * @param project Project
 * @return String value
 */
private String getMainOutputDirectory(final Project project){
  final CompilerManager compilerManager=CompilerManager.getInstance(project);
  final Module[] modules=ModuleManager.getInstance(project).getModules();
  final ModuleCompileScope compileScope=new ModuleCompileScope(project,modules,false);
  final Module mainModule=modules[0];
  CompileTask compileTask=new CompileTask(){
    public boolean execute(    CompileContext compileContext){
      VirtualFile mainOutputDirectory=compileContext.getModuleOutputDirectory(mainModule);
      if (mainOutputDirectory != null) {
        String mainOutputDirectoryValue=mainOutputDirectory.getPresentableUrl();
        JettyRunnerEditor.this.mainOutputDirectory=mainOutputDirectoryValue;
      }
 else {
        NotificationGroup notificationGroup=new NotificationGroup("String_Node_Str",NotificationDisplayType.BALLOON,true);
        Notification notification=notificationGroup.createNotification("String_Node_Str",NotificationType.ERROR);
        Notifications.Bus.notify(notification,project);
      }
      return true;
    }
  }
;
  compilerManager.executeTask(compileTask,compileScope,"String_Node_Str",null);
  return this.mainOutputDirectory;
}
Program: 168249
Project: 168249
Buggy source:
public boolean execute(CompileContext compileContext){
  VirtualFile mainOutputDirectory=compileContext.getModuleOutputDirectory(mainModule);
  JettyRunnerEditor.this.mainOutputDirectory=mainOutputDirectory.getPresentableUrl();
  return true;
}

Fixed version (ground truth):
public boolean execute(CompileContext compileContext){
  VirtualFile mainOutputDirectory=compileContext.getModuleOutputDirectory(mainModule);
  if (mainOutputDirectory != null) {
    String mainOutputDirectoryValue=mainOutputDirectory.getPresentableUrl();
    JettyRunnerEditor.this.mainOutputDirectory=mainOutputDirectoryValue;
  }
 else {
    NotificationGroup notificationGroup=new NotificationGroup("String_Node_Str",NotificationDisplayType.BALLOON,true);
    Notification notification=notificationGroup.createNotification("String_Node_Str",NotificationType.ERROR);
    Notifications.Bus.notify(notification,project);
  }
  return true;
}
Program: 168250
Project: 168250
Buggy source:
@Override public void sendRedirect(String location) throws IOException {
  String sanitizedLocation=location.replaceAll("String_Node_Str","String_Node_Str");
  if (!sanitizedLocation.contains("String_Node_Str") && csrfGuard.isProtectedPageAndMethod(sanitizedLocation,"String_Node_Str")) {
    csrfGuard.updateTokens(request);
    StringBuilder sb=new StringBuilder();
    if (!sanitizedLocation.startsWith("String_Node_Str")) {
      sb.append(request.getContextPath() + "String_Node_Str" + sanitizedLocation);
    }
 else {
      sb.append(sanitizedLocation);
    }
    if (sanitizedLocation.contains("String_Node_Str")) {
      sb.append('&');
    }
 else {
      sb.append('?');
    }
    String locationUri=sanitizedLocation.split("String_Node_Str",2)[0];
    sb.append(csrfGuard.getTokenName());
    sb.append('=');
    sb.append(csrfGuard.getTokenValue(request,locationUri));
    response.sendRedirect(sb.toString());
  }
 else {
    response.sendRedirect(sanitizedLocation);
  }
}

Fixed version (ground truth):
@Override public void sendRedirect(String location) throws IOException {
  String sanitizedLocation=location.replaceAll("String_Node_Str","String_Node_Str");
  if (!sanitizedLocation.contains("String_Node_Str") && csrfGuard.isProtectedPageAndMethod(sanitizedLocation,"String_Node_Str")) {
    csrfGuard.updateTokens(request);
    String[] splitOnFragement=location.split("String_Node_Str",2);
    location=splitOnFragement[0];
    StringBuilder sb=new StringBuilder();
    if (!sanitizedLocation.startsWith("String_Node_Str")) {
      sb.append(request.getContextPath() + "String_Node_Str" + sanitizedLocation);
    }
 else {
      sb.append(sanitizedLocation);
    }
    if (sanitizedLocation.contains("String_Node_Str")) {
      sb.append('&');
    }
 else {
      sb.append('?');
    }
    String locationUri=sanitizedLocation.split("String_Node_Str",2)[0];
    sb.append(csrfGuard.getTokenName());
    sb.append('=');
    sb.append(csrfGuard.getTokenValue(request,locationUri));
    if (splitOnFragement.length > 1) {
      sb.append('#').append(splitOnFragement[1]);
    }
    response.sendRedirect(sb.toString());
  }
 else {
    response.sendRedirect(sanitizedLocation);
  }
}
Program: 168251
Project: 168251
Buggy source:
/** 
 * see if a test path starts with ^ and ends with $ thus making it a regex
 * @param testPath
 * @return true if regex
 */
private static boolean isTestPathRegex(String testPath){
  return testPath != null && testPath.startsWith("String_Node_Str") && testPath.endsWith("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * see if a test path starts with ^ and ends with $ thus making it a regex
 * @param testPath The path string to test
 * @return true if regex (starts with "^" and ends with "$")
 */
private static boolean isTestPathRegex(String testPath){
  return testPath != null && testPath.startsWith("String_Node_Str") && testPath.endsWith("String_Node_Str");
}
Program: 168252
Project: 168252
Buggy source:
/** 
 * if the HTTP method is protected, i.e. should be checked for token
 * @param method
 * @return if protected
 */
public boolean isProtectedMethod(String method){
  boolean isProtected=true;
{
    Set<String> theProtectedMethods=getProtectedMethods();
    if (!theProtectedMethods.isEmpty() && !theProtectedMethods.contains(method)) {
      isProtected=false;
    }
  }
{
    Set<String> theUnprotectedMethods=getUnprotectedMethods();
    if (!theUnprotectedMethods.isEmpty() && theUnprotectedMethods.contains(method)) {
      isProtected=false;
    }
  }
  return isProtected;
}

Fixed version (ground truth):
/** 
 * Whether or not the HTTP method is protected, i.e. should be checked for token.
 * @param method The method to check for protection status
 * @return true when the given method name is in the protected methods set and not in the unprotected methods set
 */
public boolean isProtectedMethod(String method){
  boolean isProtected=true;
{
    Set<String> theProtectedMethods=getProtectedMethods();
    if (!theProtectedMethods.isEmpty() && !theProtectedMethods.contains(method)) {
      isProtected=false;
    }
  }
{
    Set<String> theUnprotectedMethods=getUnprotectedMethods();
    if (!theUnprotectedMethods.isEmpty() && theUnprotectedMethods.contains(method)) {
      isProtected=false;
    }
  }
  return isProtected;
}
Program: 168253
Project: 168253
Buggy source:
/** 
 * @param request
 * @param response
 * @param csrfe
 */
private void callActionsOnError(HttpServletRequest request,HttpServletResponse response,CsrfGuardException csrfe){
  for (  IAction action : getActions()) {
    try {
      action.execute(request,response,csrfe,this);
    }
 catch (    CsrfGuardException exception) {
      getLogger().log(LogLevel.Error,exception);
    }
  }
}

Fixed version (ground truth):
/** 
 * Invoked when there was a CsrfGuardException such as a token mismatch error. Calls the configured actions.
 * @param request The HttpServletRequest
 * @param response The HttpServletResponse
 * @param csrfe The exception that triggered the actions call. Passed to the action.
 * @see IAction#execute(HttpServletRequest,HttpServletResponse,CsrfGuardException)
 */
private void callActionsOnError(HttpServletRequest request,HttpServletResponse response,CsrfGuardException csrfe){
  for (  IAction action : getActions()) {
    try {
      action.execute(request,response,csrfe,this);
    }
 catch (    CsrfGuardException exception) {
      getLogger().log(LogLevel.Error,exception);
    }
  }
}
Program: 168254
Project: 168254
Buggy source:
/** 
 * @param context
 * @param prefix 
 */
public static void printConfigIfConfigured(ServletContext context,String prefix){
  String printConfig=context.getInitParameter(CONFIG_PRINT_PARAM);
  if (printConfig == null || "String_Node_Str".equals(printConfig.trim())) {
    printConfig=CsrfGuard.getInstance().isPrintConfig() ? "String_Node_Str" : null;
  }
  if (printConfig != null && Boolean.parseBoolean(printConfig)) {
    context.log(prefix + CsrfGuard.getInstance().toString());
  }
}

Fixed version (ground truth):
/** 
 * Prints the configuration to the ServletContext log file with the given prefix. Has no effect unless the CONFIG_PRINT_PARAM init parameter is "true."
 * @param context The ServletContext
 * @param prefix  The string used as a prefix when printing the configuration to the log
 * @see javax.servlet.ServletContext#log(String)
 */
public static void printConfigIfConfigured(ServletContext context,String prefix){
  String printConfig=context.getInitParameter(CONFIG_PRINT_PARAM);
  if (printConfig == null || "String_Node_Str".equals(printConfig.trim())) {
    printConfig=CsrfGuard.getInstance().isPrintConfig() ? "String_Node_Str" : null;
  }
  if (printConfig != null && Boolean.parseBoolean(printConfig)) {
    context.log(prefix + CsrfGuard.getInstance().toString());
  }
}
Program: 168255
Project: 168255
Buggy source:
/** 
 * if this configuration provider can be cached for a minute, i.e. it is all setup 
 */
boolean isCacheable();

Fixed version (ground truth):
/** 
 * @return true when this configuration provider can be cached for a minute, i.e. it is all setup 
 */
boolean isCacheable();
Program: 168256
Project: 168256
Buggy source:
/** 
 * If csrf guard filter should check even if there is no session for the user Note: this changed around 2014/04, the default behavior used to be to  not check if there is no session.  If you want the legacy behavior (if your app is not susceptible to CSRF if the user has no session), set this to false
 * @return if true
 */
public boolean isValidateWhenNoSessionExists();

Fixed version (ground truth):
/** 
 * If csrf guard filter should check even if there is no session for the user Note: this changed around 2014/04, the default behavior used to be to  not check if there is no session.  If you want the legacy behavior (if your app is not susceptible to CSRF if the user has no session), set this to false
 * @return true when validation is performed even when no session exists
 */
public boolean isValidateWhenNoSessionExists();
Program: 168257
Project: 168257
Buggy source:
/** 
 * if the token should be injected in GET forms (which will be on the URL) if the HTTP method GET is unprotected, then this should likely be false
 * @return if inject
 */
boolean isJavascriptInjectGetForms();

Fixed version (ground truth):
/** 
 * if the token should be injected in GET forms (which will be on the URL) if the HTTP method GET is unprotected, then this should likely be false
 * @return true if the token should be injected in GET forms via Javascript
 */
boolean isJavascriptInjectGetForms();
Program: 168258
Project: 168258
Buggy source:
/** 
 * called when retrieving the configuration
 * @param properties
 * @return the configuration
 */
public ConfigurationProvider retrieveConfiguration(Properties properties);

Fixed version (ground truth):
/** 
 * called when retrieving the configuration
 * @param properties describing the configuration
 * @return the configuration
 */
public ConfigurationProvider retrieveConfiguration(Properties properties);
Program: 168259
Project: 168259
Buggy source:
/** 
 * common subsitutions in config values
 * @param input
 * @return the new string
 */
public static String commonSubstitutions(String input){
  if (input == null || !input.contains("String_Node_Str")) {
    return input;
  }
  input=input.replace("String_Node_Str",CsrfGuardUtils.defaultString(CsrfGuardServletContextListener.getServletContext()));
  return input;
}

Fixed version (ground truth):
/** 
 * Replaces percent-bounded expressions such as "%servletContext%." common subsitutions in config values
 * @param input A string with expressions that should be replaced
 * @return new string with "common" expressions replaced by configuration values
 */
public static String commonSubstitutions(String input){
  if (input == null || !input.contains("String_Node_Str")) {
    return input;
  }
  input=input.replace("String_Node_Str",CsrfGuardUtils.defaultString(CsrfGuardServletContextListener.getServletContext()));
  return input;
}
Program: 168260
Project: 168260
Buggy source:
/** 
 * property string and substitutions
 * @param properties
 * @param propertyName
 * @return the value substituted
 */
public static String propertyString(Properties properties,String propertyName,String defaultValue){
  String value=properties.getProperty(propertyName,defaultValue);
  value=commonSubstitutions(value);
  return value;
}

Fixed version (ground truth):
/** 
 * property string and substitutions
 * @param properties The properties from which to fetch a value
 * @param propertyName The name of the desired property
 * @param defaultValue The value to use when the propertyName does not exist
 * @return the value, with common substitutions performed
 * @see #commonSubstitutions(String)
 */
public static String propertyString(Properties properties,String propertyName,String defaultValue){
  String value=properties.getProperty(propertyName,defaultValue);
  value=commonSubstitutions(value);
  return value;
}
Program: 168261
Project: 168261
Buggy source:
public static boolean isOPFReceiverRegistered(@NonNull final Context context){
  OPFLog.methodD(context);
  final Intent intent=new Intent(ACTION_RECEIVE);
  final List<ResolveInfo> resolveInfos=context.getPackageManager().queryBroadcastReceivers(intent,GET_RESOLVED_FILTER);
  for (  ResolveInfo resolveInfo : resolveInfos) {
    final IntentFilter intentFilter=resolveInfo.filter;
    if (intentFilter != null && intentFilter.hasAction(ACTION_RECEIVE) && intentFilter.hasAction(ACTION_REGISTRATION) && intentFilter.hasAction(ACTION_UNREGISTRATION) && intentFilter.hasAction(ACTION_NO_AVAILABLE_PROVIDER)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isOPFReceiverRegistered(@NonNull final Context context){
  OPFLog.methodD(context);
  final Intent intentBroadcastReceive=new Intent(ACTION_RECEIVE);
  final Intent intentBroadcastRegistration=new Intent(ACTION_REGISTRATION);
  final Intent intentBroadcastUnregistration=new Intent(ACTION_UNREGISTRATION);
  final Intent intentBroadcastNoAvailableProvider=new Intent(ACTION_NO_AVAILABLE_PROVIDER);
  try {
    checkReceiver(context,intentBroadcastReceive,null,null);
    checkReceiver(context,intentBroadcastRegistration,null,null);
    checkReceiver(context,intentBroadcastUnregistration,null,null);
    checkReceiver(context,intentBroadcastNoAvailableProvider,null,null);
  }
 catch (  RuntimeException e) {
    return false;
  }
  return true;
}