nus-yam/ex-repair huggingface dataset:
Program: 9652
Project: 9652
Buggy source:
public List<String> convertFeatureString2Classes(String productdesc){
  List<String> classes=new ArrayList<String>();
  String[] features=productdesc.split("String_Node_Str");
  String cpu=features[0].trim();
  String ram=features[1].trim();
  ram=ram.substring(0,ram.indexOf("String_Node_Str") + 2);
  add(classes,ramMap,ram);
  try {
    String hd=features[2].trim();
    if (hd.contains("String_Node_Str")) {
      classes.add(prefix + "String_Node_Str");
    }
 else     if (hd.contains("String_Node_Str")) {
      classes.add(prefix + "String_Node_Str");
    }
 else {
      classes.add(prefix + "String_Node_Str");
    }
    hd=hd.substring(0,hd.indexOf("String_Node_Str") + 2);
    add(classes,hdMap,hd);
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + features[2].trim());
  }
  String disc=features[3].trim();
  add(classes,discMap,disc);
  int x=6;
  while (!features[x].contains("String_Node_Str")) {
    x++;
  }
  return classes;
}

Fixed version (ground truth):
public List<String> convertFeatureString2Classes(String productdesc){
  List<String> classes=new ArrayList<String>();
  String[] features=productdesc.split("String_Node_Str");
  String cpu=features[0].trim();
  String ram=features[1].trim();
  ram=ram.substring(0,ram.indexOf("String_Node_Str") + 2);
  add(classes,ramMap,ram);
  try {
    String hd=features[2].trim();
    if (hd.contains("String_Node_Str")) {
      classes.add(prefix + "String_Node_Str");
    }
 else     if (hd.contains("String_Node_Str")) {
      classes.add(prefix + "String_Node_Str");
    }
 else {
      classes.add(prefix + "String_Node_Str");
    }
    hd=hd.substring(0,hd.indexOf("String_Node_Str") + 2);
    add(classes,hdMap,hd);
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + features[2].trim());
  }
  String disc=features[3].trim();
  add(classes,discMap,disc);
  int x=6;
  while (!features[x].contains("String_Node_Str")) {
    x++;
  }
  String[] display=features[x++].split("String_Node_Str");
  classes.add(prefix + "String_Node_Str" + display[0].replace("String_Node_Str","String_Node_Str"));
  return classes;
}
Program: 9654
Project: 9654
Buggy source:
public DBpediaClassesSolrIndexCreator(){
  try {
    solr=getEmbeddedSolrServer();
  }
 catch (  CorruptIndexException e) {
    e.printStackTrace();
  }
catch (  LockObtainFailedException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
  initDocument();
}

Fixed version (ground truth):
public DBpediaClassesSolrIndexCreator(){
  try {
    solr=getEmbeddedSolrServer();
  }
 catch (  CorruptIndexException e) {
    e.printStackTrace();
  }
catch (  LockObtainFailedException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
  initDocument();
  docs=new HashSet<SolrInputDocument>();
}
Program: 9655
Project: 9655
Buggy source:
public String getQuestion(List<String> posExamples,List<String> negExamples) throws QTLException {
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  posExampleTrees.addAll(getQueryTrees(posExamples));
  negExampleTrees.addAll(getQueryTrees(negExamples));
  if (negExamples.isEmpty()) {
    QueryTree<String> dummyNegTree=new QueryTreeImpl<String>("String_Node_Str");
    dummyNegTree.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
    negExampleTrees.add(dummyNegTree);
  }
  lgg=lggGenerator.getLGG(posExampleTrees);
  if (queryTreeFilter != null) {
    lgg=queryTreeFilter.getFilteredQueryTree(lgg);
  }
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + lgg.getStringRepresentation());
  }
  if (coversNegativeQueryTree(lgg)) {
    throw new QTLException("String_Node_Str");
  }
  lggInstances=getResources(lgg);
  nbr.setLGGInstances(lggInstances);
  String question=nbr.getQuestion(lgg,negExampleTrees,getKnownResources());
  return question;
}

Fixed version (ground truth):
public String getQuestion(List<String> posExamples,List<String> negExamples) throws QTLException {
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  posExampleTrees.clear();
  negExampleTrees.clear();
  posExampleTrees.addAll(getQueryTrees(posExamples));
  negExampleTrees.addAll(getQueryTrees(negExamples));
  if (negExamples.isEmpty()) {
    QueryTree<String> dummyNegTree=new QueryTreeImpl<String>("String_Node_Str");
    dummyNegTree.addChild(new QueryTreeImpl<String>("String_Node_Str"),"String_Node_Str");
    negExampleTrees.add(dummyNegTree);
  }
  lgg=lggGenerator.getLGG(posExampleTrees);
  if (queryTreeFilter != null) {
    lgg=queryTreeFilter.getFilteredQueryTree(lgg);
  }
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + lgg.getStringRepresentation());
  }
  if (coversNegativeQueryTree(lgg)) {
    throw new QTLException("String_Node_Str");
  }
  lggInstances=getResources(lgg);
  nbr.setLGGInstances(lggInstances);
  String question=nbr.getQuestion(lgg,negExampleTrees,getKnownResources());
  return question;
}
Program: 9656
Project: 9656
Buggy source:
public Example getSimilarExample(List<String> posExamples,List<String> negExamples) throws SPARQLQueryException {
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + posExamples);
  logger.info("String_Node_Str" + negExamples);
  if (negExamples.isEmpty()) {
  }
  try {
    Example example=exampleFinder.findSimilarExample(posExamples,negExamples);
    return example;
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.error(e);
    throw new SPARQLQueryException(exampleFinder.getCurrentQueryHTML());
  }
}

