Program: 88998
Project: 88998
Buggy source:
@Security.Authenticated(Secured.class) public static Result search(int page) throws ExecutionException, InterruptedException {
  Navigation.set("String_Node_Str");
  Account currentAccount=Component.currentAccount();
  String keyword=Form.form().bindFromRequest().field("String_Node_Str").value();
  String mode=Form.form().bindFromRequest().field("String_Node_Str").value();
  if (keyword == null) {
    flash("String_Node_Str","String_Node_Str");
    return redirect(routes.Application.searchHome());
  }
  if (mode == null)   mode="String_Node_Str";
  Pattern pt=Pattern.compile("String_Node_Str");
  Matcher match=pt.matcher(keyword);
  while (match.find()) {
    String s=match.group();
    keyword=keyword.replaceAll("String_Node_Str" + s,"String_Node_Str");
    flash("String_Node_Str","String_Node_Str");
  }
  Logger.info(currentAccount.id + "String_Node_Str" + keyword+ "String_Node_Str"+ mode);
  List<Object> resultList=new ArrayList<>();
  SearchResponse response;
  long userCount=0;
  long groupCount=0;
  long postCount=0;
  try {
    response=ElasticsearchService.doSearch("String_Node_Str",keyword.toLowerCase(),mode,page,currentAccount.id.toString(),asList("String_Node_Str","String_Node_Str","String_Node_Str"),asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  }
 catch (  NoNodeAvailableException nna) {
    flash("String_Node_Str","String_Node_Str");
    return ok(search.render());
  }
  for (  SearchHit searchHit : response.getHits().getHits()) {
switch (searchHit.type()) {
case "String_Node_Str":
      resultList.add(Account.findById(Long.parseLong(searchHit.getId())));
    break;
case "String_Node_Str":
  Post post=Post.findById(Long.parseLong(searchHit.getId()));
String searchContent=post.content;
if (!searchHit.getHighlightFields().isEmpty()) searchContent=searchHit.getHighlightFields().get("String_Node_Str").getFragments()[0].string();
post.searchContent=StringEscapeUtils.escapeHtml4(searchContent).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
resultList.add(post);
break;
case "String_Node_Str":
resultList.add(Group.findById(Long.parseLong(searchHit.getId())));
break;
default :
Logger.info("String_Node_Str" + searchHit.getId());
}
}
Terms terms=response.getAggregations().get("String_Node_Str");
Collection<Terms.Bucket> buckets=terms.getBuckets();
for (Terms.Bucket bucket : buckets) {
switch (bucket.getKey()) {
case "String_Node_Str":
userCount=bucket.getDocCount();
break;
case "String_Node_Str":
groupCount=bucket.getDocCount();
break;
case "String_Node_Str":
postCount=bucket.getDocCount();
break;
}
}
Logger.info("String_Node_Str" + userCount + "String_Node_Str"+ groupCount+ "String_Node_Str"+ postCount+ "String_Node_Str");
return ok(views.html.searchresult.render(keyword,mode,page,LIMIT,resultList,response.getTookInMillis(),userCount + groupCount + postCount,userCount,groupCount,postCount));
}

Fixed version (ground truth):
@Security.Authenticated(Secured.class) public static Result search(int page) throws ExecutionException, InterruptedException {
  Navigation.set(Level.SEARCH);
  Account currentAccount=Component.currentAccount();
  String keyword=Form.form().bindFromRequest().field("String_Node_Str").value();
  String mode=Form.form().bindFromRequest().field("String_Node_Str").value();
  if (keyword == null) {
    flash("String_Node_Str","String_Node_Str");
    return redirect(routes.Application.searchHome());
  }
  if (mode == null)   mode="String_Node_Str";
  Pattern pt=Pattern.compile("String_Node_Str");
  Matcher match=pt.matcher(keyword);
  while (match.find()) {
    String s=match.group();
    keyword=keyword.replaceAll("String_Node_Str" + s,"String_Node_Str");
    flash("String_Node_Str","String_Node_Str");
  }
  Logger.info(currentAccount.id + "String_Node_Str" + keyword+ "String_Node_Str"+ mode);
  List<Object> resultList=new ArrayList<>();
  SearchResponse response;
  long userCount=0;
  long groupCount=0;
  long postCount=0;
  try {
    response=ElasticsearchService.doSearch("String_Node_Str",keyword.toLowerCase(),mode,page,currentAccount.id.toString(),asList("String_Node_Str","String_Node_Str","String_Node_Str"),asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  }
 catch (  NoNodeAvailableException nna) {
    flash("String_Node_Str","String_Node_Str");
    return ok(search.render());
  }
  for (  SearchHit searchHit : response.getHits().getHits()) {
switch (searchHit.type()) {
case "String_Node_Str":
      resultList.add(Account.findById(Long.parseLong(searchHit.getId())));
    break;
case "String_Node_Str":
  Post post=Post.findById(Long.parseLong(searchHit.getId()));
String searchContent=post.content;
if (!searchHit.getHighlightFields().isEmpty()) searchContent=searchHit.getHighlightFields().get("String_Node_Str").getFragments()[0].string();
post.searchContent=StringEscapeUtils.escapeHtml4(searchContent).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
resultList.add(post);
break;
case "String_Node_Str":
resultList.add(Group.findById(Long.parseLong(searchHit.getId())));
break;
default :
Logger.info("String_Node_Str" + searchHit.getId());
}
}
Terms terms=response.getAggregations().get("String_Node_Str");
Collection<Terms.Bucket> buckets=terms.getBuckets();
for (Terms.Bucket bucket : buckets) {
switch (bucket.getKey()) {
case "String_Node_Str":
userCount=bucket.getDocCount();
break;
case "String_Node_Str":
groupCount=bucket.getDocCount();
break;
case "String_Node_Str":
postCount=bucket.getDocCount();
break;
}
}
Logger.info("String_Node_Str" + userCount + "String_Node_Str"+ groupCount+ "String_Node_Str"+ postCount+ "String_Node_Str");
return ok(views.html.searchresult.render(keyword,mode,page,LIMIT,resultList,response.getTookInMillis(),userCount + groupCount + postCount,userCount,groupCount,postCount));
}