nus-yam/ex-repair huggingface dataset:
Program: 102879
Project: 102879
Buggy source:
@Override public void afterProcess(Page page){
  content=null;
}

Fixed version (ground truth):
@Override public void afterProcess(Page page){
  System.out.println("String_Node_Str" + title);
  System.out.println("String_Node_Str" + content);
  System.out.println("String_Node_Str" + tags);
}
Program: 102880
Project: 102880
Buggy source:
private void init(Class clazz){
  this.clazz=clazz;
  initClassExtractors();
  fieldExtractors=new ArrayList<FieldExtractor>();
  for (  Field field : clazz.getDeclaredFields()) {
    field.setAccessible(true);
    FieldExtractor fieldExtractor=getAnnotationExtractBy(clazz,field);
    FieldExtractor fieldExtractorTmp=getAnnotationExtractByRaw(clazz,field);
    if (fieldExtractor != null && fieldExtractorTmp != null) {
      throw new IllegalStateException("String_Node_Str");
    }
 else     if (fieldExtractor == null && fieldExtractorTmp != null) {
      fieldExtractor=fieldExtractorTmp;
    }
    addAnnotationExtractBy2(clazz,fieldExtractor);
    addAnnotationExtractBy3(clazz,fieldExtractor);
    fieldExtractorTmp=getAnnotationExtractByUrl(clazz,field);
    if (fieldExtractor != null && fieldExtractorTmp != null) {
      throw new IllegalStateException("String_Node_Str");
    }
 else     if (fieldExtractor == null && fieldExtractorTmp != null) {
      fieldExtractor=fieldExtractorTmp;
    }
    if (fieldExtractor != null) {
      if (!fieldExtractor.isMulti() && !String.class.isAssignableFrom(field.getType())) {
        throw new IllegalStateException("String_Node_Str" + field.getName() + "String_Node_Str");
      }
 else       if (fieldExtractor.isMulti() && !List.class.isAssignableFrom(field.getType())) {
        throw new IllegalStateException("String_Node_Str" + field.getName() + "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
private void init(Class clazz){
  this.clazz=clazz;
  initClassExtractors();
  fieldExtractors=new ArrayList<FieldExtractor>();
  for (  Field field : clazz.getDeclaredFields()) {
    field.setAccessible(true);
    FieldExtractor fieldExtractor=getAnnotationExtractBy(clazz,field);
    FieldExtractor fieldExtractorTmp=getAnnotationExtractByRaw(clazz,field);
    if (fieldExtractor != null && fieldExtractorTmp != null) {
      throw new IllegalStateException("String_Node_Str");
    }
 else     if (fieldExtractor == null && fieldExtractorTmp != null) {
      fieldExtractor=fieldExtractorTmp;
    }
    if (fieldExtractor != null) {
      addAnnotationExtractBy2(fieldExtractor);
      addAnnotationExtractBy3(fieldExtractor);
    }
    fieldExtractorTmp=getAnnotationExtractByUrl(clazz,field);
    if (fieldExtractor != null && fieldExtractorTmp != null) {
      throw new IllegalStateException("String_Node_Str");
    }
 else     if (fieldExtractor == null && fieldExtractorTmp != null) {
      fieldExtractor=fieldExtractorTmp;
    }
    if (fieldExtractor != null) {
      if (!fieldExtractor.isMulti() && !String.class.isAssignableFrom(field.getType())) {
        throw new IllegalStateException("String_Node_Str" + field.getName() + "String_Node_Str");
      }
 else       if (fieldExtractor.isMulti() && !List.class.isAssignableFrom(field.getType())) {
        throw new IllegalStateException("String_Node_Str" + field.getName() + "String_Node_Str");
      }
      fieldExtractors.add(fieldExtractor);
    }
  }
}
Program: 102881
Project: 102881
Buggy source:
private void addAnnotationExtractBy3(Class clazz,FieldExtractor fieldExtractor){
  ExtractBy3 extractBy=fieldExtractor.getField().getAnnotation(ExtractBy3.class);
  if (extractBy != null) {
    String value=extractBy.value();
    Selector selector;
switch (extractBy.type()) {
case Css:
      selector=new CssSelector(value);
    break;
case Regex:
  selector=new RegexSelector(value);
break;
case XPath:
selector=new XpathSelector(value);
break;
case XPath2:
selector=new Xpath2Selector(value);
break;
default :
selector=new Xpath2Selector(value);
}
fieldExtractor.setSelector(new AndSelector(fieldExtractor.getSelector(),selector));
}
}

Fixed version (ground truth):
private void addAnnotationExtractBy3(FieldExtractor fieldExtractor){
  ExtractBy3 extractBy=fieldExtractor.getField().getAnnotation(ExtractBy3.class);
  if (extractBy != null) {
    String value=extractBy.value();
    Selector selector;
switch (extractBy.type()) {
case Css:
      selector=new CssSelector(value);
    break;
case Regex:
  selector=new RegexSelector(value);
break;
case XPath:
selector=new XpathSelector(value);
break;
case XPath2:
selector=new Xpath2Selector(value);
break;
default :
selector=new Xpath2Selector(value);
}
fieldExtractor.setSelector(new AndSelector(fieldExtractor.getSelector(),selector));
}
}
Program: 102882
Project: 102882
Buggy source:
private void addAnnotationExtractBy2(Class clazz,FieldExtractor fieldExtractor){
  ExtractBy2 extractBy=fieldExtractor.getField().getAnnotation(ExtractBy2.class);
  if (extractBy != null) {
    String value=extractBy.value();
    Selector selector;
switch (extractBy.type()) {
case Css:
      selector=new CssSelector(value);
    break;
case Regex:
  selector=new RegexSelector(value);
break;
case XPath:
selector=new XpathSelector(value);
break;
case XPath2:
selector=new Xpath2Selector(value);
break;
default :
selector=new Xpath2Selector(value);
}
fieldExtractor.setSelector(new AndSelector(fieldExtractor.getSelector(),selector));
}
}

Fixed version (ground truth):
private void addAnnotationExtractBy2(FieldExtractor fieldExtractor){
  ExtractBy2 extractBy=fieldExtractor.getField().getAnnotation(ExtractBy2.class);
  if (extractBy != null) {
    String value=extractBy.value();
    Selector selector;
switch (extractBy.type()) {
case Css:
      selector=new CssSelector(value);
    break;
case Regex:
  selector=new RegexSelector(value);
break;
case XPath:
selector=new XpathSelector(value);
break;
case XPath2:
selector=new Xpath2Selector(value);
break;
default :
selector=new Xpath2Selector(value);
}
fieldExtractor.setSelector(new AndSelector(fieldExtractor.getSelector(),selector));
}
}
Program: 102884
Project: 102884
Buggy source:
@Override public PagedModel combine(PagedModel pagedModel){
  News163 news163=new News163();
  News163 pagedModel1=(News163)pagedModel;
  news163.content=this.content + pagedModel1.content;
  return news163;
}

Fixed version (ground truth):
@Override public PagedModel combine(PagedModel pagedModel){
  News163 news163=new News163();
  news163.title=this.title;
  News163 pagedModel1=(News163)pagedModel;
  news163.content=this.content + pagedModel1.content;
  return news163;
}
Program: 102885
Project: 102885
Buggy source:
/** 
 * 建立多个线程下载
 * @param threadNum 线程数
 * @return this
 */
public Spider thread(int threadNum){
  checkIfNotRunning();
  if (threadNum <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  downloader=new HttpClientDownloader(threadNum);
  if (threadNum == 1) {
    return this;
  }
synchronized (this) {
    this.executorService=ThreadUtils.newFixedThreadPool(threadNum);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * 建立多个线程下载
 * @param threadNum 线程数
 * @return this
 */
public Spider thread(int threadNum){
  checkIfNotRunning();
  if (threadNum <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (downloader == null || downloader instanceof HttpClientDownloader) {
    downloader=new HttpClientDownloader(threadNum);
  }
  if (threadNum == 1) {
    return this;
  }
synchronized (this) {
    this.executorService=ThreadUtils.newFixedThreadPool(threadNum);
  }
  return this;
}
Program: 102886
Project: 102886
Buggy source:
@Override public String select(String text){
  Document doc=Jsoup.parse(text);
  Elements elements=doc.select(selectorText);
  if (CollectionUtils.isNotEmpty(elements)) {
    return null;
  }
  return elements.get(0).outerHtml();
}

Fixed version (ground truth):
@Override public String select(String text){
  Document doc=Jsoup.parse(text);
  Elements elements=doc.select(selectorText);
  if (CollectionUtils.isEmpty(elements)) {
    return null;
  }
  return elements.get(0).outerHtml();
}
Program: 102887
Project: 102887
Buggy source:
/** 
 * 建立多个线程下载
 * @param threadNum 线程数
 * @return this
 */
public Spider thread(int threadNum){
  checkIfNotRunning();
  if (threadNum <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (threadNum == 1) {
    return this;
  }
synchronized (this) {
    this.executorService=ThreadUtils.newFixedThreadPool(threadNum);
  }
  return this;
}

Fixed version (ground truth):
/** 
 * 建立多个线程下载
 * @param threadNum 线程数
 * @return this
 */
public Spider thread(int threadNum){
  checkIfNotRunning();
  if (threadNum <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  downloader=new HttpClientDownloader(threadNum);
  if (threadNum == 1) {
    return this;
  }
synchronized (this) {
    this.executorService=ThreadUtils.newFixedThreadPool(threadNum);
  }
  return this;
}
Program: 102889
Project: 102889
Buggy source:
private HttpClient generateClient(Site site){
  HttpParams params=new BasicHttpParams();
  params.setParameter(CoreProtocolPNames.USER_AGENT,site.getUserAgent());
  params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,1000);
  params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,2000);
  HttpProtocolParamBean paramsBean=new HttpProtocolParamBean(params);
  paramsBean.setVersion(HttpVersion.HTTP_1_1);
  paramsBean.setContentCharset("String_Node_Str");
  paramsBean.setUseExpectContinue(false);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("String_Node_Str",80,PlainSocketFactory.getSocketFactory()));
  PoolingClientConnectionManager connectionManager=new PoolingClientConnectionManager(schemeRegistry);
  connectionManager.setMaxTotal(poolSize);
  connectionManager.setDefaultMaxPerRoute(100);
  DefaultHttpClient httpClient=new DefaultHttpClient(connectionManager,params);
  generateCookie(httpClient,site);
  httpClient.getParams().setIntParameter("String_Node_Str",60000);
  httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY,CookiePolicy.BEST_MATCH);
  return httpClient;
}

Fixed version (ground truth):
private HttpClient generateClient(Site site){
  HttpParams params=new BasicHttpParams();
  params.setParameter(CoreProtocolPNames.USER_AGENT,site.getUserAgent());
  params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,1000);
  params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,2000);
  HttpProtocolParamBean paramsBean=new HttpProtocolParamBean(params);
  paramsBean.setVersion(HttpVersion.HTTP_1_1);
  paramsBean.setContentCharset(site.getCharset());
  paramsBean.setUseExpectContinue(false);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("String_Node_Str",80,PlainSocketFactory.getSocketFactory()));
  PoolingClientConnectionManager connectionManager=new PoolingClientConnectionManager(schemeRegistry);
  connectionManager.setMaxTotal(poolSize);
  connectionManager.setDefaultMaxPerRoute(100);
  DefaultHttpClient httpClient=new DefaultHttpClient(connectionManager,params);
  generateCookie(httpClient,site);
  httpClient.getParams().setIntParameter("String_Node_Str",60000);
  httpClient.getParams().setParameter(ClientPNames.COOKIE_POLICY,CookiePolicy.BEST_MATCH);
  return httpClient;
}
Program: 102890
Project: 102890
Buggy source:
public static HttpClientPool getInstance(){
  return INSTANCE;
}

Fixed version (ground truth):
public static HttpClientPool getInstance(int poolSize){
  if (INSTANCE == null) {
synchronized (HttpClientPool.class) {
      if (INSTANCE == null) {
        INSTANCE=new HttpClientPool(poolSize);
      }
    }
  }
  return INSTANCE;
}
Program: 102891
Project: 102891
Buggy source:
@Override public Site getSite(){
  if (site == null) {
    site=Site.me().setDomain("String_Node_Str").addStartUrl("String_Node_Str").addStartUrl("String_Node_Str").addStartUrl("String_Node_Str").setUserAgent("String_Node_Str");
  }
  return site;
}

Fixed version (ground truth):
@Override public Site getSite(){
  if (site == null) {
    site=Site.me().setDomain("String_Node_Str").setSleepTime(0).addStartUrl("String_Node_Str").addStartUrl("String_Node_Str").addStartUrl("String_Node_Str").setUserAgent("String_Node_Str");
  }
  return site;
}
Program: 102892
Project: 102892
Buggy source:
@Override public synchronized Request poll(Task task){
  Jedis jedis=pool.getResource();
  String url=jedis.lpop(QUEUE_PREFIX + task.getUUID());
  pool.returnResource(jedis);
  return new Request(url);
}

Fixed version (ground truth):
@Override public synchronized Request poll(Task task){
  Jedis jedis=pool.getResource();
  String url=jedis.lpop(QUEUE_PREFIX + task.getUUID());
  if (url == null) {
    try {
      lock.lock();
      while (url == null) {
        try {
          condition.await();
          url=jedis.lpop(QUEUE_PREFIX + task.getUUID());
        }
 catch (        InterruptedException e) {
        }
      }
    }
  finally {
      lock.unlock();
    }
  }
  pool.returnResource(jedis);
  return new Request(url);
}
Program: 102893
Project: 102893
Buggy source:
@Override public synchronized void push(Request request,Task task){
  Jedis jedis=pool.getResource();
  if (jedis.zrank(SET_PREFIX + task.getUUID(),request.getUrl()) == null) {
    jedis.rpush(QUEUE_PREFIX + task.getUUID(),request.getUrl());
    jedis.zadd(SET_PREFIX + task.getUUID(),System.currentTimeMillis(),request.getUrl());
  }
  pool.returnResource(jedis);
}

Fixed version (ground truth):
@Override public synchronized void push(Request request,Task task){
  Jedis jedis=pool.getResource();
  if (jedis.zrank(SET_PREFIX + task.getUUID(),request.getUrl()) == null) {
    try {
      lock.lock();
      jedis.rpush(QUEUE_PREFIX + task.getUUID(),request.getUrl());
      jedis.zadd(SET_PREFIX + task.getUUID(),System.currentTimeMillis(),request.getUrl());
      condition.signal();
    }
  finally {
      lock.unlock();
    }
  }
  pool.returnResource(jedis);
}
Program: 102894
Project: 102894
Buggy source:
@Ignore("String_Node_Str") @Test public void testSelenium(){
  System.getProperties().setProperty("String_Node_Str","String_Node_Str");
  WebDriver webDriver=new ChromeDriver();
  webDriver.get("String_Node_Str");
  WebElement webElement=webDriver.findElement(By.xpath("String_Node_Str"));
  System.out.println(webElement.getAttribute("String_Node_Str"));
  webDriver.close();
}

Fixed version (ground truth):
@Ignore("String_Node_Str") @Test public void testSelenium(){
  System.getProperties().setProperty("String_Node_Str","String_Node_Str");
  Map<String,Object> contentSettings=new HashMap<String,Object>();
  contentSettings.put("String_Node_Str",2);
  Map<String,Object> preferences=new HashMap<String,Object>();
  preferences.put("String_Node_Str",contentSettings);
  DesiredCapabilities caps=DesiredCapabilities.chrome();
  caps.setCapability("String_Node_Str",preferences);
  caps.setCapability("String_Node_Str",Arrays.asList("String_Node_Str"));
  WebDriver webDriver=new ChromeDriver(caps);
  webDriver.get("String_Node_Str");
  WebElement webElement=webDriver.findElement(By.xpath("String_Node_Str"));
  System.out.println(webElement.getAttribute("String_Node_Str"));
  webDriver.close();
}
Program: 102895
Project: 102895
Buggy source:
@Ignore @Test public void testGlobalSpider(){
  SimplePageProcessor pageProcessor2=new SimplePageProcessor("String_Node_Str","String_Node_Str");
  System.out.println(pageProcessor2.getSite().getEncoding());
  pageProcessor2.getSite().setSleepTime(500);
  Spider.create(pageProcessor2).pipeline(new FilePipeline()).schedular(new FileCacheQueueScheduler("String_Node_Str")).run();
}

Fixed version (ground truth):
@Ignore @Test public void testGlobalSpider(){
  SimplePageProcessor pageProcessor2=new SimplePageProcessor("String_Node_Str","String_Node_Str");
  System.out.println(pageProcessor2.getSite().getEncoding());
  pageProcessor2.getSite().setSleepTime(500);
  Spider.create(pageProcessor2).pipeline(new FilePipeline()).scheduler(new FileCacheQueueScheduler("String_Node_Str")).run();
}
Program: 102896
Project: 102896
Buggy source:
@Ignore @Test public void test() throws IOException {
  DiandianBlogProcessor diaoyuwengProcessor=new DiandianBlogProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.create(diaoyuwengProcessor).pipeline(new ConsolePipeline()).pipeline(pipeline).schedular(new FileCacheQueueScheduler("String_Node_Str")).run();
}

Fixed version (ground truth):
@Ignore @Test public void test() throws IOException {
  DiandianBlogProcessor diaoyuwengProcessor=new DiandianBlogProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.create(diaoyuwengProcessor).pipeline(new ConsolePipeline()).pipeline(pipeline).scheduler(new FileCacheQueueScheduler("String_Node_Str")).run();
}
Program: 102897
Project: 102897
Buggy source:
@Ignore @Test public void test() throws IOException {
  DiaoyuwengProcessor diaoyuwengProcessor=new DiaoyuwengProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.create(diaoyuwengProcessor).pipeline(new FilePipeline()).pipeline(pipeline).schedular(new FileCacheQueueScheduler("String_Node_Str")).run();
}

Fixed version (ground truth):
@Ignore @Test public void test() throws IOException {
  DiaoyuwengProcessor diaoyuwengProcessor=new DiaoyuwengProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.create(diaoyuwengProcessor).pipeline(new FilePipeline()).pipeline(pipeline).scheduler(new FileCacheQueueScheduler("String_Node_Str")).run();
}
Program: 102898
Project: 102898
Buggy source:
@Ignore @Test public void test() throws IOException {
  SinaBlogProcesser sinaBlogProcesser=new SinaBlogProcesser();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.create(sinaBlogProcesser).pipeline(new FilePipeline()).pipeline(pipeline).schedular(new FileCacheQueueScheduler("String_Node_Str")).run();
}

Fixed version (ground truth):
@Ignore @Test public void test() throws IOException {
  SinaBlogProcesser sinaBlogProcesser=new SinaBlogProcesser();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.create(sinaBlogProcesser).pipeline(new FilePipeline()).pipeline(pipeline).scheduler(new FileCacheQueueScheduler("String_Node_Str")).run();
}
Program: 102899
Project: 102899
Buggy source:
@Override public void process(Page page,Site site){
  String domain=site.getDomain();
  domain=UrlUtils.getDomain(domain);
  String path=this.path + "String_Node_Str" + domain+ "String_Node_Str";
  try {
    PrintWriter printWriter=new PrintWriter(new FileWriter(path + DigestUtils.md5Hex(page.getUrl().toString()) + "String_Node_Str"));
    template.process(page.getFields(),printWriter);
    printWriter.close();
  }
 catch (  TemplateException e) {
  }
catch (  IOException e) {
  }
}

Fixed version (ground truth):
@Override public void process(Page page,Site site){
  String domain=site.getDomain();
  domain=UrlUtils.getDomain(domain);
  String path=this.path + "String_Node_Str" + domain+ "String_Node_Str";
  File file=new File(path);
  if (!file.exists()) {
    file.mkdir();
  }
  try {
    PrintWriter printWriter=new PrintWriter(new FileWriter(path + DigestUtils.md5Hex(page.getUrl().toString()) + "String_Node_Str"));
    template.process(page.getFields(),printWriter);
    printWriter.close();
  }
 catch (  TemplateException e) {
  }
catch (  IOException e) {
  }
}
Program: 102900
Project: 102900
Buggy source:
@Override public void process(Page page){
  page.addTargetRequests(page.getHtml().rs("String_Node_Str").toStrings());
  page.putField("String_Node_Str",page.getHtml().x("String_Node_Str"));
  page.putField("String_Node_Str",page.getHtml().sc());
  page.putField("String_Node_Str",page.getHtml().x("String_Node_Str").r("String_Node_Str"));
  page.putField("String_Node_Str",page.getHtml().xs("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void process(Page page){
  page.addTargetRequests(page.getHtml().as().rs("String_Node_Str").toStrings());
  page.putField("String_Node_Str",page.getHtml().x("String_Node_Str"));
  page.putField("String_Node_Str",page.getHtml().x("String_Node_Str"));
  page.putField("String_Node_Str",page.getUrl().r("String_Node_Str"));
  page.putField("String_Node_Str",page.getHtml().x("String_Node_Str").r("String_Node_Str"));
}
Program: 102901
Project: 102901
Buggy source:
@Override public Site getSite(){
  return Site.me().setDomain("String_Node_Str").setStartUrl("String_Node_Str").setUserAgent("String_Node_Str");
}

Fixed version (ground truth):
@Override public Site getSite(){
  if (site == null) {
    site=Site.me().setDomain("String_Node_Str").setStartUrl("String_Node_Str").setSleepTime(3000).setUserAgent("String_Node_Str");
  }
  return site;
}
Program: 102902
Project: 102902
Buggy source:
private void init(){
  File file=new File(filePath);
  if (!file.exists()) {
    file.mkdirs();
  }
  readFile();
  initWriter();
  initFlushThread();
  inited.set(true);
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
private void init(Task task){
  this.task=task;
  File file=new File(filePath);
  if (!file.exists()) {
    file.mkdirs();
  }
  readFile();
  initWriter();
  initFlushThread();
  inited.set(true);
  logger.info("String_Node_Str");
}
Program: 102903
Project: 102903
Buggy source:
public FileCacheQueueSchedular(Task task,String filePath){
  this.filePath=filePath;
  this.task=task;
}

Fixed version (ground truth):
public FileCacheQueueSchedular(String filePath){
  this.filePath=filePath;
}
Program: 102904
Project: 102904
Buggy source:
@Override public synchronized Request poll(Task task){
  if (!inited.get()) {
    init();
  }
  fileCursorWriter.println(cursor.incrementAndGet());
  return queue.poll();
}

Fixed version (ground truth):
@Override public synchronized Request poll(Task task){
  if (!inited.get()) {
    init(task);
  }
  fileCursorWriter.println(cursor.incrementAndGet());
  return queue.poll();
}
Program: 102905
Project: 102905
Buggy source:
@Override public synchronized void push(Request request,Task task){
  if (!inited.get()) {
    init();
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + request.getUrl());
  }
  if (urls.add(request.getUrl())) {
    queue.add(request);
    fileUrlWriter.println(request.getUrl());
  }
}

Fixed version (ground truth):
@Override public synchronized void push(Request request,Task task){
  if (!inited.get()) {
    init(task);
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + request.getUrl());
  }
  if (urls.add(request.getUrl())) {
    queue.add(request);
    fileUrlWriter.println(request.getUrl());
  }
}
Program: 102906
Project: 102906
Buggy source:
@Override public void process(Page page,Site site){
  String domain=site.getDomain();
  domain=UrlUtils.getDomain(domain);
  String path=this.path + "String_Node_Str" + domain+ "String_Node_Str";
  File file=new File(path);
  if (!file.exists()) {
    file.mkdirs();
  }
  try {
    PrintWriter printWriter=new PrintWriter(new FileWriter(path + DigestUtils.md5Hex(page.getUrl().toString()) + "String_Node_Str"));
    template.process(page.getFields(),printWriter);
    printWriter.close();
  }
 catch (  TemplateException e) {
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void process(Page page,Task task){
  String path=this.path + "String_Node_Str" + task.getUUID()+ "String_Node_Str";
  File file=new File(path);
  if (!file.exists()) {
    file.mkdirs();
  }
  try {
    PrintWriter printWriter=new PrintWriter(new FileWriter(path + DigestUtils.md5Hex(page.getUrl().toString()) + "String_Node_Str"));
    template.process(page.getFields(),printWriter);
    printWriter.close();
  }
 catch (  TemplateException e) {
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 102907
Project: 102907
Buggy source:
@Ignore @Test public void testGlobalSpider(){
  SimplePageProcessor pageProcessor2=new SimplePageProcessor("String_Node_Str","String_Node_Str");
  System.out.println(pageProcessor2.getSite().getEncoding());
  pageProcessor2.getSite().setSleepTime(500);
  Spider.me().pipeline(new FilePipeline()).schedular(new FileCacheQueueSchedular(pageProcessor2.getSite(),"String_Node_Str")).processor(pageProcessor2).run();
}

Fixed version (ground truth):
@Ignore @Test public void testGlobalSpider(){
  SimplePageProcessor pageProcessor2=new SimplePageProcessor("String_Node_Str","String_Node_Str");
  System.out.println(pageProcessor2.getSite().getEncoding());
  pageProcessor2.getSite().setSleepTime(500);
  Spider.me().pipeline(new FilePipeline()).schedular(new FileCacheQueueSchedular("String_Node_Str")).processor(pageProcessor2).run();
}
Program: 102908
Project: 102908
Buggy source:
@Ignore @Test public void test() throws IOException {
  DiandianBlogProcessor diaoyuwengProcessor=new DiandianBlogProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.me().pipeline(new ConsolePipeline()).pipeline(pipeline).schedular(new FileCacheQueueSchedular(diaoyuwengProcessor.getSite(),"String_Node_Str")).processor(diaoyuwengProcessor).run();
}

Fixed version (ground truth):
@Ignore @Test public void test() throws IOException {
  DiandianBlogProcessor diaoyuwengProcessor=new DiandianBlogProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.me().pipeline(new ConsolePipeline()).pipeline(pipeline).schedular(new FileCacheQueueSchedular("String_Node_Str")).processor(diaoyuwengProcessor).run();
}
Program: 102909
Project: 102909
Buggy source:
@Test public void test() throws IOException {
  DiaoyuwengProcessor diaoyuwengProcessor=new DiaoyuwengProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.me().pipeline(new FilePipeline()).pipeline(pipeline).schedular(new FileCacheQueueSchedular(diaoyuwengProcessor.getSite(),"String_Node_Str")).processor(diaoyuwengProcessor).run();
}

Fixed version (ground truth):
@Ignore @Test public void test() throws IOException {
  DiaoyuwengProcessor diaoyuwengProcessor=new DiaoyuwengProcessor();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.me().pipeline(new FilePipeline()).pipeline(pipeline).schedular(new FileCacheQueueSchedular("String_Node_Str")).processor(diaoyuwengProcessor).run();
}
Program: 102910
Project: 102910
Buggy source:
@Ignore @Test public void test() throws IOException {
  SinaBlogProcesser sinaBlogProcesser=new SinaBlogProcesser();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.me().pipeline(new FilePipeline()).pipeline(pipeline).schedular(new FileCacheQueueSchedular(sinaBlogProcesser.getSite(),"String_Node_Str")).processor(sinaBlogProcesser).run();
}

Fixed version (ground truth):
@Ignore @Test public void test() throws IOException {
  SinaBlogProcesser sinaBlogProcesser=new SinaBlogProcesser();
  FreemarkerPipeline pipeline=new FreemarkerPipeline("String_Node_Str");
  Spider.me().pipeline(new FilePipeline()).pipeline(pipeline).schedular(new FileCacheQueueSchedular("String_Node_Str")).processor(sinaBlogProcesser).run();
}
Program: 102911
Project: 102911
Buggy source:
@Override public Page download(Request request,Site site){
  logger.info("String_Node_Str" + request.getUrl());
  HttpClient httpClient=HttpClientPool.getInstance().getClient(site);
  try {
    HttpGet httpGet=new HttpGet(request.getUrl());
    HttpResponse httpResponse=httpClient.execute(httpGet);
    int statusCode=httpResponse.getStatusLine().getStatusCode();
    if (site.getAcceptStatCode().contains(statusCode)) {
      String content=IOUtils.toString(httpResponse.getEntity().getContent(),site.getEncoding() == null ? httpResponse.getEntity().getContentType().getValue() : site.getEncoding());
      Page page=new Page();
      page.setHtml(new Html(UrlUtils.fixAllRelativeHrefs(content,request.getUrl())));
      page.setUrl(new PlainText(request.getUrl()));
      page.setRequest(request);
      return page;
    }
 else {
      logger.warn("String_Node_Str" + statusCode);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + request.getUrl() + "String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@Override public Page download(Request request,Site site){
  logger.info("String_Node_Str" + request.getUrl());
  HttpClient httpClient=HttpClientPool.getInstance().getClient(site);
  try {
    HttpGet httpGet=new HttpGet(request.getUrl());
    HttpResponse httpResponse=httpClient.execute(httpGet);
    int statusCode=httpResponse.getStatusLine().getStatusCode();
    if (site.getAcceptStatCode().contains(statusCode)) {
      if (site.getEncoding() == null) {
        String value=httpResponse.getEntity().getContentType().getValue();
        site.setEncoding(new PlainText(value).r("String_Node_Str").toString());
      }
      String content=IOUtils.toString(httpResponse.getEntity().getContent(),site.getEncoding());
      Page page=new Page();
      page.setHtml(new Html(UrlUtils.fixAllRelativeHrefs(content,request.getUrl())));
      page.setUrl(new PlainText(request.getUrl()));
      page.setRequest(request);
      return page;
    }
 else {
      logger.warn("String_Node_Str" + statusCode);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + request.getUrl() + "String_Node_Str",e);
  }
  return null;
}
Program: 102912
Project: 102912
Buggy source:
/** 
 * Emits an event with an acknowledge.
 * @param event an event name
 * @param args data to send.
 * @param ack the acknowledgement to be called
 * @return a reference to this object.
 */
public Emitter emit(final String event,final Object[] args,final Ack ack){
  EventThread.exec(new Runnable(){
    @Override public void run(){
      List<Object> _args=new ArrayList<Object>(){
{
          add(event);
          addAll(Arrays.asList(args));
        }
      }
;
      Packet packet=new Packet(Parser.EVENT,toJsonArray(_args));
      logger.fine(String.format("String_Node_Str",ids));
      Socket.this.acks.put(ids,ack);
      packet.id=ids++;
      Socket.this.packet(packet);
    }
  }
);
  return this;
}

Fixed version (ground truth):
/** 
 * Emits an event with an acknowledge.
 * @param event an event name
 * @param args data to send.
 * @param ack the acknowledgement to be called
 * @return a reference to this object.
 */
public Emitter emit(final String event,final Object[] args,final Ack ack){
  EventThread.exec(new Runnable(){
    @Override public void run(){
      List<Object> _args=new ArrayList<Object>(){
{
          add(event);
          if (args != null) {
            addAll(Arrays.asList(args));
          }
        }
      }
;
      Packet packet=new Packet(Parser.EVENT,toJsonArray(_args));
      logger.fine(String.format("String_Node_Str",ids));
      Socket.this.acks.put(ids,ack);
      packet.id=ids++;
      Socket.this.packet(packet);
    }
  }
);
  return this;
}
Program: 102913
Project: 102913
Buggy source:
@Override public void call(Object... args){
  System.out.println(String.format("String_Node_Str",args));
  events.offer(args);
}

Fixed version (ground truth):
@Override public void call(Object... args){
  System.out.println("String_Node_Str" + args);
  events.offer(args);
}
Program: 102916
Project: 102916
Buggy source:
/** 
 * Returns the tool tip opened on mouse over.
 * @return the tool tip opened on mouse over
 */
@Override public ExtendedTooltip getToolTip(){
  ExtendedTooltip tip=new ExtendedTooltip(true);
  byte[] avatarImage=metaContact.getAvatar();
  if (avatarImage != null && avatarImage.length > 0)   tip.setImage(new ImageIcon(avatarImage));
  tip.setTitle(metaContact.getDisplayName());
  loadTooltip(tip);
  return tip;
}

Fixed version (ground truth):
/** 
 * Returns the tool tip opened on mouse over.
 * @return the tool tip opened on mouse over
 */
@Override public ExtendedTooltip getToolTip(){
  ExtendedTooltip tip=new ExtendedTooltip(true);
  tip.setImage(getScaledAvatar(false,30,30));
  tip.setTitle(metaContact.getDisplayName());
  loadTooltip(tip);
  return tip;
}
Program: 102918
Project: 102918
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public IQ parseIQ(XmlPullParser parser) throws Exception {
  String namespace=parser.getNamespace();
  if (!JibriIq.NAMESPACE.equals(namespace)) {
    return null;
  }
  String rootElement=parser.getName();
  JibriIq iq;
  if (JibriIq.ELEMENT_NAME.equals(rootElement)) {
    iq=new JibriIq();
    String action=parser.getAttributeValue("String_Node_Str",JibriIq.ACTION_ATTR_NAME);
    iq.setAction(JibriIq.Action.parse(action));
    String status=parser.getAttributeValue("String_Node_Str",JibriIq.STATUS_ATTR_NAME);
    iq.setStatus(JibriIq.Status.parse(status));
    String url=parser.getAttributeValue("String_Node_Str",JibriIq.URL_ATTR_NAME);
    if (!StringUtils.isNullOrEmpty(url))     iq.setUrl(url);
    String streamId=parser.getAttributeValue("String_Node_Str",JibriIq.STREAM_ID_ATTR_NAME);
    if (!StringUtils.isNullOrEmpty(streamId))     iq.setStreamId(streamId);
    String followEntity=parser.getAttributeValue("String_Node_Str",JibriIq.FOLLOW_ENTITY_ATTR_NAME);
    if (!StringUtils.isNullOrEmpty(followEntity))     iq.setFollowEntity(followEntity);
  }
 else {
    return null;
  }
  boolean done=false;
  while (!done) {
switch (parser.next()) {
case XmlPullParser.END_TAG:
{
        String name=parser.getName();
        if (rootElement.equals(name)) {
          done=true;
        }
        break;
      }
  }
}
return iq;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public IQ parseIQ(XmlPullParser parser) throws Exception {
  String namespace=parser.getNamespace();
  if (!JibriIq.NAMESPACE.equals(namespace)) {
    return null;
  }
  String rootElement=parser.getName();
  JibriIq iq;
  if (JibriIq.ELEMENT_NAME.equals(rootElement)) {
    iq=new JibriIq();
    String action=parser.getAttributeValue("String_Node_Str",JibriIq.ACTION_ATTR_NAME);
    iq.setAction(JibriIq.Action.parse(action));
    String status=parser.getAttributeValue("String_Node_Str",JibriIq.STATUS_ATTR_NAME);
    iq.setStatus(JibriIq.Status.parse(status));
    String url=parser.getAttributeValue("String_Node_Str",JibriIq.URL_ATTR_NAME);
    if (!StringUtils.isNullOrEmpty(url))     iq.setUrl(url);
    String streamId=parser.getAttributeValue("String_Node_Str",JibriIq.STREAM_ID_ATTR_NAME);
    if (!StringUtils.isNullOrEmpty(streamId))     iq.setStreamId(streamId);
  }
 else {
    return null;
  }
  boolean done=false;
  while (!done) {
switch (parser.next()) {
case XmlPullParser.END_TAG:
{
        String name=parser.getName();
        if (rootElement.equals(name)) {
          done=true;
        }
        break;
      }
  }
}
return iq;
}
Program: 102919
Project: 102919
Buggy source:
/** 
 * Removes from the specified list of candidates providers connected to a registrar that does not match the IP address that we are receiving a request from.
 * @param candidates the list of providers we've like to filter.
 * @param request the request that we are currently dispatching
 */
private void filterByAddress(List<ProtocolProviderServiceSipImpl> candidates,Request request){
  Iterator<ProtocolProviderServiceSipImpl> iterPP=candidates.iterator();
  while (iterPP.hasNext()) {
    ProtocolProviderServiceSipImpl candidate=iterPP.next();
    if (candidate.getAccountID().getAccountPropertyBoolean(ProtocolProviderFactory.FORCE_PROXY_BYPASS,false)) {
      continue;
    }
    if (candidate.getRegistrarConnection() == null) {
      continue;
    }
    if (!candidate.getRegistrarConnection().isRegistrarless() && !candidate.getRegistrarConnection().isRequestFromSameConnection(request)) {
      iterPP.remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Removes from the specified list of candidates providers connected to a registrar that does not match the IP address that we are receiving a request from.
 * @param candidates the list of providers we've like to filter.
 * @param request the request that we are currently dispatching
 */
private void filterByAddress(List<ProtocolProviderServiceSipImpl> candidates,Request request){
  Iterator<ProtocolProviderServiceSipImpl> iterPP=candidates.iterator();
  while (iterPP.hasNext()) {
    ProtocolProviderServiceSipImpl candidate=iterPP.next();
    boolean forceProxyBypass=candidate.getAccountID().getAccountPropertyBoolean(ProtocolProviderFactory.FORCE_PROXY_BYPASS,false);
    if (forceProxyBypass) {
      continue;
    }
    if (candidate.getRegistrarConnection() == null) {
      continue;
    }
    if (!candidate.getRegistrarConnection().isRegistrarless() && !candidate.getRegistrarConnection().isRequestFromSameConnection(request)) {
      iterPP.remove();
    }
  }
}
Program: 102920
Project: 102920
Buggy source:
/** 
 * Indicates if the proxy force bypass-configure is enabled. * @return <tt>true</tt> if the proxy force bypass-configuration is enabled, <tt>false</tt> - otherwise
 */
boolean isProxyForceBypassConfigureEnabled(){
  return proxyAutoCheckBox.isSelected();
}

Fixed version (ground truth):
/** 
 * Indicates if the proxy force bypass-configure is enabled. * @return <tt>true</tt> if the proxy force bypass-configuration is enabled, <tt>false</tt> - otherwise
 */
boolean isProxyForceBypassConfigureEnabled(){
  return proxyForceBypassCheckBox.isSelected();
}
Program: 102923
Project: 102923
Buggy source:
/** 
 * @param name the name to set
 */
public void setName(String name){
  this.name=name;
}

Fixed version (ground truth):
/** 
 * @param name the name to set
 */
public void setName(String name){
  setAttribute(NAME_ATTR_NAME,name);
}
Program: 102924
Project: 102924
Buggy source:
/** 
 * @return the value
 */
public Object getValue(){
  return value;
}

Fixed version (ground truth):
/** 
 * @return the value
 */
public Object getValue(){
  return getAttribute(VALUE_ATTR_NAME);
}
Program: 102925
Project: 102925
Buggy source:
/** 
 * @return the name
 */
public String getName(){
  return name;
}

Fixed version (ground truth):
/** 
 * @return the name
 */
public String getName(){
  return getAttributeAsString(NAME_ATTR_NAME);
}
Program: 102926
Project: 102926
Buggy source:
/** 
 * @param value the value to set
 */
public void setValue(Object value){
  this.value=value;
}

Fixed version (ground truth):
/** 
 * @param value the value to set
 */
public void setValue(Object value){
  setAttribute(VALUE_ATTR_NAME,value);
}
Program: 102927
Project: 102927
Buggy source:
/** 
 * Starts the configuration service
 * @param bundleContext the <tt>BundleContext</tt> as provided by the OSGiframework.
 * @throws Exception if anything goes wrong
 */
public void start(BundleContext bundleContext) throws Exception {
  FileAccessService fas=ServiceUtils.getService(bundleContext,FileAccessService.class);
  if (fas != null) {
    File useDatabaseConfig;
    try {
      useDatabaseConfig=fas.getPrivatePersistentFile("String_Node_Str",FileCategory.PROFILE);
    }
 catch (    IllegalStateException ise) {
      useDatabaseConfig=null;
    }
    if ((useDatabaseConfig != null) && useDatabaseConfig.exists()) {
      logger.info("String_Node_Str");
      this.cs=new JdbcConfigService(fas);
    }
  }
  if (this.cs == null)   this.cs=LibJitsi.getConfigurationService();
  bundleContext.registerService(ConfigurationService.class.getName(),this.cs,null);
  fixPermissions(this.cs);
}

Fixed version (ground truth):
/** 
 * Starts the configuration service
 * @param bundleContext the <tt>BundleContext</tt> as provided by the OSGiframework.
 * @throws Exception if anything goes wrong
 */
public void start(BundleContext bundleContext) throws Exception {
  FileAccessService fas=ServiceUtils.getService(bundleContext,FileAccessService.class);
  if (fas != null) {
    File useDatabaseConfig;
    try {
      useDatabaseConfig=fas.getPrivatePersistentFile("String_Node_Str",FileCategory.PROFILE);
    }
 catch (    Exception ise) {
      useDatabaseConfig=null;
    }
    if ((useDatabaseConfig != null) && useDatabaseConfig.exists()) {
      logger.info("String_Node_Str");
      this.cs=new JdbcConfigService(fas);
    }
  }
  if (this.cs == null)   this.cs=LibJitsi.getConfigurationService();
  bundleContext.registerService(ConfigurationService.class.getName(),this.cs,null);
  fixPermissions(this.cs);
}
Program: 102930
Project: 102930
Buggy source:
/** 
 * Issue a command representing a command interaction with IRC server.
 * @param source Source contact or chat room from which the message is sent.
 * @param message Command message
 */
private void command(final String source,final String message) throws UnsupportedCommandException {
  final String msg=message.toLowerCase();
  final int end=msg.indexOf(' ');
  final String command;
  if (end == -1) {
    command=msg;
  }
 else {
    command=message.substring(1,end);
  }
  final Command cmd=this.commandFactory.createCommand(command);
  cmd.execute(source,msg);
}

Fixed version (ground truth):
/** 
 * Issue a command representing a command interaction with IRC server.
 * @param source Source contact or chat room from which the message is sent.
 * @param message Command message
 */
private void command(final String source,final String message) throws UnsupportedCommandException {
  final String msg=message.toLowerCase();
  final int end=msg.indexOf(' ');
  final String command;
  if (end == -1) {
    command=msg.substring(START_OF_COMMAND_INDEX);
  }
 else {
    command=message.substring(START_OF_COMMAND_INDEX,end);
  }
  final Command cmd=this.commandFactory.createCommand(command);
  cmd.execute(source,msg);
}
Program: 102931
Project: 102931
Buggy source:
/** 
 * Handles newly added providers.
 * @param pps
 */
void handleProviderAdded(ProtocolProviderService pps){
  pps.addRegistrationStateChangeListener(this);
  if (pps.isRegistered()) {
    handleProviderRegistered(pps);
  }
}

Fixed version (ground truth):
/** 
 * Handles newly added providers.
 * @param pps
 */
void handleProviderAdded(ProtocolProviderService pps){
  pps.addRegistrationStateChangeListener(this);
  if (pps.isRegistered()) {
    handleProviderRegistered(pps,false);
  }
}
Program: 102932
Project: 102932
Buggy source:
/** 
 * Handles registered providers. If provider has a stored last status publish that status, otherwise we just publish that they are Online/Available/
 * @param pps the provider
 */
private void handleProviderRegistered(ProtocolProviderService pps){
  PresenceStatus status=getLastPresenceStatus(pps);
  if (status == null) {
    status=AccountStatusUtils.getOnlineStatus(pps);
  }
  if (status != null && status.getStatus() >= PresenceStatus.ONLINE_THRESHOLD) {
    publishStatus(pps,status);
  }
}

Fixed version (ground truth):
/** 
 * Handles registered providers. If provider has a stored last status publish that status, otherwise we just publish that they are Online/Available/
 * @param pps the provider
 */
private void handleProviderRegistered(ProtocolProviderService pps,boolean dueToRegistrationStateChanged){
  PresenceStatus status=getLastPresenceStatus(pps);
  if (status == null) {
    status=AccountStatusUtils.getOnlineStatus(pps);
  }
  if (status != null && status.getStatus() >= PresenceStatus.ONLINE_THRESHOLD) {
    publishStatusInternal(pps,status,dueToRegistrationStateChanged);
  }
}
Program: 102933
Project: 102933
Buggy source:
/** 
 * Waits for providers to register and then checks for its last status saved if any and used it to restore its status.
 * @param evt a <tt>RegistrationStateChangeEvent</tt> which describes the
 */
@Override public void registrationStateChanged(RegistrationStateChangeEvent evt){
  if (!evt.getNewState().equals(RegistrationState.REGISTERED))   return;
  handleProviderRegistered(evt.getProvider());
}

Fixed version (ground truth):
/** 
 * Waits for providers to register and then checks for its last status saved if any and used it to restore its status.
 * @param evt a <tt>RegistrationStateChangeEvent</tt> which describes the
 */
@Override public void registrationStateChanged(RegistrationStateChangeEvent evt){
  if (!evt.getNewState().equals(RegistrationState.REGISTERED))   return;
  handleProviderRegistered(evt.getProvider(),true);
}
Program: 102934
Project: 102934
Buggy source:
/** 
 * Creates an instance of this peer and scans <tt>bundleContext</tt> for all existing <tt>UriHandler</tt>
 * @param bundleContext a reference to a currently valid instance of abundle context.
 */
public ArgDelegationPeerImpl(BundleContext bundleContext){
  Collection<ServiceReference<UriHandler>> uriHandlerRefs;
  try {
    uriHandlerRefs=bundleContext.getServiceReferences(UriHandler.class,null);
  }
 catch (  InvalidSyntaxException ex) {
    if (logger.isInfoEnabled()) {
      logger.info("String_Node_Str",ex);
    }
    return;
  }
  if ((uriHandlerRefs == null) || uriHandlerRefs.isEmpty()) {
    return;
  }
synchronized (uriHandlers) {
    for (    ServiceReference<UriHandler> uriHandlerRef : uriHandlerRefs) {
      UriHandler uriHandler=bundleContext.getService(uriHandlerRef);
      uriHandlers.put(uriHandler.getProtocol(),uriHandler);
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates an instance of this peer and scans <tt>bundleContext</tt> for all existing <tt>UriHandler</tt>
 * @param bundleContext a reference to a currently valid instance of abundle context.
 */
public ArgDelegationPeerImpl(BundleContext bundleContext){
  Collection<ServiceReference<UriHandler>> uriHandlerRefs=ServiceUtils.getServiceReferences(bundleContext,UriHandler.class);
  if (!uriHandlerRefs.isEmpty()) {
synchronized (uriHandlers) {
      for (      ServiceReference<UriHandler> uriHandlerRef : uriHandlerRefs) {
        UriHandler uriHandler=bundleContext.getService(uriHandlerRef);
        uriHandlers.put(uriHandler.getProtocol(),uriHandler);
      }
    }
  }
}
Program: 102935
Project: 102935
Buggy source:
/** 
 * Returns all <tt>ProtocolProviderFactory</tt>s obtained from the bundle context.
 * @return all <tt>ProtocolProviderFactory</tt>s obtained from the bundlecontext
 */
public static Map<Object,ProtocolProviderFactory> getProtocolProviderFactories(){
  Collection<ServiceReference<ProtocolProviderFactory>> serRefs;
  try {
    serRefs=bundleContext.getServiceReferences(ProtocolProviderFactory.class,null);
  }
 catch (  InvalidSyntaxException e) {
    serRefs=null;
    logger.error("String_Node_Str" + e);
  }
  if (serRefs != null) {
    for (    ServiceReference<ProtocolProviderFactory> serRef : serRefs) {
      ProtocolProviderFactory providerFactory=bundleContext.getService(serRef);
      providerFactoriesMap.put(serRef.getProperty(ProtocolProviderFactory.PROTOCOL),providerFactory);
    }
  }
  return providerFactoriesMap;
}

Fixed version (ground truth):
/** 
 * Returns all <tt>ProtocolProviderFactory</tt>s obtained from the bundle context.
 * @return all <tt>ProtocolProviderFactory</tt>s obtained from the bundlecontext
 */
public static Map<Object,ProtocolProviderFactory> getProtocolProviderFactories(){
  Collection<ServiceReference<ProtocolProviderFactory>> serRefs=ServiceUtils.getServiceReferences(bundleContext,ProtocolProviderFactory.class);
  if (!serRefs.isEmpty()) {
    for (    ServiceReference<ProtocolProviderFactory> serRef : serRefs) {
      ProtocolProviderFactory providerFactory=bundleContext.getService(serRef);
      providerFactoriesMap.put(serRef.getProperty(ProtocolProviderFactory.PROTOCOL),providerFactory);
    }
  }
  return providerFactoriesMap;
}