Fixed version (ground truth):
public Example getSimilarExample(List<String> posExamples,List<String> negExamples) throws SPARQLQueryException {
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + posExamples);
  logger.info("String_Node_Str" + negExamples);
  if (negExamples.isEmpty()) {
  }
  try {
    Example example=exampleFinder.findSimilarExample(posExamples,negExamples);
    examplesCache.put(example.getURI(),example);
    return example;
  }
 catch (  Exception e) {
    e.printStackTrace();
    logger.error(e);
    throw new SPARQLQueryException(exampleFinder.getCurrentQueryHTML());
  }
}
Program: 9657
Project: 9657
Buggy source:
private void put(String question,String query,String endpoint,List<Example> posExamples,List<Example> negExamples,Example lastSuggestedExample){
  System.out.println(posExamples);
  System.out.println(negExamples);
  try {
    StoredSPARQLQuery storedQuery=new StoredSPARQLQuery(question,query,HTMLUtils.encodeHTML(query),endpoint,posExamples,negExamples,lastSuggestedExample);
    question2QueryMap.put(question,storedQuery.toStoredSPARQLQuerySer());
    saveMap();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void put(String question,String query,String endpoint,List<Example> posExamples,List<Example> negExamples,Example lastSuggestedExample){
  try {
    StoredSPARQLQuery storedQuery=new StoredSPARQLQuery(question,query,HTMLUtils.encodeHTML(query),endpoint,posExamples,negExamples,lastSuggestedExample);
    question2QueryMap.put(question,storedQuery.toStoredSPARQLQuerySer());
    saveMap();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 9658
Project: 9658
Buggy source:
@Override protected void initialize(){
  mainPanel=new LayoutContainer(new RowLayout(Orientation.VERTICAL));
  BorderLayoutData data=new BorderLayoutData(LayoutRegion.CENTER);
  data.setMargins(new Margins(5,5,5,0));
  queryField=new HTML();
  mainPanel.add(queryField,new RowData(1,-1));
  resultPanel=new SPARQLQueryResultPanel(true);
  mainPanel.add(resultPanel,new RowData(1,0.7));
  Button editButton=new Button("String_Node_Str");
  editButton.addSelectionListener(new SelectionListener<ButtonEvent>(){
    @Override public void componentSelected(    ButtonEvent ce){
      AppEvent event=new AppEvent(AppEvents.EditQuery);
      event.setData("String_Node_Str",storedQuery);
      Dispatcher.forwardEvent(event);
    }
  }
);
  mainPanel.add(editButton);
}

Fixed version (ground truth):
@Override protected void initialize(){
  mainPanel=new LayoutContainer(new RowLayout(Orientation.VERTICAL));
  BorderLayoutData data=new BorderLayoutData(LayoutRegion.CENTER);
  data.setMargins(new Margins(5,5,5,0));
  queryField=new HTML();
  mainPanel.add(queryField,new RowData(1,-1));
  resultPanel=new SPARQLQueryResultPanel(true,false);
  mainPanel.add(resultPanel,new RowData(1,0.7));
  Button editButton=new Button("String_Node_Str");
  editButton.addSelectionListener(new SelectionListener<ButtonEvent>(){
    @Override public void componentSelected(    ButtonEvent ce){
      AppEvent event=new AppEvent(AppEvents.EditQuery);
      event.setData("String_Node_Str",storedQuery);
      Dispatcher.forwardEvent(event);
    }
  }
);
  mainPanel.add(editButton);
}
Program: 9659
Project: 9659
Buggy source:
private void showSimilarExample(){
  if (!interactiveMode) {
    showInteractivePanel();
  }
  if (!examplesPanel.getPositiveExamplesURIs().isEmpty()) {
    interactivePanel.mask("String_Node_Str");
    SPARQLService.Util.getInstance().getSimilarExample(examplesPanel.getPositiveExamplesURIs(),examplesPanel.getNegativeExamplesUris(),new AsyncCallbackEx<Example>(){
      @Override public void onSuccess(      Example result){
        interactivePanel.unmask();
        interactivePanel.setExample(result);
      }
    }
);
  }
}

Fixed version (ground truth):
private void showSimilarExample(){
  if (!interactiveMode) {
    showInteractivePanel();
  }
  if (!examplesPanel.getPositiveExamplesURIs().isEmpty()) {
    interactivePanel.mask("String_Node_Str");
    SPARQLService.Util.getInstance().getSimilarExample(examplesPanel.getPositiveExamplesURIs(),examplesPanel.getNegativeExamplesUris(),new AsyncCallbackEx<Example>(){
      @Override public void onSuccess(      Example result){
        interactivePanel.unmask();
        interactivePanel.setExample(result);
        resultPanel.refresh(examplesPanel.getPositiveExamplesURIs(),examplesPanel.getNegativeExamplesUris());
      }
    }
);
  }
}
Program: 9660
Project: 9660
Buggy source:
private void onAddExample(Example example,final Example.Type type){
  if (type == Example.Type.POSITIVE) {
    examplesPanel.addPositiveExample(example);
  }
 else {
    examplesPanel.addNegativeExample(example);
  }
  if (examplesPanel.getPositiveExamplesURIs().size() >= 2) {
    SPARQLService.Util.getInstance().setExamples(examplesPanel.getPositiveExamplesURIs(),examplesPanel.getNegativeExamplesUris(),new AsyncCallbackEx<Void>(){
      @Override public void onSuccess(      Void result){
        if (type == Example.Type.POSITIVE) {
          resultPanel.refresh(examplesPanel.getPositiveExamplesURIs(),examplesPanel.getNegativeExamplesUris());
        }
      }
    }
);
  }
 else {
  }
}

Fixed version (ground truth):
private void onAddExample(Example example,final Example.Type type){
  if (type == Example.Type.POSITIVE) {
    examplesPanel.addPositiveExample(example);
  }
 else {
    examplesPanel.addNegativeExample(example);
  }
  if (examplesPanel.getPositiveExamplesURIs().size() >= 2) {
    SPARQLService.Util.getInstance().setExamples(examplesPanel.getPositiveExamplesURIs(),examplesPanel.getNegativeExamplesUris(),new AsyncCallback<Void>(){
      @Override public void onSuccess(      Void result){
        if (type == Example.Type.POSITIVE) {
          showSimilarExample();
        }
      }
      @Override public void onFailure(      Throwable caught){
        System.out.println("String_Node_Str");
      }
    }
);
  }
 else {
  }
}
Program: 9661
Project: 9661
Buggy source:
@Override public void onSuccess(Example result){
  interactivePanel.unmask();
  interactivePanel.setExample(result);
}

Fixed version (ground truth):
@Override public void onSuccess(Example result){
  interactivePanel.unmask();
  interactivePanel.setExample(result);
  resultPanel.refresh(examplesPanel.getPositiveExamplesURIs(),examplesPanel.getNegativeExamplesUris());
}
Program: 9662
Project: 9662
Buggy source:
private void updateQuery(){
  SPARQLService.Util.getInstance().getCurrentSPARQLQuery(new AsyncCallback<String>(){
    @Override public void onFailure(    Throwable caught){
    }
    @Override public void onSuccess(    String result){
      queryTab.removeAll();
      queryTab.addText("String_Node_Str" + result + "String_Node_Str");
      queryTab.layout();
      System.out.println(result);
      System.out.println(URL.decode(result));
      resultPanel.setQuery(result);
      resultPanel.refresh();
    }
  }
);
}

Fixed version (ground truth):
private void updateQuery(){
  SPARQLService.Util.getInstance().getCurrentSPARQLQuery(new AsyncCallback<String>(){
    @Override public void onFailure(    Throwable caught){
    }
    @Override public void onSuccess(    String result){
      queryTab.removeAll();
      queryTab.addText("String_Node_Str" + encodeHTML(result) + "String_Node_Str");
      queryTab.layout();
      resultPanel.setQuery(result);
      resultPanel.loadProperties();
      resultPanel.refresh();
    }
  }
);
}
Program: 9663
Project: 9663
Buggy source:
public void refresh(List<String> posExamples,List<String> negExamples){
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  updateQuery();
}

Fixed version (ground truth):
public void refresh(List<String> posExamples,List<String> negExamples){
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  resultPanel.setExamples(posExamples,negExamples);
  updateQuery();
}
Program: 9664
Project: 9664
Buggy source:
private void createResultGrid(){
  queryResultTab=new TabItem("String_Node_Str");
  queryResultTab.setLayout(new RowLayout(Orientation.VERTICAL));
  resultPanel=new SPARQLQueryResultPanel(false);
  queryResultTab.add(resultPanel,new RowData(1,1));
  mainPanel.add(queryResultTab);
}

Fixed version (ground truth):
private void createResultGrid(){
  queryResultTab=new TabItem("String_Node_Str");
  queryResultTab.setLayout(new RowLayout(Orientation.VERTICAL));
  resultPanel=new SPARQLQueryResultPanel(false,true);
  queryResultTab.add(resultPanel,new RowData(1,1));
  mainPanel.add(queryResultTab);
}
Program: 9665
Project: 9665
Buggy source:
private void createColumns(Map<String,String> properties){
  ArrayList<ColumnConfig> columns=new ArrayList<ColumnConfig>();
  ColumnConfig c=new ColumnConfig();
  c=new ColumnConfig();
  c.setId("String_Node_Str");
  c.setHeader("String_Node_Str");
  c.setSortable(true);
  columns.add(c);
  for (  Entry<String,String> entry : properties.entrySet()) {
    c=new ColumnConfig();
    c.setId(entry.getKey());
    c.setHeader(entry.getValue());
    c.setSortable(true);
    c.setHidden(true);
    c.setWidth(200);
    columns.add(c);
  }
  final ColumnModel cm=new ColumnModel(columns);
  cm.addListener(Events.HiddenChange,new Listener<ColumnModelEvent>(){
    public void handleEvent(    ColumnModelEvent e){
      if (grid.isViewReady()) {
        EventType type=e.getType();
        if (type == Events.HiddenChange) {
          updateProperties(cm);
        }
      }
    }
  }
);
  grid.reconfigure(store,cm);
}

Fixed version (ground truth):
private void createColumns(Map<String,String> properties){
  ArrayList<ColumnConfig> columns=new ArrayList<ColumnConfig>();
  ColumnConfig c=new ColumnConfig();
  c=new ColumnConfig();
  c.setId(LABEL_URI);
  c.setHeader("String_Node_Str");
  c.setSortable(true);
  columns.add(c);
  for (  Entry<String,String> entry : properties.entrySet()) {
    c=new ColumnConfig();
    c.setId(entry.getKey());
    c.setHeader(entry.getValue());
    c.setSortable(true);
    c.setHidden(true);
    c.setWidth(200);
    columns.add(c);
  }
  final ColumnModel cm=new ColumnModel(columns);
  cm.addListener(Events.HiddenChange,new Listener<ColumnModelEvent>(){
    public void handleEvent(    ColumnModelEvent e){
      if (grid.isViewReady()) {
        EventType type=e.getType();
        if (type == Events.HiddenChange) {
          updateProperties(cm);
        }
      }
    }
  }
);
  grid.reconfigure(store,cm);
}
Program: 9667
Project: 9667
Buggy source:
public SPARQLQueryResultPanel(boolean showHeader){
  setHeaderVisible(showHeader);
  initUI();
}

Fixed version (ground truth):
public SPARQLQueryResultPanel(boolean showHeader,boolean highlightPosNeg){
  this.highlightPosNeg=highlightPosNeg;
  setHeaderVisible(showHeader);
  initUI();
}
Program: 9668
Project: 9668
Buggy source:
public int getIndexSize(){
  try {
    return searcher.maxDoc();
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    e.printStackTrace();
  }
  return -1;
}

Fixed version (ground truth):
public int getIndexSize(){
  return searcher.maxDoc();
}
Program: 9673
Project: 9673
Buggy source:
private String fSparql(QueryTree<N> tree,List<QueryTreeChange> changes){
  QueryTree<N> copy=new QueryTreeImpl<N>(tree);
  StringBuilder query=new StringBuilder();
  StringBuilder triples=new StringBuilder();
  List<String> filters=new ArrayList<String>();
  query.append("String_Node_Str");
  buildSPARQLQueryString(copy,changes,triples,filters);
  query.append(triples.toString());
  if (filters.size() > 0) {
    query.append("String_Node_Str");
    for (int i=0; i < filters.size() - 1; i++) {
      query.append("String_Node_Str").append(filters.get(i)).append("String_Node_Str");
    }
    query.append("String_Node_Str").append(filters.get(filters.size() - 1)).append("String_Node_Str");
    query.append("String_Node_Str");
  }
  query.append("String_Node_Str");
  return query.toString();
}

Fixed version (ground truth):
private String fSparql(QueryTree<N> tree,List<QueryTreeChange> changes){
  logger.info("String_Node_Str" + changes);
  QueryTree<N> copy=new QueryTreeImpl<N>(tree);
  StringBuilder query=new StringBuilder();
  StringBuilder triples=new StringBuilder();
  List<String> filters=new ArrayList<String>();
  query.append("String_Node_Str");
  buildSPARQLQueryString(copy,changes,triples,filters);
  query.append(triples.toString());
  if (filters.size() > 0) {
    query.append("String_Node_Str");
    for (int i=0; i < filters.size() - 1; i++) {
      query.append("String_Node_Str").append(filters.get(i)).append("String_Node_Str");
    }
    query.append("String_Node_Str").append(filters.get(filters.size() - 1)).append("String_Node_Str");
    query.append("String_Node_Str");
  }
  query.append("String_Node_Str");
  return query.toString();
}
Program: 9676
Project: 9676
Buggy source:
public EvaluationWithNLQueriesScript(){
  try {
    server=new CommonsHttpSolrServer(SOLR_SERVER_URL);
    List<String> predicateFilters=new ArrayList<String>();
    predicateFilters.add("String_Node_Str");
    predicateFilters.add("String_Node_Str");
    exFinder=new ExampleFinder(new SPARQLEndpointEx(new SparqlEndpoint(new URL("String_Node_Str"),Collections.singletonList("String_Node_Str"),Collections.<String>emptyList()),null,null,predicateFilters),selectCache,constructCache);
    schemaIndex=new DBpediaSchemaIndex(SCHEMA_FILE_PATH);
    luceneSearch=new LuceneSearch(LUCENE_INDEX_DIRECTORY);
    luceneSearch.setHitsPerPage(TOP_K);
    wordNet=new WordnetQuery(WORDNET_DICTIONARY);
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
  readQueries();
}

Fixed version (ground truth):
public EvaluationWithNLQueriesScript(){
  try {
    server=new CommonsHttpSolrServer(SOLR_SERVER_URL);
    List<String> predicateFilters=new ArrayList<String>();
    predicateFilters.add("String_Node_Str");
    predicateFilters.add("String_Node_Str");
    String baseURI="String_Node_Str";
    Map<String,String> prefixes=new HashMap<String,String>();
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    prefixes.put("String_Node_Str","String_Node_Str");
    exFinder=new ExampleFinder(new SPARQLEndpointEx(new URL("String_Node_Str"),Collections.singletonList("String_Node_Str"),Collections.<String>emptyList(),null,baseURI,prefixes,predicateFilters),selectCache,constructCache);
    luceneSearch=new LuceneSearch(LUCENE_INDEX_DIRECTORY);
    luceneSearch.setHitsPerPage(TOP_K);
    wordNet=new WordnetQuery(WORDNET_DICTIONARY);
  }
 catch (  MalformedURLException e) {
    e.printStackTrace();
  }
  readQueries();
}
Program: 9678
Project: 9678
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  String question="String_Node_Str";
  String uri="String_Node_Str";
  System.out.println("String_Node_Str" + question + "String_Node_Str");
  System.out.println("String_Node_Str" + uri);
  QueryTreeFactory<String> treeFactory=new QueryTreeFactoryImpl();
  QuestionProcessor qProcessor=new QuestionProcessor();
  List<String> predicateFilters=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  ModelGenerator modelGen=new ModelGenerator(SparqlEndpoint.getEndpointDBpediaLiveAKSW(),new HashSet<String>(predicateFilters),new ExtractionDBCache("String_Node_Str"));
  List<String> relevantWords=qProcessor.getRelevantWords(question);
  System.out.println("String_Node_Str" + relevantWords);
  Model model=modelGen.createModel(uri,Strategy.CHUNKS,2);
  QueryTree<String> tree=treeFactory.getQueryTree(uri,model);
  System.out.println("String_Node_Str" + tree.getStringRepresentation());
  treeFactory.setStatementSelector(new QuestionBasedStatementSelector(new HashSet<String>(relevantWords)));
  treeFactory.setStatementFilter(new QuestionBasedStatementFilter(new HashSet<String>(relevantWords)));
  QueryTree<String> filteredTree=treeFactory.getQueryTree(uri,model);
  System.out.println("String_Node_Str" + filteredTree.getStringRepresentation());
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args){
  String question="String_Node_Str";
  String uri="String_Node_Str";
  System.out.println("String_Node_Str" + question + "String_Node_Str");
  System.out.println("String_Node_Str" + uri);
  QueryTreeFactory<String> treeFactory=new QueryTreeFactoryImpl();
  QuestionProcessor qProcessor=new QuestionProcessor();
  List<String> predicateFilters=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  ModelGenerator modelGen=new ModelGenerator(SparqlEndpoint.getEndpointDBpediaLiveAKSW(),new HashSet<String>(predicateFilters),new ExtractionDBCache("String_Node_Str"));
  List<String> relevantWords=qProcessor.getRelevantWords(question);
  System.out.println("String_Node_Str" + relevantWords);
  Model model=modelGen.createModel(uri,Strategy.CHUNKS,2);
  QueryTree<String> tree=treeFactory.getQueryTree(uri,model);
  System.out.println("String_Node_Str" + tree.getStringRepresentation());
  treeFactory.setStatementFilter(new QuestionBasedStatementFilter(new HashSet<String>(relevantWords)));
  QueryTree<String> filteredTree=treeFactory.getQueryTree(uri,model);
  System.out.println("String_Node_Str" + filteredTree.getStringRepresentation());
}
Program: 9679
Project: 9679
Buggy source:
public Example findSimilarExample(List<String> posExamples,List<String> negExamples) throws SPARQLQueryException, TimeOutException {
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + posExamples);
  logger.info("String_Node_Str" + negExamples);
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  List<QueryTree<String>> posExampleTrees=new ArrayList<QueryTree<String>>();
  List<QueryTree<String>> negExampleTrees=new ArrayList<QueryTree<String>>();
  Model model;
  QueryTree<String> queryTree;
  for (  String resource : posExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    System.out.println(queryTree.getStringRepresentation());
    posExampleTrees.add(queryTree);
  }
  for (  String resource : negExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    negExampleTrees.add(queryTree);
  }
  if (posExamples.size() == 1 && negExamples.isEmpty()) {
    logger.info("String_Node_Str");
    return findExampleByGeneralisation(posExampleTrees.get(0));
  }
 else   if (negExamples.isEmpty()) {
    logger.info("String_Node_Str" + posExamples.size() + "String_Node_Str"+ negExamples.size()+ "String_Node_Str");
    return findExampleByLGG(posExampleTrees,negExampleTrees);
  }
 else {
    return findExampleByNBR(posExampleTrees,negExampleTrees);
  }
}

Fixed version (ground truth):
public Example findSimilarExample(List<String> posExamples,List<String> negExamples) throws SPARQLQueryException, TimeOutException {
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + posExamples);
  logger.info("String_Node_Str" + negExamples);
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  List<QueryTree<String>> posExampleTrees=new ArrayList<QueryTree<String>>();
  List<QueryTree<String>> negExampleTrees=new ArrayList<QueryTree<String>>();
  Model model;
  QueryTree<String> queryTree;
  for (  String resource : posExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    System.out.println(TreeHelper.getAbbreviatedTreeRepresentation(queryTree,endpoint.getBaseURI(),endpoint.getPrefixes()));
    posExampleTrees.add(queryTree);
  }
  for (  String resource : negExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    negExampleTrees.add(queryTree);
  }
  if (posExamples.size() == 1 && negExamples.isEmpty()) {
    logger.info("String_Node_Str");
    return findExampleByGeneralisation(posExampleTrees.get(0));
  }
 else   if (negExamples.isEmpty()) {
    logger.info("String_Node_Str" + posExamples.size() + "String_Node_Str"+ negExamples.size()+ "String_Node_Str");
    return findExampleByLGG(posExampleTrees,negExampleTrees);
  }
 else {
    return findExampleByNBR(posExampleTrees,negExampleTrees);
  }
}
Program: 9680
Project: 9680
Buggy source:
private void fillMap(Resource s,Model model,SortedMap<String,SortedSet<Statement>> resource2Statements){
  Iterator<Statement> it=model.listStatements(s,null,(RDFNode)null).filterKeep(keepFilter);
  Statement st;
  SortedSet<Statement> statements;
  while (it.hasNext()) {
    st=it.next();
    statements=resource2Statements.get(st.getSubject().toString());
    if (statements == null) {
      statements=new TreeSet<Statement>(comparator);
      resource2Statements.put(st.getSubject().toString(),statements);
    }
    statements.add(st);
    if (st.getObject().isURIResource()) {
      fillMap(st.getObject().asResource(),model,resource2Statements);
    }
  }
}

Fixed version (ground truth):
private void fillMap(Resource s,Model model,SortedMap<String,SortedSet<Statement>> resource2Statements){
  Iterator<Statement> it=model.listStatements(s,null,(RDFNode)null).filterKeep(keepFilter);
  Statement st;
  SortedSet<Statement> statements;
  while (it.hasNext()) {
    st=it.next();
    statements=resource2Statements.get(st.getSubject().toString());
    if (statements == null) {
      statements=new TreeSet<Statement>(comparator);
      resource2Statements.put(st.getSubject().toString(),statements);
    }
    statements.add(st);
    if (st.getObject().isURIResource() && !resource2Statements.containsKey(st.getObject().asResource().getURI())) {
      fillMap(st.getObject().asResource(),model,resource2Statements);
    }
  }
}
Program: 9681
Project: 9681
Buggy source:
public QuestionBasedStatementFilter(Set<String> questionWords){
  this.questionWords=questionWords;
  metric=new QGramsDistance();
}

Fixed version (ground truth):
public QuestionBasedStatementFilter(Set<String> questionWords){
  this.questionWords=questionWords;
  qGramMetric=new QGramsDistance();
  levensteinMetric=new Levenshtein();
  jaroWinklerMetric=new JaroWinkler();
}
Program: 9682
Project: 9682
Buggy source:
private boolean areSimiliar(String s1,String s2){
  float sim=metric.getSimilarity(s1,s2);
  return sim >= threshold;
}

Fixed version (ground truth):
private boolean areSimiliar(String s1,String s2){
  float qSim=qGramMetric.getSimilarity(s1,s2);
  float lSim=levensteinMetric.getSimilarity(s1,s2);
  float jSim=jaroWinklerMetric.getSimilarity(s1,s2);
  float sim=Math.max(Math.max(qSim,lSim),jSim);
  return sim >= threshold;
}
Program: 9683
Project: 9683
Buggy source:
private Example findExampleByNBR(List<QueryTree<String>> posExamplesTrees,List<QueryTree<String>> negExamplesTrees){
  LGGGenerator<String> lggGen=new LGGGeneratorImpl<String>();
  lgg=lggGen.getLGG(posExamplesTrees);
  logger.info("String_Node_Str" + TreeHelper.getAbbreviatedTreeRepresentation(lgg,endpoint.getBaseURI(),endpoint.getPrefixes()));
  logger.info("String_Node_Str" + lgg.toSPARQLQueryString());
  logger.info("String_Node_Str" + getResources(lgg.toSPARQLQueryString()).size());
  logger.info("String_Node_Str");
  List<String> knownResources=new ArrayList<String>();
  knownResources.addAll(posExamples);
  knownResources.addAll(negExamples);
  Example example=null;
  try {
    String uri=nbrGen.getQuestion(lgg,negExamplesTrees,knownResources);
    example=getExample(uri);
  }
 catch (  TimeOutException e) {
    e.printStackTrace();
  }
  example=getExample(example.getURI());
  currentQuery=nbrGen.getQuery();
  return example;
}

Fixed version (ground truth):
private Example findExampleByNBR(List<QueryTree<String>> posExamplesTrees,List<QueryTree<String>> negExamplesTrees){
  LGGGenerator<String> lggGen=new LGGGeneratorImpl<String>();
  lgg=lggGen.getLGG(posExamplesTrees);
  logger.info("String_Node_Str" + TreeHelper.getAbbreviatedTreeRepresentation(lgg,endpoint.getBaseURI(),endpoint.getPrefixes()));
  logger.info("String_Node_Str" + lgg.toSPARQLQueryString());
  logger.info("String_Node_Str" + getAllResources(lgg.toSPARQLQueryString()).size());
  logger.info("String_Node_Str");
  List<String> knownResources=new ArrayList<String>();
  knownResources.addAll(posExamples);
  knownResources.addAll(negExamples);
  Example example=null;
  try {
    String uri=nbrGen.getQuestion(lgg,negExamplesTrees,knownResources);
    example=getExample(uri);
  }
 catch (  TimeOutException e) {
    e.printStackTrace();
  }
  example=getExample(example.getURI());
  currentQuery=nbrGen.getQuery();
  return example;
}
Program: 9684
Project: 9684
Buggy source:
public void setStatementFilter(com.hp.hpl.jena.util.iterator.Filter<Statement> filter){
  queryTreeCache.setStatementFilter(filter);
}

Fixed version (ground truth):
public void setStatementFilter(com.hp.hpl.jena.util.iterator.Filter<Statement> filter){
  queryTreeCache.setStatementFilter(filter);
  nbrGen.setStatementFilter(filter);
}
Program: 9685
Project: 9685
Buggy source:
private void learnPosOnly(){
  resultQueries.clear();
  resultTrees.clear();
  if (posQueryTrees.size() == 2 || newPosExample != null) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
    }
    Monitor monitor=MonitorFactory.getTimeMonitor("String_Node_Str");
    monitor.start();
    if (posQueryTrees.size() == 2) {
      lgg=lggGenerator.getLGG(posQueryTrees);
    }
 else {
      lgg=lggGenerator.getLGG(lgg,newPosExample);
    }
    monitor.stop();
    newPosExample=null;
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str");
      logger.debug(lgg.getStringRepresentation());
      logger.debug("String_Node_Str" + monitor.getTotal() + "String_Node_Str");
    }
  }
  resultQueries.add(lgg.toSPARQLQueryString(true));
  resultTrees.add(lgg);
}

