nus-yam/ex-repair huggingface dataset:
Program: 83954
Project: 83954
Buggy source:
private void handleTSAggQuery(HttpExchange exchange,String data,boolean internalCall,JSONObject internalResp){
  JSONObject resp=new JSONObject();
  JSONArray errors=new JSONArray();
  resp.put("String_Node_Str",URI);
  try {
    JSONObject tsQueryObj2=genTSQueryObject(exchange,data);
    if (!tsQueryObj2.toString().equals("String_Node_Str")) {
      String aggStr=exchangeJSON.getString("String_Node_Str");
      String units=exchangeJSON.getString("String_Node_Str");
      JSONArray mqResp2=queryAggTimeseries(aggStr,units,tsQueryObj2);
      logger.fine("String_Node_Str" + mqResp2.toString());
      resp.put("String_Node_Str",mqResp2);
    }
 else {
      errors.add("String_Node_Str");
      logger.warning(errors.toString());
      resp.put("String_Node_Str",errors);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    if (e instanceof JSONException) {
      errors.add("String_Node_Str");
      resp.put(errors,errors);
      sendResponse(exchange,200,resp.toString(),internalCall,internalResp);
      return;
    }
  }
  sendResponse(exchange,200,resp.toString(),internalCall,internalResp);
  exchangeJSON.clear();
}

Fixed version (ground truth):
private void handleTSAggQuery(HttpExchange exchange,String data,boolean internalCall,JSONObject internalResp){
  JSONObject resp=new JSONObject();
  JSONArray errors=new JSONArray();
  resp.put("String_Node_Str",URI);
  try {
    JSONObject tsQueryObj2=genTSQueryObject(exchange,data);
    if (!tsQueryObj2.toString().equals("String_Node_Str")) {
      String aggStr=exchangeJSON.getString("String_Node_Str");
      String units=exchangeJSON.getString("String_Node_Str");
      JSONArray mqResp2=queryAggTimeseries(aggStr,units,tsQueryObj2);
      logger.fine("String_Node_Str" + mqResp2.toString());
      resp.put("String_Node_Str",mqResp2);
    }
 else {
      errors.add("String_Node_Str");
      logger.warning(errors.toString());
      resp.put("String_Node_Str",errors);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    if (e instanceof JSONException) {
      errors.add("String_Node_Str");
      resp.put(errors,errors);
      sendResponse(exchange,200,resp.toString(),internalCall,internalResp);
      return;
    }
  }
  sendResponse(exchange,200,resp.toString(),internalCall,internalResp);
}
Program: 83955
Project: 83955
Buggy source:
protected void setExchangeJSON(JSONObject params){
  exchangeJSON.putAll(params);
}

Fixed version (ground truth):
protected void setExchangeJSON(JSONObject params){
  logger.fine("String_Node_Str" + params.toString());
  exchangeJSON.putAll(params);
}
Program: 83958
Project: 83958
Buggy source:
private void copyResponse(String response,JSONObject internalResp){
  try {
    if (internalResp != null) {
      if (response != null) {
        logger.fine("String_Node_Str");
        JSONObject respObj=(JSONObject)JSONSerializer.toJSON(response);
        Iterator keys=respObj.keys();
        while (keys.hasNext()) {
          String thisKey=(String)keys.next();
          internalResp.put(thisKey,respObj.get(thisKey));
        }
      }
 else {
        logger.fine("String_Node_Str");
      }
    }
 else {
      logger.fine("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void copyResponse(String response,JSONObject internalResp){
  try {
    if (internalResp != null) {
      if (response != null) {
        logger.fine("String_Node_Str");
        JSONObject respObj=(JSONObject)JSONSerializer.toJSON(response);
        internalResp.accumulateAll((Map)respObj);
      }
 else {
        logger.fine("String_Node_Str");
      }
    }
 else {
      logger.fine("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
  }
}
Program: 83959
Project: 83959
Buggy source:
protected synchronized boolean parseParams(HttpExchange exchange){
  logger.info("String_Node_Str" + exchange.getRequestURI().toString());
  exchangeJSON.clear();
  exchangeJSON.put("String_Node_Str",exchange.getRequestHeaders());
  StringTokenizer tokenizer=new StringTokenizer(exchange.getRequestURI().toString(),"String_Node_Str");
  if (tokenizer != null && tokenizer.hasMoreTokens()) {
    String thisResourcePath=tokenizer.nextToken();
    if (URI == null && !thisResourcePath.equals(URI) && !thisResourcePath.equals(URI + "String_Node_Str"))     return false;
    if (tokenizer.countTokens() > 0) {
      StringTokenizer paramStrTokenizer=new StringTokenizer(tokenizer.nextToken(),"String_Node_Str");
      if (paramStrTokenizer != null && paramStrTokenizer.hasMoreTokens()) {
        while (paramStrTokenizer.hasMoreTokens()) {
          StringTokenizer paramPairsTokenizer=new StringTokenizer(paramStrTokenizer.nextToken(),"String_Node_Str");
          if (paramPairsTokenizer != null && paramPairsTokenizer.hasMoreTokens()) {
            String attr=paramPairsTokenizer.nextToken();
            String val=paramPairsTokenizer.nextToken();
            exchange.setAttribute(attr,val);
            exchangeJSON.put(attr,val);
            logger.info("String_Node_Str" + attr + "String_Node_Str"+ val+ "String_Node_Str");
          }
        }
      }
    }
 else {
      logger.fine("String_Node_Str");
    }
  }
  logger.finer("String_Node_Str" + exchangeJSON.toString());
  return true;
}

Fixed version (ground truth):
protected synchronized boolean parseParams(HttpExchange exchange){
  logger.info("String_Node_Str" + exchange.getRequestURI().toString());
  exchangeJSON.clear();
  exchangeJSON.put("String_Node_Str",exchange.getRequestHeaders());
  exchangeJSON.put("String_Node_Str",exchange.getRequestURI().toString());
  StringTokenizer tokenizer=new StringTokenizer(exchange.getRequestURI().toString(),"String_Node_Str");
  if (tokenizer != null && tokenizer.hasMoreTokens()) {
    String thisResourcePath=tokenizer.nextToken();
    if (URI == null && !thisResourcePath.equals(URI) && !thisResourcePath.equals(URI + "String_Node_Str"))     return false;
    if (tokenizer.countTokens() > 0) {
      StringTokenizer paramStrTokenizer=new StringTokenizer(tokenizer.nextToken(),"String_Node_Str");
      if (paramStrTokenizer != null && paramStrTokenizer.hasMoreTokens()) {
        while (paramStrTokenizer.hasMoreTokens()) {
          StringTokenizer paramPairsTokenizer=new StringTokenizer(paramStrTokenizer.nextToken(),"String_Node_Str");
          if (paramPairsTokenizer != null && paramPairsTokenizer.hasMoreTokens()) {
            String attr=paramPairsTokenizer.nextToken();
            String val=paramPairsTokenizer.nextToken();
            exchange.setAttribute(attr,val);
            exchangeJSON.put(attr,val);
            logger.info("String_Node_Str" + attr + "String_Node_Str"+ val+ "String_Node_Str");
          }
        }
      }
    }
 else {
      logger.fine("String_Node_Str");
    }
  }
  logger.finer("String_Node_Str" + exchangeJSON.toString());
  return true;
}
Program: 83963
Project: 83963
Buggy source:
private void handleUrlSymlinkRequest(HttpExchange exchange,boolean internalCall,JSONObject internalResp,String linksToUrl){
  try {
    String tailResources=getTailResourceUri(exchange,true);
    tailResources=getTailResourceUri(exchange,false);
    String thisUrl=linksToUrl + tailResources;
    logger.info("String_Node_Str" + thisUrl);
    StringBuffer serverRespBuffer=new StringBuffer();
    HttpURLConnection is4Conn=is4ServerGet(thisUrl,serverRespBuffer);
    if (is4Conn != null) {
      String requestUri=exchange.getRequestURI().toString();
      if (requestUri.contains("String_Node_Str"))       requestUri=requestUri.substring(0,requestUri.indexOf("String_Node_Str"));
      if (requestUri.contains("String_Node_Str") && !requestUri.endsWith("String_Node_Str")) {
        JSONObject fixedServerResp=new JSONObject();
        String localUri=URI + tailResources;
        fixedServerResp.put(localUri,serverRespBuffer.toString());
        sendResponse(exchange,is4Conn.getResponseCode(),fixedServerResp.toString(),internalCall,internalResp);
      }
 else {
        sendResponse(exchange,is4Conn.getResponseCode(),serverRespBuffer.toString(),internalCall,internalResp);
      }
      is4Conn.disconnect();
    }
 else {
      sendResponse(exchange,504,null,internalCall,internalResp);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    sendResponse(exchange,504,null,internalCall,internalResp);
  }
}

Fixed version (ground truth):
private void handleUrlSymlinkRequest(HttpExchange exchange,boolean internalCall,JSONObject internalResp,String linksToUrl){
  try {
    String tailResources=getTailResourceUri(exchange,true);
    tailResources=getTailResourceUri(exchange,false);
    String thisUrl=linksToUrl + tailResources;
    logger.info("String_Node_Str" + thisUrl);
    StringBuffer serverRespBuffer=new StringBuffer();
    HttpURLConnection is4Conn=is4ServerGet(thisUrl,serverRespBuffer);
    if (is4Conn != null) {
      String requestUri=exchangeJSON.getString("String_Node_Str");
      if (requestUri.contains("String_Node_Str"))       requestUri=requestUri.substring(0,requestUri.indexOf("String_Node_Str"));
      if (requestUri.contains("String_Node_Str") && !requestUri.endsWith("String_Node_Str")) {
        JSONObject fixedServerResp=new JSONObject();
        String localUri=URI + tailResources;
        fixedServerResp.put(localUri,serverRespBuffer.toString());
        sendResponse(exchange,is4Conn.getResponseCode(),fixedServerResp.toString(),internalCall,internalResp);
      }
 else {
        sendResponse(exchange,is4Conn.getResponseCode(),serverRespBuffer.toString(),internalCall,internalResp);
      }
      is4Conn.disconnect();
    }
 else {
      sendResponse(exchange,504,null,internalCall,internalResp);
    }
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    sendResponse(exchange,504,null,internalCall,internalResp);
  }
}
Program: 83964
Project: 83964
Buggy source:
public void get(HttpExchange exchange,boolean internalCall,JSONObject internalResp){
  String tailResources=null;
  if (uri_link != null && !database.isSymlink(uri_link)) {
    logger.info(uri_link + "String_Node_Str");
    handleUriSymlinkRequest(exchange,internalCall,internalResp,uri_link);
  }
 else   if (uri_link != null && database.isSymlink(uri_link)) {
    String linksToStr=database.getSymlinkAlias(uri_link);
    while (linksToStr != null && database.isSymlink(linksToStr)) {
      linksToStr=database.getSymlinkAlias(linksToStr);
    }
    if (linksToStr != null && linksToStr.startsWith("String_Node_Str"))     handleUriSymlinkRequest(exchange,internalCall,internalResp,linksToStr);
 else     handleUrlSymlinkRequest(exchange,internalCall,internalResp,linksToStr);
  }
 else   if (url_link != null) {
    handleUrlSymlinkRequest(exchange,internalCall,internalResp,url_link.toString());
  }
}

Fixed version (ground truth):
public void get(HttpExchange exchange,boolean internalCall,JSONObject internalResp){
  String links_to=database.getSymlinkAlias(URI);
  links_to=cleanPath(links_to);
  logger.info("String_Node_Str" + links_to);
  if (links_to.startsWith("String_Node_Str")) {
    logger.info("String_Node_Str" + exchangeJSON.toString());
    String requestPath=exchangeJSON.getString("String_Node_Str");
    String tail=null;
    if (requestPath.contains("String_Node_Str")) {
      tail=requestPath.substring(requestPath.indexOf("String_Node_Str"),requestPath.length());
      logger.info("String_Node_Str" + tail);
      requestPath=requestPath.replace(tail,"String_Node_Str");
    }
    requestPath=cleanPath(requestPath);
    String translation=requestPath.replace(URI,links_to);
    logger.info("String_Node_Str" + requestPath + "String_Node_Str"+ URI+ "String_Node_Str"+ links_to);
    logger.info("String_Node_Str" + translation);
    Resource r=null;
    if (!database.isSymlink(links_to))     r=RESTServer.getResource(translation);
 else     r=RESTServer.getResource(links_to);
    if (r != null) {
      r.exchangeJSON.accumulateAll(this.exchangeJSON);
      if (tail != null) {
        logger.fine("String_Node_Str" + translation + tail);
        r.exchangeJSON.put("String_Node_Str",translation + tail);
      }
 else {
        logger.fine("String_Node_Str" + translation);
        r.exchangeJSON.put("String_Node_Str",translation);
      }
      this.exchangeJSON.clear();
      r.get(exchange,false,internalResp);
      return;
    }
  }
  sendResponse(exchange,404,null,internalCall,internalResp);
}
Program: 83969
Project: 83969
Buggy source:
public void createLink(String parentPath,String childPath){
  parentPath=cleanPath(parentPath);
  childPath=cleanPath(childPath);
  Vertex parentVertex=nodeList.get(parentPath);
  Vertex childVertex=nodeList.get(childPath);
  if (parentVertex == null) {
    this.addNodeEvent(parentPath);
    parentVertex=nodeList.get(parentPath);
  }
  if (childVertex == null) {
    this.addNodeEvent(childPath);
    childVertex=nodeList.get(childPath);
  }
  Edge e=graph.aConnectingEdge(parentVertex,childVertex);
  if (e == Edge.NONE) {
    graph.insertDirectedEdge(parentVertex,childVertex,"String_Node_Str");
    System.out.println("String_Node_Str" + parentPath + "String_Node_Str"+ childPath);
  }
}

Fixed version (ground truth):
public void createLink(String parentPath,String childPath){
  parentPath=cleanPath(parentPath);
  childPath=cleanPath(childPath);
  Vertex parentVertex=nodeList.get(parentPath);
  Vertex childVertex=nodeList.get(childPath);
  if (parentVertex == null) {
    this.addNodeEvent(parentPath);
    parentVertex=nodeList.get(parentPath);
  }
  if (childVertex == null) {
    this.addNodeEvent(childPath);
    childVertex=nodeList.get(childPath);
  }
  Edge e=graph.aConnectingEdge(parentVertex,childVertex);
  if (e == Edge.NONE) {
    graph.insertDirectedEdge(parentVertex,childVertex,"String_Node_Str");
    logger.info("String_Node_Str" + parentPath + "String_Node_Str"+ childPath);
  }
}
Program: 83971
Project: 83971
Buggy source:
public String queryAgg(String path,String aggtype,String units,JSONObject queryJson){
  try {
    RouterCommand rcmd=new RouterCommand(RouterCommand.CommandType.PULL);
    rcmd.setSrcVertex(path);
    rcmd.setAggType(aggtype);
    rcmd.setUnits(units);
    routerOut.writeObject(rcmd);
    routerOut.flush();
    rcmd=(RouterCommand)routerIn.readObject();
    return rcmd.data;
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
public String queryAgg(String path,String aggtype,String units,JSONObject queryJson){
  try {
    setRouterCommInfo("String_Node_Str",9999);
    RouterCommand rcmd=new RouterCommand(RouterCommand.CommandType.PULL);
    rcmd.setSrcVertex(path);
    rcmd.setAggType(aggtype);
    rcmd.setUnits(units);
    routerOut.writeObject(rcmd);
    routerOut.flush();
    rcmd=(RouterCommand)routerIn.readObject();
    return rcmd.data;
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
  }
  return null;
}
Program: 83972
Project: 83972
Buggy source:
public byte getTypeCode(String type) throws ApplicationFault {
  if (this.types.containsKey(type))   return this.types.get(type);
  throw new ApplicationFault("String_Node_Str" + type + "String_Node_Str");
}

Fixed version (ground truth):
public Byte getTypeCode(String type) throws ApplicationFault {
  if (StringUtils.isEmpty(type))   return null;
  if (this.types.containsKey(type))   return this.types.get(type);
  throw new ApplicationFault("String_Node_Str" + type + "String_Node_Str");
}
Program: 83973
Project: 83973
Buggy source:
/** 
 * Set a new stopword list. This also refreshes the existing list.
 * @param words
 * @throws SystemFault
 */
public void setStopwords(List<String> words) throws SystemFault {
  StopwordRefresh.add(words);
  Set<String> newStopWords=new HashSet<String>();
  newStopWords.addAll(words);
  Set<String> stopWordsTemp=this.stopWords;
  this.stopWords=newStopWords;
  stopWordsTemp.clear();
  stopWordsTemp=null;
}

Fixed version (ground truth):
/** 
 * Set a new stopword list. This also refreshes the existing list.
 * @param words
 * @throws SystemFault
 */
public void setStopwords(List<String> words) throws SystemFault {
  StopwordRefresh.add(words);
  Set<String> newStopWords=new HashSet<String>();
  newStopWords.addAll(words);
  this.stopWords=newStopWords;
}
Program: 83974
Project: 83974
Buggy source:
public Object process() throws ApplicationFault, SystemFault {
  NV nv=new NV(IOConstants.NAME_VALUE_BYTES,IOConstants.NAME_VALUE_BYTES);
  RecordScalar scalar=new RecordScalar(STOP_WORD_LISTS_KEY,nv);
  HReader.getScalar(IOConstants.TABLE_CONFIG,scalar);
  if (null != scalar.kv.data) {
    String words=new String(scalar.kv.data.toBytes());
    List<String> wordLst=StringUtils.fastSplit(words,STOPWORD_SEPARATOR);
    Set<String> stopWordsTemp=StopwordManager.getInstance().stopWords;
    StopwordManager.getInstance().stopWords=buildStopwords(wordLst);
    stopWordsTemp.clear();
    stopWordsTemp=null;
  }
  return null;
}

Fixed version (ground truth):
public Object process() throws ApplicationFault, SystemFault {
  NV nv=new NV(IOConstants.NAME_VALUE_BYTES,IOConstants.NAME_VALUE_BYTES);
  RecordScalar scalar=new RecordScalar(STOP_WORD_LISTS_KEY,nv);
  HReader.getScalar(IOConstants.TABLE_CONFIG,scalar);
  if (null != scalar.kv.data) {
    String words=new String(scalar.kv.data.toBytes());
    List<String> wordLst=StringUtils.fastSplit(words,STOPWORD_SEPARATOR);
    Set<String> stopWordsTemp=StopwordManager.getInstance().stopWords;
    StopwordManager.getInstance().stopWords=buildStopwords(wordLst);
    if (null != stopWordsTemp)     stopWordsTemp.clear();
    stopWordsTemp=null;
  }
  return null;
}
Program: 83975
Project: 83975
Buggy source:
/** 
 * This subsets across all MUST queries. Last 2 must queries are already in sync from the processing.
 * @param planner
 * @param lastMustQuery
 */
private void intersectMustQs(QueryPlanner planner,QueryTerm lastMustQuery){
  if (null == lastMustQuery)   return;
  int stepsT=planner.sequences.size();
  boolean ignoreNext=false;
  for (int step=stepsT - 1; step > -1; step--) {
    List<QueryTerm> curStep=planner.sequences.get(step);
    if (curStep.size() != 1)     continue;
    QueryTerm curQuery=curStep.get(0);
    if (curQuery.isOptional)     continue;
    if (lastMustQuery == curQuery) {
      ignoreNext=true;
      continue;
    }
    if (ignoreNext) {
      ignoreNext=false;
      continue;
    }
    Map<Long,TermList> curBuckets=curQuery.foundIds;
    Map<Long,TermList> lastBuckets=lastMustQuery.foundIds;
    int curBucketsT=curBuckets.size();
    Iterator<Long> curBucketsItr=curBuckets.keySet().iterator();
    for (int i=0; i < curBucketsT; i++) {
      Long bucketId=curBucketsItr.next();
      boolean hasElements=lastBuckets.containsKey(bucketId);
      if (hasElements) {
        hasElements=curBuckets.get(bucketId).intersect(lastBuckets.get(bucketId));
        if (!hasElements) {
          curBucketsItr.remove();
          lastBuckets.remove(bucketId);
        }
      }
 else {
        curBucketsItr.remove();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This subsets across all MUST queries. Last 2 must queries are already in sync from the processing.
 * @param planner
 * @param lastMustQuery
 */
private void intersectMustQs(QueryPlanner planner,QueryTerm lastMustQuery){
  if (null == lastMustQuery)   return;
  int stepsT=planner.sequences.size();
  for (int step=stepsT - 1; step > -1; step--) {
    List<QueryTerm> curStep=planner.sequences.get(step);
    if (curStep.size() != 1)     continue;
    QueryTerm curQuery=curStep.get(0);
    if (curQuery.isOptional)     continue;
    if (lastMustQuery == curQuery)     continue;
    Map<Long,TermList> curBuckets=curQuery.foundIds;
    Map<Long,TermList> lastBuckets=lastMustQuery.foundIds;
    int curBucketsT=curBuckets.size();
    Iterator<Long> curBucketsItr=curBuckets.keySet().iterator();
    for (int i=0; i < curBucketsT; i++) {
      Long bucketId=curBucketsItr.next();
      boolean hasElements=lastBuckets.containsKey(bucketId);
      if (hasElements) {
        hasElements=curBuckets.get(bucketId).intersect(lastBuckets.get(bucketId));
        if (!hasElements) {
          curBucketsItr.remove();
          lastBuckets.remove(bucketId);
        }
      }
 else {
        curBucketsItr.remove();
      }
    }
  }
}
Program: 83977
Project: 83977
Buggy source:
public void testIndexFieldInsert(String id,String title,String teaser) throws Exception {
  HDocument hdoc=new HDocument();
  hdoc.originalId=new Storable(id);
  hdoc.title=new Storable(title);
  hdoc.fields=new ArrayList<HField>();
  HField fld=new HField("String_Node_Str",FileReaderUtil.toString("String_Node_Str"));
  hdoc.fields.add(fld);
  QueryResult res=IndexReader.getInstance().search(new QueryContext(id));
  IndexWriter.getInstance().insert(hdoc);
}

Fixed version (ground truth):
public void testIndexFieldInsert(String id,String title) throws Exception {
  HDocument hdoc=new HDocument();
  hdoc.originalId=new Storable(id);
  hdoc.title=new Storable(title);
  hdoc.fields=new ArrayList<HField>();
  HField fld=new HField("String_Node_Str",FileReaderUtil.toString("String_Node_Str"));
  hdoc.fields.add(fld);
  IndexWriter.getInstance().insert(hdoc);
  QueryResult res=IndexReader.getInstance().search(new QueryContext("String_Node_Str"));
  System.out.println(res.toString());
}
Program: 83978
Project: 83978
Buggy source:
public static void main(String[] args) throws Exception {
  IndexWriterTest t=new IndexWriterTest();
  Configuration conf=new Configuration();
  ServiceFactory.getInstance().init(conf,null);
  List<String> kwL=DictionaryManager.getInstance().getDictionary().getAll();
  for (  String kw : kwL) {
    System.out.println(kw.toString());
  }
  DictionaryManager.getInstance().deleteAll();
  t.testIndexMultiDoc("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  t.testIndexMultiDoc("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  t.testIndexMultiDoc("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  IndexWriterTest t=new IndexWriterTest();
  Configuration conf=new Configuration();
  ServiceFactory.getInstance().init(conf,null);
  List<String> kwL=DictionaryManager.getInstance().getDictionary().getAll();
  for (  String kw : kwL) {
    System.out.println(kw.toString());
  }
  DictionaryManager.getInstance().deleteAll();
  t.testIndexFieldInsert("String_Node_Str","String_Node_Str");
}
Program: 83980
Project: 83980
Buggy source:
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryPlanner planner=query.planner;
  QueryResult result=query.result;
  Map<String,DocWeight> sortedStaticMap=computeWeight(ctx,planner);
  result.sortedStaticWeights=sortedStaticMap.values().toArray();
  DocWeight.sort(result.sortedStaticWeights);
  return true;
}

Fixed version (ground truth):
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  L.l.debug("String_Node_Str");
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryPlanner planner=query.planner;
  QueryResult result=query.result;
  Map<String,DocWeight> sortedStaticMap=computeWeight(ctx,planner);
  result.sortedStaticWeights=sortedStaticMap.values().toArray();
  DocWeight.sort(result.sortedStaticWeights);
  sortedStaticMap.clear();
  sortedStaticMap=null;
  return true;
}
Program: 83981
Project: 83981
Buggy source:
public static boolean compareBytes(char[] inputBytes,char[] compareBytes){
  int inputBytesT=inputBytes.length;
  int compareBytesT=compareBytes.length;
  if (compareBytesT != inputBytesT)   return false;
  if (compareBytes[0] != inputBytes[0])   return false;
  if (compareBytes[compareBytesT - 1] != inputBytes[compareBytesT - 1])   return false;
switch (compareBytesT) {
case 3:
    return compareBytes[1] == inputBytes[1];
case 4:
  return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2];
case 5:
return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2] && compareBytes[3] == inputBytes[3];
case 6:
return compareBytes[1] == inputBytes[1] && compareBytes[3] == inputBytes[3] && compareBytes[2] == inputBytes[2] && compareBytes[4] == inputBytes[4];
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 29:
case 30:
for (int i=0; i < compareBytesT - 1; i++) {
if (compareBytes[i] != inputBytes[i]) return false;
}
break;
case 31:
for (int a=1; a <= 6; a++) {
if (!(compareBytes[a] == inputBytes[a] && compareBytes[a + 6] == inputBytes[a + 6] && compareBytes[a + 12] == inputBytes[a + 12] && compareBytes[a + 18] == inputBytes[a + 18] && compareBytes[a + 24] == inputBytes[a + 24])) return false;
}
break;
default :
for (int i=0; i < compareBytesT - 1; i++) {
if (compareBytes[i] != inputBytes[i]) return false;
}
}
return true;
}

Fixed version (ground truth):
public static boolean compareBytes(char[] inputBytes,char[] compareBytes){
  int inputBytesT=inputBytes.length;
  int compareBytesT=compareBytes.length;
  if (compareBytesT != inputBytesT)   return false;
  if (compareBytes[0] != inputBytes[0])   return false;
  if (compareBytes[compareBytesT - 1] != inputBytes[compareBytesT - 1])   return false;
switch (compareBytesT) {
case 3:
    return compareBytes[1] == inputBytes[1];
case 4:
  return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2];
case 5:
return compareBytes[1] == inputBytes[1] && compareBytes[2] == inputBytes[2] && compareBytes[3] == inputBytes[3];
case 6:
return compareBytes[1] == inputBytes[1] && compareBytes[3] == inputBytes[3] && compareBytes[2] == inputBytes[2] && compareBytes[4] == inputBytes[4];
default :
compareBytesT--;
for (int i=0; i < compareBytesT; i++) {
if (compareBytes[i] != inputBytes[i]) return false;
}
}
return true;
}
Program: 83982
Project: 83982
Buggy source:
public static List<NVBytes> getCompleteRow(String tableName,byte[] pk) throws ApplicationFault {
  HBaseFacade facade=null;
  HTableWrapper table=null;
  Result r=null;
  try {
    facade=HBaseFacade.getInstance();
    table=facade.getTable(tableName);
    Get getter=new Get(pk);
    if (table.exists(getter)) {
      r=table.get(getter);
      List<NVBytes> nvs=new ArrayList<NVBytes>(r.list().size());
      for (      KeyValue kv : r.list()) {
        nvs.add(new NVBytes(kv.getFamily(),kv.getQualifier(),kv.getValue()));
      }
      return nvs;
    }
    return null;
  }
 catch (  Exception ex) {
    throw new ApplicationFault("String_Node_Str" + pk.toString(),ex);
  }
 finally {
    if (null != facade && null != table)     facade.putTable(table);
  }
}

Fixed version (ground truth):
public static List<NVBytes> getCompleteRow(String tableName,byte[] pk,Filter filter) throws ApplicationFault {
  HBaseFacade facade=null;
  HTableWrapper table=null;
  Result r=null;
  try {
    facade=HBaseFacade.getInstance();
    table=facade.getTable(tableName);
    Get getter=new Get(pk);
    if (null != filter)     getter.setFilter(filter);
    if (table.exists(getter)) {
      r=table.get(getter);
      List<NVBytes> nvs=new ArrayList<NVBytes>(r.list().size());
      for (      KeyValue kv : r.list()) {
        nvs.add(new NVBytes(kv.getFamily(),kv.getQualifier(),kv.getValue()));
      }
      return nvs;
    }
    return null;
  }
 catch (  Exception ex) {
    throw new ApplicationFault("String_Node_Str" + pk.toString(),ex);
  }
 finally {
    if (null != facade && null != table)     facade.putTable(table);
  }
}
Program: 83983
Project: 83983
Buggy source:
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryResult res=query.result;
  if (null == res)   return true;
  if (null == res.sortedDynamicWeights)   return true;
  int foundT=res.sortedDynamicWeights.length;
  int maxFetching=(ctx.documentFetchLimit < foundT) ? ctx.documentFetchLimit : foundT;
  List<DocTeaserWeight> weightedTeasers=new ArrayList<DocTeaserWeight>(maxFetching);
  for (int i=0; i < maxFetching; i++) {
    DocMetaWeight metaWt=(DocMetaWeight)res.sortedDynamicWeights[i];
    byte[] idB=metaWt.id.getBytes();
    List<NVBytes> flds=HReader.getCompleteRow(IOConstants.TABLE_PREVIEW,idB);
    weightedTeasers.add(new DocTeaserWeight(idB,flds,metaWt.weight));
  }
  res.teasers=weightedTeasers.toArray();
  DocTeaserWeight.sort(res.teasers);
  return true;
}

Fixed version (ground truth):
public boolean visit(Object objQuery) throws ApplicationFault, SystemFault {
  HQuery query=(HQuery)objQuery;
  QueryContext ctx=query.ctx;
  QueryResult res=query.result;
  if (null == res)   return true;
  if (null == res.sortedDynamicWeights)   return true;
  int foundT=res.sortedDynamicWeights.length;
  int maxFetching=(ctx.documentFetchLimit < foundT) ? ctx.documentFetchLimit : foundT;
  List<DocTeaserWeight> weightedTeasers=new ArrayList<DocTeaserWeight>(maxFetching);
  int termsMT=(null == query.planner.mustTerms) ? 0 : query.planner.mustTerms.size();
  int termsOT=(null == query.planner.optionalTerms) ? 0 : query.planner.optionalTerms.size();
  byte[][] wordsB=new byte[termsMT + termsOT][];
  for (int i=0; i < termsMT; i++) {
    wordsB[i]=new Storable(query.planner.mustTerms.get(i).wordOrig).toBytes();
  }
  for (int i=0; i < termsOT; i++) {
    wordsB[i + termsMT]=new Storable(query.planner.optionalTerms.get(i).wordOrig).toBytes();
  }
  TeaserFilter tf=new TeaserFilter(wordsB);
  for (int i=0; i < maxFetching; i++) {
    DocMetaWeight metaWt=(DocMetaWeight)res.sortedDynamicWeights[i];
    byte[] idB=metaWt.id.getBytes();
    List<NVBytes> flds=HReader.getCompleteRow(IOConstants.TABLE_PREVIEW,idB,tf);
    weightedTeasers.add(new DocTeaserWeight(idB,flds,metaWt.weight));
  }
  res.teasers=weightedTeasers.toArray();
  DocTeaserWeight.sort(res.teasers);
  return true;
}
Program: 83984
Project: 83984
Buggy source:
public boolean isToday(){
  DateFormat formatter=new SimpleDateFormat("String_Node_Str");
  formatter.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  if (formatter.format((new Date())).equals(formatter.format(this.birthday)))   return true;
  return false;
}

Fixed version (ground truth):
public boolean isToday(){
  DateFormat formatter=new SimpleDateFormat("String_Node_Str");
  formatter.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  this.birthday.setDate(this.birthday.getDate() + 1);
  if (formatter.format((new Date())).equals(formatter.format(this.birthday))) {
    this.birthday.setDate(this.birthday.getDate() - 1);
    return true;
  }
  this.birthday.setDate(this.birthday.getDate() - 1);
  return false;
}
Program: 83985
Project: 83985
Buggy source:
@Override public void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  PersistenceManager pm=PMF.get().getPersistenceManager();
  long id=Long.parseLong(req.getParameter("String_Node_Str"));
  String message=req.getParameter("String_Node_Str");
  FacebookClient fbClient=new DefaultFacebookClient(Config.ACCESS_TOKEN(req));
  User user=fbClient.fetchObject(Long.toString(id),User.class);
  Birthday bday=null;
  HttpSession session=req.getSession(true);
  try {
    bday=new Birthday(user.getBirthday(),user,message,(String)session.getAttribute("String_Node_Str"),req);
  }
 catch (  ParseException e) {
    e.printStackTrace();
  }
  try {
    pm.makePersistent(bday);
  }
  finally {
    pm.close();
  }
  resp.getWriter().println("String_Node_Str");
  resp.sendRedirect("String_Node_Str");
}

Fixed version (ground truth):
@Override public void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  PersistenceManager pm=PMF.get().getPersistenceManager();
  long id=Long.parseLong(req.getParameter("String_Node_Str"));
  String message=req.getParameter("String_Node_Str");
  FacebookClient fbClient=new DefaultFacebookClient(Config.ACCESS_TOKEN(req));
  User user=fbClient.fetchObject(Long.toString(id),User.class);
  Birthday bday=null;
  HttpSession session=req.getSession(true);
  try {
    bday=new Birthday(user.getBirthday(),user,message,(String)session.getAttribute("String_Node_Str"),req);
  }
 catch (  ParseException e) {
    resp.getWriter().println("String_Node_Str");
  }
  try {
    pm.makePersistent(bday);
  }
  finally {
    pm.close();
  }
  resp.getWriter().println("String_Node_Str");
  resp.sendRedirect("String_Node_Str");
}
Program: 83986
Project: 83986
Buggy source:
public void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  PersistenceManager pm=PMF.get().getPersistenceManager();
  List<Birthday> bdays=(List<Birthday>)pm.newQuery(Birthday.class).execute();
  List list=new ArrayList();
  for (  Birthday bday : bdays) {
    if (bday.isToday()) {
      FacebookClient fbClient=new DefaultFacebookClient(bday.getToken());
      FacebookType publishMessageResponse=fbClient.publish(bday.getUid() + "String_Node_Str",FacebookType.class,Parameter.with("String_Node_Str",bday.getMessage()));
      resp.getWriter().println("String_Node_Str" + publishMessageResponse.getId());
      list.add("String_Node_Str" + publishMessageResponse.getId() + "String_Node_Str"+ "String_Node_Str"+ bday.getUid()+ "String_Node_Str"+ bday.getWisher()+ "String_Node_Str"+ "String_Node_Str"+ bday.getMessage());
    }
  }
  Properties props=new Properties();
  Session session=Session.getDefaultInstance(props,null);
  String msgBody="String_Node_Str";
  try {
    for (int i=0; i < list.size(); i++) {
      msgBody=msgBody + "String_Node_Str" + list.get(i);
    }
  }
 catch (  Exception e) {
  }
  try {
    Message msg=new MimeMessage(session);
    msg.setFrom(new InternetAddress("String_Node_Str","String_Node_Str"));
    msg.addRecipient(Message.RecipientType.TO,new InternetAddress("String_Node_Str","String_Node_Str"));
    msg.setSubject("String_Node_Str");
    msg.setText(msgBody);
    Transport.send(msg);
  }
 catch (  AddressException e) {
  }
catch (  MessagingException e) {
  }
}

Fixed version (ground truth):
public void doPost(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  PersistenceManager pm=PMF.get().getPersistenceManager();
  List<Birthday> bdays=(List<Birthday>)pm.newQuery(Birthday.class).execute();
  for (  Birthday bday : bdays) {
    if (bday.isToday()) {
      FacebookClient fbClient=new DefaultFacebookClient(bday.getToken());
      FacebookType publishMessageResponse=fbClient.publish(bday.getUid() + "String_Node_Str",FacebookType.class,Parameter.with("String_Node_Str",bday.getMessage()));
      resp.getWriter().println("String_Node_Str" + publishMessageResponse.getId());
    }
 else {
      resp.getWriter().println(bday.getDate() + "String_Node_Str");
    }
  }
}
Program: 83987
Project: 83987
Buggy source:
public int getAge(){
  if (birthday.getYear() == 70)   return 0;
  Calendar dateOfBirth=new GregorianCalendar(birthday.getYear(),birthday.getMonth(),birthday.getDay());
  Calendar then=new GregorianCalendar((new Date()).getYear(),birthday.getMonth(),birthday.getDay());
  int age=then.get(Calendar.YEAR) - dateOfBirth.get(Calendar.YEAR);
  dateOfBirth.add(Calendar.YEAR,age);
  if (then.before(dateOfBirth)) {
    age--;
  }
  return age;
}

Fixed version (ground truth):
public int getAge(){
  if (birthday.getYear() == 70)   return 0;
  Calendar dateOfBirth=new GregorianCalendar(birthday.getYear(),birthday.getMonth(),birthday.getDay());
  Calendar then=new GregorianCalendar((new Date()).getYear(),birthday.getMonth(),birthday.getDay());
  int age=then.get(Calendar.YEAR) - dateOfBirth.get(Calendar.YEAR);
  dateOfBirth.add(Calendar.YEAR,age);
  return age;
}
Program: 83988
Project: 83988
Buggy source:
public boolean isToday(){
  DateFormat formatter=new SimpleDateFormat("String_Node_Str");
  if (formatter.format((new Date())).equals(formatter.format(this.birthday)))   return true;
  return false;
}

Fixed version (ground truth):
public boolean isToday(){
  DateFormat formatter=new SimpleDateFormat("String_Node_Str");
  formatter.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  if (formatter.format((new Date())).equals(formatter.format(this.birthday)))   return true;
  return false;
}
Program: 83989
Project: 83989
Buggy source:
@Override protected void onBeforeRender(){
  super.onBeforeRender();
  if (isExpanded()) {
    container.add(AttributeAppenderFactory.newAttributeAppenderForClass("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override protected void onBeforeRender(){
  super.onBeforeRender();
  addCssClasses();
}
Program: 83990
Project: 83990
Buggy source:
public final void togglePaneExpanded(final TogglePaneStateEvent stateEventParam){
  final TogglePaneState state=stateEventParam.getSource();
  Reqs.PRE_COND.Logic.requireTrue(isTogglePaneBelongingToThisAccordion(state),"String_Node_Str");
  if (maximumOneTogglePaneExpanded) {
    Reqs.PRE_COND.Logic.requireTrue(expandedTogglePaneStates.size() <= 1,"String_Node_Str");
    final List<TogglePaneState> expandedTogglePanesStatesCopy=new ArrayList<TogglePaneState>(expandedTogglePaneStates);
    for (    final TogglePaneState current : expandedTogglePanesStatesCopy) {
      current.toggleContent();
    }
  }
  expandedTogglePaneStates.add(stateEventParam.getSource());
  Reqs.POST_COND.Logic.requireTrue(expandedTogglePaneStates.size() == 1,"String_Node_Str");
}

Fixed version (ground truth):
public final void togglePaneExpanded(final TogglePaneStateEvent stateEventParam){
  final TogglePaneState state=stateEventParam.getSource();
  Reqs.PRE_COND.Logic.requireTrue(isTogglePaneBelongingToThisAccordion(state),"String_Node_Str");
  if (maximumOneTogglePaneExpanded) {
    Reqs.PRE_COND.Logic.requireTrue(expandedTogglePaneStates.size() <= 1,"String_Node_Str");
    final List<TogglePaneState> expandedTogglePanesStatesCopy=new ArrayList<TogglePaneState>(expandedTogglePaneStates);
    for (    final TogglePaneState current : expandedTogglePanesStatesCopy) {
      current.toggleContent();
    }
    Reqs.POST_COND.Logic.requireTrue(expandedTogglePaneStates.size() == 1,"String_Node_Str");
  }
  expandedTogglePaneStates.add(stateEventParam.getSource());
}
Program: 83992
Project: 83992
Buggy source:
public static EdmDataServices parseMetadata(XMLEventReader2 reader){
  List<EdmSchema> schemas=new ArrayList<EdmSchema>();
  ODataVersion version=null;
  boolean foundDataServices=false;
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    boolean shouldReturn=false;
    if (isStartElement(event,EDMX_DATASERVICES)) {
      foundDataServices=true;
      String str=getAttributeValueIfExists(event.asStartElement(),new QName2(NS_METADATA,"String_Node_Str"));
      version=str != null ? ODataVersion.valueOf(str) : null;
    }
    if (isStartElement(event,EDM2006_SCHEMA,EDM2007_SCHEMA,EDM2008_SCHEMA,EDM2009_SCHEMA)) {
      schemas.add(parseEdmSchema(reader,event.asStartElement()));
      if (!foundDataServices)       shouldReturn=true;
    }
    if (isEndElement(event,EDMX_DATASERVICES))     shouldReturn=true;
    if (shouldReturn) {
      EdmDataServices rt=new EdmDataServices(version,schemas);
      resolve(rt);
      return rt;
    }
  }
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public static EdmDataServices parseMetadata(XMLEventReader2 reader){
  List<EdmSchema> schemas=new ArrayList<EdmSchema>();
  ODataVersion version=null;
  boolean foundDataServices=false;
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    boolean shouldReturn=false;
    if (isStartElement(event,EDMX_DATASERVICES)) {
      foundDataServices=true;
      String str=getAttributeValueIfExists(event.asStartElement(),new QName2(NS_METADATA,"String_Node_Str"));
      version=str != null ? ODataVersion.parse(str) : null;
    }
    if (isStartElement(event,EDM2006_SCHEMA,EDM2007_SCHEMA,EDM2008_SCHEMA,EDM2009_SCHEMA)) {
      schemas.add(parseEdmSchema(reader,event.asStartElement()));
      if (!foundDataServices)       shouldReturn=true;
    }
    if (isEndElement(event,EDMX_DATASERVICES))     shouldReturn=true;
    if (shouldReturn) {
      EdmDataServices rt=new EdmDataServices(version,schemas);
      resolve(rt);
      return rt;
    }
  }
  throw new UnsupportedOperationException();
}
Program: 83995
Project: 83995
Buggy source:
public void insertEntityWithInlinedEntityJson(){
  insertEntityWithInlinedEntity(ODataConsumer.create(FormatType.JSON,endpointUri));
}

Fixed version (ground truth):
@Test public void insertEntityWithInlinedEntityJson(){
  insertEntityWithInlinedEntity(ODataConsumer.create(FormatType.JSON,endpointUri));
}
Program: 83997
Project: 83997
Buggy source:
public static void main(String... args){
  ODataConsumer c=ODataConsumer.create(ODataEndpoints.NETFLIX);
  ODataConsumer.dump.all(true);
  int morganSpurlockId=c.getEntities("String_Node_Str").filter("String_Node_Str").execute().first().getProperty("String_Node_Str",Integer.class).getValue();
  List<OEntity> titlesActedIn=c.getEntities("String_Node_Str").nav(morganSpurlockId,"String_Node_Str").execute().toList();
  for (  OEntity title : titlesActedIn) {
    for (    OProperty<?> p : title.getProperties()) {
      report("String_Node_Str",p.getName(),p.getValue());
    }
    report("String_Node_Str");
    for (    OLink link : title.getLinks()) {
      System.out.println("String_Node_Str" + link);
    }
  }
  report("String_Node_Str" + titlesActedIn.size());
}

Fixed version (ground truth):
public static void main(String... args){
  ODataConsumer c=ODataConsumer.create(ODataEndpoints.NETFLIX);
  int morganSpurlockId=c.getEntities("String_Node_Str").filter("String_Node_Str").execute().first().getProperty("String_Node_Str",Integer.class).getValue();
  List<OEntity> titlesActedIn=c.getEntities("String_Node_Str").nav(morganSpurlockId,"String_Node_Str").execute().toList();
  for (  OEntity title : titlesActedIn) {
    for (    OProperty<?> p : title.getProperties()) {
      report("String_Node_Str",p.getName(),p.getValue());
    }
    report("String_Node_Str");
  }
  report("String_Node_Str" + titlesActedIn.size());
}
Program: 83998
Project: 83998
Buggy source:
@SuppressWarnings("String_Node_Str") public static void main(String[] args){
  ODataConsumer.dump.requestHeaders(true);
  Enumerable<String> smallServices=Enumerable.create(ODataEndpoints.NORTHWIND,ODataEndpoints.ODATA4JSAMPLE_APPSPOT,ODataEndpoints.ODATA_WEBSITE_DATA,ODataEndpoints.ODATA_TEST_SERVICE_READONLY,ODataEndpoints.NERD_DINNER,ODataEndpoints.MIX10,ODataEndpoints.TECH_ED,ODataEndpoints.EU_TECH_ED,ODataEndpoints.PLURALSIGHT,ODataEndpoints.TELERIK_TV,ODataEndpoints.AGILITRAIN,ODataEndpoints.PROAGORA_FR,ODataEndpoints.PROAGORA_EN);
  Enumerable<String> brokenServices=Enumerable.create(ODataEndpoints.CITY_OF_EDMONTON,ODataEndpoints.DEVEXPRESS,ODataEndpoints.DEVTRANSIT,ODataEndpoints.LOGMYTIME);
  Enumerable<String> largeServices=Enumerable.create(ODataEndpoints.BASEBALL_STATS,ODataEndpoints.NETFLIX,ODataEndpoints.STACK_OVERFLOW,ODataEndpoints.SUPER_USER,ODataEndpoints.SERVER_FAULT,ODataEndpoints.META_STACK_OVERFLOW,ODataEndpoints.WORLD_CUP);
  for (  String endpoint : smallServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).execute());
    }
    return;
  }
  for (  String endpoint : largeServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).top(1).execute());
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void main(String[] args){
  ODataConsumer.dump.requestHeaders(true);
  Enumerable<String> smallServices=Enumerable.create(ODataEndpoints.NORTHWIND,ODataEndpoints.ODATA4JSAMPLE_APPSPOT,ODataEndpoints.ODATA_WEBSITE_DATA,ODataEndpoints.ODATA_TEST_SERVICE_READONLY,ODataEndpoints.NERD_DINNER,ODataEndpoints.TECH_ED,ODataEndpoints.EU_TECH_ED,ODataEndpoints.PLURALSIGHT,ODataEndpoints.TELERIK_TV,ODataEndpoints.AGILITRAIN,ODataEndpoints.PROAGORA_FR,ODataEndpoints.PROAGORA_EN,ODataEndpoints.INETA_LIVE);
  Enumerable<String> brokenServices=Enumerable.create(ODataEndpoints.CITY_OF_EDMONTON,ODataEndpoints.DEVEXPRESS,ODataEndpoints.DEVTRANSIT,ODataEndpoints.LOGMYTIME,ODataEndpoints.PDC_2010,ODataEndpoints.MIX10);
  Enumerable<String> largeServices=Enumerable.create(ODataEndpoints.BASEBALL_STATS,ODataEndpoints.NETFLIX,ODataEndpoints.WORLD_CUP);
  for (  String endpoint : smallServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).execute());
    }
  }
  for (  String endpoint : largeServices) {
    ODataConsumer c=ODataConsumer.create(endpoint);
    for (    String entitySet : c.getEntitySets()) {
      reportEntities(entitySet,c.getEntities(entitySet).top(1).execute());
    }
  }
}
Program: 83999
Project: 83999
Buggy source:
public ODataClient(FormatType type,Class<F> feedClass,Class<E> entryClass,OClientBehavior... behaviors){
  this.feedClass=feedClass;
  this.entryClass=entryClass;
  this.behaviors=Enumerable.create(requiredBehaviors).concat(Enumerable.create(behaviors)).toArray(OClientBehavior.class);
  this.type=type;
  this.client=ClientUtil.newClient(behaviors);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public ODataClient(FormatType type,Class<?> feedClass,Class<?> entryClass,OClientBehavior... behaviors){
  this.feedClass=(Class<F>)feedClass;
  this.entryClass=(Class<E>)entryClass;
  this.behaviors=Enumerable.create(requiredBehaviors).concat(Enumerable.create(behaviors)).toArray(OClientBehavior.class);
  this.type=type;
  this.client=ClientUtil.newClient(behaviors);
}
Program: 84000
Project: 84000
Buggy source:
public OEntityRef<Void> deleteEntity(String entitySetName,Object... key){
  return createDeleteOEntityRefImpl(entitySetName,key);
}

Fixed version (ground truth):
public OEntityRef<Void> deleteEntity(String entitySetName,Object... key){
  FeedCustomizationMapping mapping=getFeedCustomizationMapping(entitySetName);
  return new OEntityRefImpl<Void,Feed<Entry>,Entry>(true,client,null,serviceRootUri,getMetadata(),entitySetName,key,mapping);
}
Program: 84001
Project: 84001
Buggy source:
public <T>OEntityRef<T> getEntity(Class<T> entityType,String entitySetName,Object... key){
  return createGetOEntityRefImpl(entityType,entitySetName,key);
}

Fixed version (ground truth):
public <T>OEntityRef<T> getEntity(Class<T> entityType,String entitySetName,Object... key){
  FeedCustomizationMapping mapping=getFeedCustomizationMapping(entitySetName);
  return new OEntityRefImpl<T,Feed<Entry>,Entry>(false,client,entityType,serviceRootUri,getMetadata(),entitySetName,key,mapping);
}
Program: 84002
Project: 84002
Buggy source:
public OCreate<OEntity> createEntity(String entitySetName){
  return createOCreateImpl(entitySetName);
}

Fixed version (ground truth):
public OCreate<OEntity> createEntity(String entitySetName){
  FeedCustomizationMapping mapping=getFeedCustomizationMapping(entitySetName);
  return new OCreateImpl<OEntity,Feed<Entry>,Entry>(client,serviceRootUri,getMetadata(),entitySetName,mapping);
}
Program: 84003
Project: 84003
Buggy source:
public OModify<OEntity> updateEntity(OEntity entity,String entitySetName,Object... key){
  return createOModifyImpl(entity,entitySetName,key);
}

Fixed version (ground truth):
public OModify<OEntity> updateEntity(OEntity entity,String entitySetName,Object... key){
  return new OModifyImpl<OEntity,Feed<Entry>,Entry>(entity,client,serviceRootUri,entitySetName,key);
}
Program: 84004
Project: 84004
Buggy source:
public <T>OQuery<T> getEntities(Class<T> entityType,String entitySetName){
  return createOQueryImpl(entityType,entitySetName);
}

Fixed version (ground truth):
public <T>OQuery<T> getEntities(Class<T> entityType,String entitySetName){
  FeedCustomizationMapping mapping=getFeedCustomizationMapping(entitySetName);
  return new OQueryImpl<T,Feed<Entry>,Entry>(client,entityType,serviceRootUri,getMetadata(),entitySetName,mapping);
}
Program: 84005
Project: 84005
Buggy source:
public OModify<OEntity> mergeEntity(String entitySetName,Object... key){
  return createOModifyImpl(null,entitySetName,key);
}

Fixed version (ground truth):
public OModify<OEntity> mergeEntity(String entitySetName,Object... key){
  return new OModifyImpl<OEntity,Feed<Entry>,Entry>(null,client,serviceRootUri,entitySetName,key);
}