Fixed version (ground truth):
private void learnPosOnly(){
  resultQueries.clear();
  resultTrees.clear();
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
  }
  Monitor monitor=MonitorFactory.getTimeMonitor("String_Node_Str");
  monitor.start();
  lgg=lggGenerator.getLGG(posQueryTrees);
  monitor.stop();
  newPosExample=null;
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
    logger.debug(lgg.getStringRepresentation());
    logger.debug("String_Node_Str" + monitor.getTotal() + "String_Node_Str");
  }
  resultQueries.add(lgg.toSPARQLQueryString(true));
  resultTrees.add(lgg);
}
Program: 9686
Project: 9686
Buggy source:
private void limitEqualEdgesToLeafs(QueryTree<N> tree,int maxEqualEdgeCount){
  Set<QueryTree<N>> parents=new HashSet<QueryTree<N>>();
  for (  QueryTree<N> leaf : tree.getLeafs()) {
    if (leaf.getUserObject().equals("String_Node_Str")) {
      parents.add(leaf.getParent());
    }
  }
  for (  QueryTree<N> parent : parents) {
    for (    Object edge : parent.getEdges()) {
      int cnt=0;
      boolean existsResourceChild=false;
      for (      QueryTree<N> child : parent.getChildren(edge)) {
        if (!child.getUserObject().equals("String_Node_Str")) {
          existsResourceChild=true;
          break;
        }
      }
      for (      QueryTree<N> child : parent.getChildren(edge)) {
        if (child.getUserObject().equals("String_Node_Str")) {
          if (child.isLeaf()) {
            cnt++;
            if (existsResourceChild || cnt > maxEqualEdgeCount) {
              parent.removeChild((QueryTreeImpl<N>)child);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void limitEqualEdgesToLeafs(QueryTree<N> tree,int maxEqualEdgeCount){
  if (tree.getChildren().isEmpty()) {
    return;
  }
  Set<QueryTree<N>> parents=new HashSet<QueryTree<N>>();
  for (  QueryTree<N> leaf : tree.getLeafs()) {
    if (leaf.getUserObject().equals("String_Node_Str")) {
      parents.add(leaf.getParent());
    }
  }
  for (  QueryTree<N> parent : parents) {
    for (    Object edge : parent.getEdges()) {
      int cnt=0;
      boolean existsResourceChild=false;
      for (      QueryTree<N> child : parent.getChildren(edge)) {
        if (!child.getUserObject().equals("String_Node_Str")) {
          existsResourceChild=true;
          break;
        }
      }
      for (      QueryTree<N> child : parent.getChildren(edge)) {
        if (child.getUserObject().equals("String_Node_Str")) {
          if (child.isLeaf()) {
            cnt++;
            if (existsResourceChild || cnt > maxEqualEdgeCount) {
              parent.removeChild((QueryTreeImpl<N>)child);
            }
          }
        }
      }
    }
  }
}
Program: 9687
Project: 9687
Buggy source:
private SortedSet<String> getAllResources(String query){
  SortedSet<String> resources=new TreeSet<String>();
  String result=selectCache.executeSelectQuery(endpoint,getLimitedQuery(currentQuery,1000,true));
  testedQueries.add(currentQuery);
  ResultSetRewindable rs=SparqlQuery.convertJSONtoResultSet(result);
  String uri;
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    uri=qs.getResource("String_Node_Str").getURI();
    resources.add(uri);
  }
  return resources;
}

Fixed version (ground truth):
private SortedSet<String> getAllResources(String query){
  SortedSet<String> resources=new TreeSet<String>();
  query=getLimitedQuery(query,1000,true);
  System.err.println(query);
  String result=selectCache.executeSelectQuery(endpoint,query);
  testedQueries.add(query);
  ResultSetRewindable rs=SparqlQuery.convertJSONtoResultSet(result);
  String uri;
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    uri=qs.getResource("String_Node_Str").getURI();
    resources.add(uri);
  }
  return resources;
}
Program: 9688
Project: 9688
Buggy source:
private SortedSet<String> getResources(String query){
  SortedSet<String> resources=new TreeSet<String>();
  String result=selectCache.executeSelectQuery(endpoint,getLimitedQuery(currentQuery,(posExamples.size() + negExamples.size() + 1),true));
  testedQueries.add(currentQuery);
  ResultSetRewindable rs=SparqlQuery.convertJSONtoResultSet(result);
  String uri;
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    uri=qs.getResource("String_Node_Str").getURI();
    resources.add(uri);
  }
  return resources;
}

Fixed version (ground truth):
private SortedSet<String> getResources(String query){
  SortedSet<String> resources=new TreeSet<String>();
  String result=selectCache.executeSelectQuery(endpoint,getLimitedQuery(query,(posExamples.size() + negExamples.size() + 1),true));
  testedQueries.add(query);
  ResultSetRewindable rs=SparqlQuery.convertJSONtoResultSet(result);
  String uri;
  QuerySolution qs;
  while (rs.hasNext()) {
    qs=rs.next();
    uri=qs.getResource("String_Node_Str").getURI();
    resources.add(uri);
  }
  return resources;
}
Program: 9689
Project: 9689
Buggy source:
/** 
 * @param args
 * @throws SPARQLQueryException 
 * @throws TimeOutException 
 * @throws SolrServerException 
 * @throws ParserConfigurationException 
 * @throws IOException 
 * @throws SAXException 
 */
public static void main(String[] args) throws TimeOutException, SPARQLQueryException, SolrServerException, ParserConfigurationException, SAXException, IOException {
  Logger.getLogger(Generalisation.class).setLevel(Level.OFF);
  Logger.getLogger(LGGGeneratorImpl.class).setLevel(Level.OFF);
  Logger.getLogger(NBR.class).setLevel(Level.DEBUG);
  Logger.getRootLogger().removeAllAppenders();
  Layout layout=new PatternLayout("String_Node_Str");
  ConsoleAppender appender=new ConsoleAppender(layout);
  Logger.getRootLogger().addAppender(appender);
  FileAppender fileAppender=new FileAppender(layout,"String_Node_Str",false);
  fileAppender.setThreshold(Level.DEBUG);
  Logger.getRootLogger().addAppender(fileAppender);
  FileAppender fileAppender2=new FileAppender(layout,"String_Node_Str",false);
  fileAppender2.setThreshold(Level.INFO);
  Logger.getLogger("String_Node_Str").addAppender(fileAppender2);
  new EvaluationWithNLQueriesScript().evaluate();
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws SPARQLQueryException 
 * @throws TimeOutException 
 * @throws SolrServerException 
 * @throws ParserConfigurationException 
 * @throws IOException 
 * @throws SAXException 
 */
public static void main(String[] args) throws TimeOutException, SPARQLQueryException, SolrServerException, ParserConfigurationException, SAXException, IOException {
  Logger.getLogger(Generalisation.class).setLevel(Level.OFF);
  Logger.getLogger(LGGGeneratorImpl.class).setLevel(Level.OFF);
  Logger.getLogger(NBR.class).setLevel(Level.DEBUG);
  Logger.getRootLogger().removeAllAppenders();
  Layout layout=new PatternLayout("String_Node_Str");
  ConsoleAppender appender=new ConsoleAppender(layout);
  Logger.getRootLogger().addAppender(appender);
  FileAppender fileAppender=new FileAppender(layout,"String_Node_Str",false);
  fileAppender.setThreshold(Level.DEBUG);
  Logger.getRootLogger().addAppender(fileAppender);
  FileAppender fileAppender2=new FileAppender(layout,"String_Node_Str",false);
  fileAppender2.setThreshold(Level.INFO);
  Logger.getLogger("String_Node_Str").removeAllAppenders();
  Logger.getLogger("String_Node_Str").addAppender(fileAppender2);
  new EvaluationWithNLQueriesScript().evaluate();
}
Program: 9691
Project: 9691
Buggy source:
private Example findExampleByNBR(List<QueryTree<String>> posExamplesTrees,List<QueryTree<String>> negExamplesTrees){
  logger.info("String_Node_Str");
  LGGGenerator<String> lggGen=new LGGGeneratorImpl<String>();
  lgg=lggGen.getLGG(posExamplesTrees);
  logger.info("String_Node_Str" + lgg.getStringRepresentation());
  List<String> knownResources=new ArrayList<String>();
  knownResources.addAll(posExamples);
  knownResources.addAll(negExamples);
  Example example=null;
  try {
    example=findExampleByLGG(posExamplesTrees,negExamplesTrees);
  }
 catch (  SPARQLQueryException e1) {
    e1.printStackTrace();
  }
  if (example != null) {
    return example;
  }
  try {
    String uri=nbrGen.getQuestion(lgg,negExamplesTrees,knownResources);
    example=getExample(uri);
  }
 catch (  TimeOutException e) {
    e.printStackTrace();
  }
  example=getExample(example.getURI());
  currentQuery=nbrGen.getQuery();
  return example;
}

Fixed version (ground truth):
private Example findExampleByNBR(List<QueryTree<String>> posExamplesTrees,List<QueryTree<String>> negExamplesTrees){
  logger.info("String_Node_Str");
  LGGGenerator<String> lggGen=new LGGGeneratorImpl<String>();
  List<String> knownResources=new ArrayList<String>();
  knownResources.addAll(posExamples);
  knownResources.addAll(negExamples);
  Example example=null;
  try {
    String uri=nbrGen.getQuestion(lgg,negExamplesTrees,knownResources);
    example=getExample(uri);
  }
 catch (  TimeOutException e) {
    e.printStackTrace();
  }
  example=getExample(example.getURI());
  currentQuery=nbrGen.getQuery();
  return example;
}
Program: 9692
Project: 9692
Buggy source:
public Example findSimilarExample(List<String> posExamples,List<String> negExamples) throws SPARQLQueryException, TimeOutException {
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + posExamples);
  logger.info("String_Node_Str" + negExamples);
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  List<QueryTree<String>> posExampleTrees=new ArrayList<QueryTree<String>>();
  List<QueryTree<String>> negExampleTrees=new ArrayList<QueryTree<String>>();
  Model model;
  QueryTree<String> queryTree;
  for (  String resource : posExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    System.out.println("String_Node_Str" + resource + "String_Node_Str"+ TreeHelper.getAbbreviatedTreeRepresentation(queryTree,endpoint.getBaseURI(),endpoint.getPrefixes()));
    posExampleTrees.add(queryTree);
  }
  for (  String resource : negExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    negExampleTrees.add(queryTree);
  }
  if (posExamples.size() == 1 && negExamples.isEmpty()) {
    logger.info("String_Node_Str");
    return findExampleByGeneralisation(posExampleTrees.get(0));
  }
 else   if (negExamples.isEmpty()) {
    logger.info("String_Node_Str" + posExamples.size() + "String_Node_Str"+ negExamples.size()+ "String_Node_Str");
    Example ex=findExampleByLGG(posExampleTrees,negExampleTrees);
    if (ex == null) {
      return findExampleByGeneralisation(currentQueryTree);
    }
 else {
      return ex;
    }
  }
 else {
    return findExampleByNBR(posExampleTrees,negExampleTrees);
  }
}

Fixed version (ground truth):
public Example findSimilarExample(List<String> posExamples,List<String> negExamples) throws SPARQLQueryException, TimeOutException {
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + posExamples);
  logger.info("String_Node_Str" + negExamples);
  this.posExamples=posExamples;
  this.negExamples=negExamples;
  List<QueryTree<String>> posExampleTrees=new ArrayList<QueryTree<String>>();
  List<QueryTree<String>> negExampleTrees=new ArrayList<QueryTree<String>>();
  Model model;
  QueryTree<String> queryTree;
  for (  String resource : posExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    posExampleTrees.add(queryTree);
  }
  for (  String resource : negExamples) {
    model=modelCache.getModel(resource);
    queryTree=queryTreeCache.getQueryTree(resource,model);
    negExampleTrees.add(queryTree);
  }
  if (posExamples.size() == 1 && negExamples.isEmpty()) {
    logger.info("String_Node_Str");
    return findExampleByGeneralisation(posExampleTrees.get(0));
  }
 else   if (negExamples.isEmpty()) {
    logger.info("String_Node_Str" + posExamples.size() + "String_Node_Str"+ negExamples.size()+ "String_Node_Str");
    Example ex=findExampleByLGG(posExampleTrees,negExampleTrees);
    if (ex == null) {
      return findExampleByGeneralisation(currentQueryTree);
    }
 else {
      return ex;
    }
  }
 else {
    return findExampleByNBR(posExampleTrees,negExampleTrees);
  }
}
Program: 9693
Project: 9693
Buggy source:
private Set<String> getResourcesBySPARQLQuery(String query){
  logger.info("String_Node_Str");
  long startTime=System.currentTimeMillis();
  Set<String> resources=new HashSet<String>();
  ResultSet rs=SparqlQuery.convertJSONtoResultSet(selectCache.executeSelectQuery(ENDPOINT,query));
  while (rs.hasNext()) {
    resources.add(rs.nextSolution().get("String_Node_Str").asResource().getURI());
  }
  logger.info("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  return resources;
}

Fixed version (ground truth):
private Set<String> getResourcesBySPARQLQuery(String query,String varName){
  logger.info("String_Node_Str");
  long startTime=System.currentTimeMillis();
  Set<String> resources=new HashSet<String>();
  ResultSet rs=SparqlQuery.convertJSONtoResultSet(selectCache.executeSelectQuery(ENDPOINT,query));
  while (rs.hasNext()) {
    resources.add(rs.nextSolution().get(varName).asResource().getURI());
  }
  logger.info("String_Node_Str" + (System.currentTimeMillis() - startTime) + "String_Node_Str");
  return resources;
}
Program: 9695
Project: 9695
Buggy source:
public void simplifyTree(QueryTree<N> tree,List<QueryTree<N>> negTrees){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
    logger.debug("String_Node_Str" + TreeHelper.getAbbreviatedTreeRepresentation(tree,endpoint.getBaseURI(),endpoint.getPrefixes()));
    int i=1;
    for (    QueryTree<N> negTree : negTrees) {
      logger.debug("String_Node_Str" + i++ + "String_Node_Str"+ negTrees.size()+ "String_Node_Str"+ TreeHelper.getAbbreviatedTreeRepresentation(negTree,endpoint.getBaseURI(),endpoint.getPrefixes()));
    }
  }
  List<Object> path;
  boolean pathExists;
  for (  QueryTree<N> leaf : tree.getLeafs()) {
    pathExists=false;
    path=getPathFromRootToNode(leaf);
    if (leaf.getParent().getUserObject().equals("String_Node_Str")) {
      pathExists=true;
      for (      QueryTree<N> negTree : negTrees) {
        if (!pathExists(leaf,new ArrayList<Object>(path),negTree)) {
          pathExists=false;
          break;
        }
      }
    }
    if (pathExists) {
      leaf.getParent().removeChild((QueryTreeImpl<N>)leaf);
    }
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + TreeHelper.getAbbreviatedTreeRepresentation(tree,endpoint.getBaseURI(),endpoint.getPrefixes()));
  }
}

Fixed version (ground truth):
public void simplifyTree(QueryTree<N> tree,List<QueryTree<N>> negTrees){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
    logger.debug("String_Node_Str" + TreeHelper.getAbbreviatedTreeRepresentation(tree,endpoint.getBaseURI(),endpoint.getPrefixes()));
    int i=1;
    for (    QueryTree<N> negTree : negTrees) {
      logger.debug("String_Node_Str" + i++ + "String_Node_Str"+ negTrees.size()+ "String_Node_Str"+ TreeHelper.getAbbreviatedTreeRepresentation(negTree,endpoint.getBaseURI(),endpoint.getPrefixes()));
    }
  }
  List<Object> path;
  boolean pathExists;
  for (  QueryTree<N> leaf : tree.getLeafs()) {
    pathExists=false;
    path=getPathFromRootToNode(leaf);
    pathExists=true;
    for (    QueryTree<N> negTree : negTrees) {
      if (!pathExists(leaf,new ArrayList<Object>(path),negTree)) {
        pathExists=false;
        break;
      }
    }
    if (pathExists) {
      leaf.getParent().removeChild((QueryTreeImpl<N>)leaf);
    }
  }
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + TreeHelper.getAbbreviatedTreeRepresentation(tree,endpoint.getBaseURI(),endpoint.getPrefixes()));
  }
}
Program: 9697
Project: 9697
Buggy source:
private void computeScore(){
  accuracy=posAsPos.size() + negAsNeg.size();
  accuracy=accuracy / (double)nrOfExamples;
  score=accuracy - 1 - percentPerLengthUnit * conceptLength;
}

Fixed version (ground truth):
@Deprecated private void computeScore(){
  accuracy=posAsPos.size() + negAsNeg.size();
  accuracy=accuracy / (double)nrOfExamples;
  score=accuracy - 1 - percentPerLengthUnit * conceptLength;
}