nus-yam/ex-repair huggingface dataset:
Program: 4005
Project: 4005
Buggy source:
private void tickOnSocket(ClientRequest req,TCP.Socket socket) throws Exception {
  parserOnIncomingClient parser=new parserOnIncomingClient(context,socket);
  req.socket=socket;
  req.connection=socket;
  parser.Reinitialize(http_parser_type.HTTP_RESPONSE);
  parser.socket=socket;
  parser.incoming=null;
  req.setParser(parser);
  socket.setParser(parser);
  socket.set_httpMessage(req);
  Log.d(TAG,"String_Node_Str" + req.connection);
  HTTP.httpSocketSetup(socket);
  if (req.maxHeadersCount > 0) {
    parser.maxHeaderPairs=req.maxHeadersCount << 1;
  }
 else {
    parser.maxHeaderPairs=2000;
  }
  this.socketErrorListener=new socketErrorListener(context,socket);
  socket.on("String_Node_Str",socketErrorListener);
  socket.get_readableState().setFlowing(TripleState.TRUE);
  this.socketOnData=new socketOnData(context,socket);
  socket.on("String_Node_Str",socketOnData);
  this.socketOnEnd=new socketOnEnd(context,socket);
  socket.on("String_Node_Str",socketOnEnd);
  this.socketCloseListener=new socketCloseListener(context,socket);
  socket.on("String_Node_Str",socketCloseListener);
  req.emit("String_Node_Str",socket);
  Log.d(TAG,"String_Node_Str" + socket);
}

Fixed version (ground truth):
private void tickOnSocket(ClientRequest req,TCP.Socket socket) throws Exception {
  parserOnIncomingClient parser=new parserOnIncomingClient(context,socket);
  req.socket=socket;
  req.connection=socket;
  parser.Reinitialize(http_parser_type.HTTP_RESPONSE);
  parser.socket=socket;
  parser.incoming=null;
  req.setParser(parser);
  socket.setParser(parser);
  socket.set_httpMessage(req);
  Log.d(TAG,"String_Node_Str" + req.connection);
  http.httpSocketSetup(socket);
  if (req.maxHeadersCount > 0) {
    parser.maxHeaderPairs=req.maxHeadersCount << 1;
  }
 else {
    parser.maxHeaderPairs=2000;
  }
  this.socketErrorListener=new socketErrorListener(context,socket);
  socket.on("String_Node_Str",socketErrorListener);
  socket.get_readableState().setFlowing(TripleState.TRUE);
  this.socketOnData=new socketOnData(context,socket);
  socket.on("String_Node_Str",socketOnData);
  this.socketOnEnd=new socketOnEnd(context,socket);
  socket.on("String_Node_Str",socketOnEnd);
  this.socketCloseListener=new socketCloseListener(context,socket);
  socket.on("String_Node_Str",socketCloseListener);
  req.emit("String_Node_Str",socket);
  Log.d(TAG,"String_Node_Str" + socket);
}
Program: 4008
Project: 4008
Buggy source:
public void addTrailers(Map<String,String> headers){
  this._trailer="String_Node_Str";
  for (  Entry<String,String> entry : headers.entrySet())   this._trailer+=entry.getKey() + "String_Node_Str" + entry.getValue()+ HTTP.CRLF;
}

Fixed version (ground truth):
public void addTrailers(Map<String,String> headers){
  this._trailer="String_Node_Str";
  for (  Entry<String,String> entry : headers.entrySet())   this._trailer+=entry.getKey() + "String_Node_Str" + entry.getValue()+ http.CRLF;
}
Program: 4010
Project: 4010
Buggy source:
protected void storeHeader(_State state,String field,String value){
  OutgoingMessage self=this;
  value=value.replaceAll("String_Node_Str","String_Node_Str");
  state.messageHeader+=field + "String_Node_Str" + value+ HTTP.CRLF;
  if (Pattern.matches(connectionExpression,field)) {
    state.sentConnectionHeader=true;
    if (Pattern.matches(closeExpression,value)) {
      self._last=true;
    }
 else {
      self.shouldKeepAlive=true;
    }
  }
 else   if (Pattern.matches(transferEncodingExpression,field)) {
    state.sentTransferEncodingHeader=true;
    if (Pattern.matches(HTTP.chunkExpression,value))     self.chunkedEncoding=true;
  }
 else   if (Pattern.matches(contentLengthExpression,field)) {
    state.sentContentLengthHeader=true;
  }
 else   if (Pattern.matches(dateExpression,field)) {
    state.sentDateHeader=true;
  }
 else   if (Pattern.matches(expectExpression,field)) {
    state.sentExpect=true;
  }
}

Fixed version (ground truth):
protected void storeHeader(_State state,String field,String value){
  OutgoingMessage self=this;
  value=value.replaceAll("String_Node_Str","String_Node_Str");
  state.messageHeader+=field + "String_Node_Str" + value+ http.CRLF;
  if (Pattern.matches(connectionExpression,field)) {
    state.sentConnectionHeader=true;
    if (Pattern.matches(closeExpression,value)) {
      self._last=true;
    }
 else {
      self.shouldKeepAlive=true;
    }
  }
 else   if (Pattern.matches(transferEncodingExpression,field)) {
    state.sentTransferEncodingHeader=true;
    if (Pattern.matches(http.chunkExpression,value))     self.chunkedEncoding=true;
  }
 else   if (Pattern.matches(contentLengthExpression,field)) {
    state.sentContentLengthHeader=true;
  }
 else   if (Pattern.matches(dateExpression,field)) {
    state.sentDateHeader=true;
  }
 else   if (Pattern.matches(expectExpression,field)) {
    state.sentExpect=true;
  }
}
Program: 4012
Project: 4012
Buggy source:
/** 
 * create a WordElement with the specified baseForm, category, ID
 * @param baseForm - base form of WordElement
 * @param category - category of WordElement
 * @param id - ID of word in lexicon
 */
public WordElement(String baseForm,LexicalCategory category,String id){
  super();
  this.baseForm=baseForm;
  setCategory(category);
  this.id=id;
  this.inflVars=new HashMap<Inflection,InflectionSet>();
}

Fixed version (ground truth):
/** 
 * creates a duplicate WordElement from an existing WordElement
 * @param currentWord - An existing WordElement
 */
public WordElement(WordElement currentWord){
  super();
  this.baseForm=currentWord.getBaseForm();
  setCategory(currentWord.getCategory());
  this.id=currentWord.getId();
  this.inflVars=currentWord.getInflectionalVariants();
  this.defaultInfl=(Inflection)currentWord.getDefaultInflectionalVariant();
  setFeatures(currentWord);
}
Program: 4013
Project: 4013
Buggy source:
/** 
 * get matching keys from an index map
 * @param indexKey
 * @param category
 * @param indexMap
 * @return
 */
private List<WordElement> getWordsFromIndex(String indexKey,LexicalCategory category,Map<String,List<WordElement>> indexMap){
  List<WordElement> result=new ArrayList<WordElement>();
  if (!indexMap.containsKey(indexKey))   return result;
  if (category == LexicalCategory.ANY)   return indexMap.get(indexKey);
 else   for (  WordElement word : indexMap.get(indexKey))   if (word.getCategory() == category)   result.add(word);
  return result;
}

Fixed version (ground truth):
/** 
 * get matching keys from an index map
 * @param indexKey
 * @param category
 * @param indexMap
 * @return
 */
private List<WordElement> getWordsFromIndex(String indexKey,LexicalCategory category,Map<String,List<WordElement>> indexMap){
  List<WordElement> result=new ArrayList<WordElement>();
  if (!indexMap.containsKey(indexKey)) {
    return result;
  }
  if (category == LexicalCategory.ANY) {
    for (    WordElement word : indexMap.get(indexKey)) {
      result.add(new WordElement(word));
    }
    return result;
  }
 else {
    for (    WordElement word : indexMap.get(indexKey)) {
      if (word.getCategory() == category) {
        result.add(new WordElement(word));
      }
    }
  }
  return result;
}
Program: 4015
Project: 4015
Buggy source:
@Override public List<WordElement> getWordsByID(String id){
  List<WordElement> result=new ArrayList<WordElement>();
  if (indexByID.containsKey(id))   result.add(indexByID.get(id));
  return result;
}

Fixed version (ground truth):
@Override public List<WordElement> getWordsByID(String id){
  List<WordElement> result=new ArrayList<WordElement>();
  if (indexByID.containsKey(id)) {
    result.add(new WordElement(indexByID.get(id)));
  }
  return result;
}
Program: 4016
Project: 4016
Buggy source:
@Override public List<NLGElement> realise(List<NLGElement> elements){
  return null;
}

Fixed version (ground truth):
@Override public List<NLGElement> realise(List<NLGElement> elements){
  List<NLGElement> realisedElements=new ArrayList<NLGElement>();
  if (null != elements) {
    for (    NLGElement element : elements) {
      NLGElement realisedElement=realise(element);
      realisedElements.add(realisedElement);
    }
  }
  return realisedElements;
}
Program: 4017
Project: 4017
Buggy source:
/** 
 * Realises the specifier of the noun phrase.
 * @param phrase the <code>PhraseElement</code> representing this noun phrase.
 * @param parent the parent <code>SyntaxProcessor</code> that will do the realisation of the complementiser.
 * @param realisedElement the current realisation of the noun phrase.
 */
private static void realiseSpecifier(PhraseElement phrase,SyntaxProcessor parent,ListElement realisedElement){
  NLGElement specifierElement=phrase.getFeatureAsElement(InternalFeature.SPECIFIER);
  if (specifierElement != null && !phrase.getFeatureAsBoolean(InternalFeature.RAISED).booleanValue() && !phrase.getFeatureAsBoolean(Feature.ELIDED).booleanValue()) {
    if (!specifierElement.isA(LexicalCategory.PRONOUN)) {
      specifierElement.setFeature(Feature.NUMBER,phrase.getFeature(Feature.NUMBER));
    }
    NLGElement currentElement=parent.realise(specifierElement);
    if (currentElement != null) {
      currentElement.setFeature(InternalFeature.DISCOURSE_FUNCTION,DiscourseFunction.SPECIFIER);
      realisedElement.addComponent(currentElement);
    }
  }
}

Fixed version (ground truth):
/** 
 * Realises the specifier of the noun phrase.
 * @param phrase the <code>PhraseElement</code> representing this noun phrase.
 * @param parent the parent <code>SyntaxProcessor</code> that will do the realisation of the complementiser.
 * @param realisedElement the current realisation of the noun phrase.
 */
private static void realiseSpecifier(PhraseElement phrase,SyntaxProcessor parent,ListElement realisedElement){
  NLGElement specifierElement=phrase.getFeatureAsElement(InternalFeature.SPECIFIER);
  if (specifierElement != null && !phrase.getFeatureAsBoolean(InternalFeature.RAISED).booleanValue() && !phrase.getFeatureAsBoolean(Feature.ELIDED).booleanValue()) {
    if (!specifierElement.isA(LexicalCategory.PRONOUN) && specifierElement.getCategory() != PhraseCategory.NOUN_PHRASE) {
      specifierElement.setFeature(Feature.NUMBER,phrase.getFeature(Feature.NUMBER));
    }
    NLGElement currentElement=parent.realise(specifierElement);
    if (currentElement != null) {
      currentElement.setFeature(InternalFeature.DISCOURSE_FUNCTION,DiscourseFunction.SPECIFIER);
      realisedElement.addComponent(currentElement);
    }
  }
}
Program: 4018
Project: 4018
Buggy source:
/** 
 * Write recording.
 * @param record the record
 * @param os the os
 * @throws JAXBException the jAXB exception
 * @throws IOException Signals that an I/O exception has occurred.
 * @throws TransformerException the transformer exception
 */
public static void writeRecording(RecordSet record,OutputStream os) throws JAXBException, IOException, TransformerException {
  JAXBContext jc;
  jc=JAXBContext.newInstance(simplenlg.xmlrealiser.wrapper.NLGSpec.class);
  Marshaller m=jc.createMarshaller();
  m.setProperty("String_Node_Str",new RecordingNamespacePrefixMapper());
  NLGSpec nlg=new NLGSpec();
  nlg.setRecording(record);
  StringWriter osTemp=new StringWriter();
  m.marshal(nlg,osTemp);
  Source xmlInput=new StreamSource(new StringReader(osTemp.toString()));
  StreamResult xmlOutput=new StreamResult(new OutputStreamWriter(os,"String_Node_Str"));
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (transformer != null) {
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    transformer.setOutputProperty("String_Node_Str","String_Node_Str");
    transformer.transform(xmlInput,xmlOutput);
  }
}

Fixed version (ground truth):
/** 
 * Write recording.
 * @param record the record
 * @param os the os
 * @throws JAXBException the jAXB exception
 * @throws IOException Signals that an I/O exception has occurred.
 * @throws TransformerException the transformer exception
 */
public static void writeRecording(RecordSet record,OutputStream os) throws JAXBException, IOException, TransformerException {
  JAXBContext jc;
  jc=JAXBContext.newInstance(simplenlg.xmlrealiser.wrapper.NLGSpec.class);
  Marshaller m=jc.createMarshaller();
  NLGSpec nlg=new NLGSpec();
  nlg.setRecording(record);
  StringWriter osTemp=new StringWriter();
  m.marshal(nlg,osTemp);
  Source xmlInput=new StreamSource(new StringReader(osTemp.toString()));
  StreamResult xmlOutput=new StreamResult(new OutputStreamWriter(os,"String_Node_Str"));
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (transformer != null) {
    transformer.setOutputProperty(OutputKeys.INDENT,"String_Node_Str");
    transformer.setOutputProperty("String_Node_Str","String_Node_Str");
    transformer.transform(xmlInput,xmlOutput);
  }
}
Program: 4019
Project: 4019
Buggy source:
/** 
 * Called when the HTML textbox is moved. It moves the edittext as well
 * @param frect the form rect
 * @param trect text textbox rect
 */
protected void replace(Rect frect,Rect trect){
  RelativeLayout.LayoutParams rparams;
  if (bpos.update(frect,trect)) {
    Utils utils=new Utils(wav);
    rparams=(RelativeLayout.LayoutParams)divw.getLayoutParams();
    rparams.topMargin=frect.top + (int)utils.pxFromDp(8);
    rparams.leftMargin=frect.left + (int)utils.pxFromDp(8);
    rparams.width=LayoutParams.MATCH_PARENT;
    divw.setLayoutParams(rparams);
  }
  if (bpos.shallShow()) {
    divw.setVisibility(View.VISIBLE);
    ew.requestFocus();
    if (hwkeyb)     imm.hideSoftInputFromWindow(ew.getWindowToken(),0);
  }
}

Fixed version (ground truth):
/** 
 * Called when the HTML textbox is moved. It moves the edittext as well
 * @param frect the form rect
 * @param trect text textbox rect
 */
protected void replace(Rect frect,Rect trect){
  RelativeLayout.LayoutParams rparams;
  if (bpos.update(frect,trect)) {
    Utils utils=new Utils(wav);
    rparams=(RelativeLayout.LayoutParams)divw.getLayoutParams();
    rparams.topMargin=frect.top + (int)utils.pxFromDp(8);
    rparams.leftMargin=frect.left + (int)utils.pxFromDp(8);
    rparams.width=LayoutParams.MATCH_PARENT;
    divw.setLayoutParams(rparams);
  }
  if (bpos.shallShow()) {
    divw.setVisibility(View.VISIBLE);
    wv.loadUrl("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
    if (hwkeyb)     imm.hideSoftInputFromWindow(ew.getWindowToken(),0);
  }
}
Program: 4020
Project: 4020
Buggy source:
public void run(){
  if (updateSequence(sequence))   showQuestion(type,name,rect,size);
}

Fixed version (ground truth):
@Override public void run(){
  ew.requestFocus();
}
Program: 4021
Project: 4021
Buggy source:
@Override public void onStop(){
  saveOfflineValues();
  super.onStop();
}

Fixed version (ground truth):
@Override public void onStop(){
  super.onStop();
}
Program: 4022
Project: 4022
Buggy source:
@Override public View onCreateView(LayoutInflater paramLayoutInflater,ViewGroup paramViewGroup,Bundle paramBundle){
  rootView=paramLayoutInflater.inflate(R.layout.fragment_dashboard,paramViewGroup,false);
  activity=getActivity();
  mPullToRefreshLayout=(PullToRefreshLayout)rootView.findViewById(R.id.dashboard_pull_to_refresh);
  ActionBarPullToRefresh.from(getActivity()).allChildrenArePullable().listener(this).setup(mPullToRefreshLayout);
  mAvailableHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_available_holder);
  mReviewsHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_reviews_holder);
  mRecentUnlocksFragmentHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_recent_unlocks_holder);
  mCriticalItemsFragmentHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_critical_items_holder);
  mPullToRefreshLayout.setRefreshing(true);
  Intent intent=new Intent(BroadcastIntents.SYNC());
  LocalBroadcastManager.getInstance(getActivity()).sendBroadcast(intent);
  return rootView;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater paramLayoutInflater,ViewGroup paramViewGroup,Bundle paramBundle){
  rootView=paramLayoutInflater.inflate(R.layout.fragment_dashboard,paramViewGroup,false);
  activity=getActivity();
  mPullToRefreshLayout=(PullToRefreshLayout)rootView.findViewById(R.id.dashboard_pull_to_refresh);
  ActionBarPullToRefresh.from(getActivity()).allChildrenArePullable().listener(this).setup(mPullToRefreshLayout);
  mAvailableHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_available_holder);
  mReviewsHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_reviews_holder);
  mRecentUnlocksFragmentHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_recent_unlocks_holder);
  mCriticalItemsFragmentHolder=(LinearLayout)rootView.findViewById(R.id.fragment_dashboard_critical_items_holder);
  if (!MainActivity.isFirstSyncDashboardDone) {
    mPullToRefreshLayout.setRefreshing(true);
    Intent intent=new Intent(BroadcastIntents.SYNC());
    LocalBroadcastManager.getInstance(getActivity()).sendBroadcast(intent);
    MainActivity.isFirstSyncDashboardDone=true;
  }
  return rootView;
}
Program: 4024
Project: 4024
Buggy source:
private void triggerBlockManagerWrite(){
  if (_numFetchToBuffer < _kafkaconfig._numFetchToBuffer) {
    return;
  }
  LOG.debug("String_Node_Str",_partition.partition);
  if ((_lastEnquedOffset >= _lastComittedOffset) && (_waitingToEmit.isEmpty())) {
    try {
synchronized (_receiver) {
        if (!_arrayBuffer.isEmpty() && !_receiver.isStopped()) {
          _receiver.store(_arrayBuffer.iterator());
          _arrayBuffer.clear();
        }
        commit();
        _numFetchToBuffer=1;
      }
    }
 catch (    Exception ex) {
      _emittedToOffset=_lastComittedOffset;
      _arrayBuffer.clear();
      if (ex instanceof InterruptedException) {
        throw ex;
      }
 else {
        _receiver.reportError("String_Node_Str" + _partition,ex);
      }
    }
  }
}

Fixed version (ground truth):
private void triggerBlockManagerWrite(){
  if (_numFetchToBuffer < _kafkaconfig._numFetchToBuffer) {
    return;
  }
  LOG.debug("String_Node_Str",_partition.partition);
  if ((_lastEnquedOffset >= _lastComittedOffset) && (_waitingToEmit.isEmpty())) {
    try {
synchronized (_receiver) {
        if (!_arrayBuffer.isEmpty() && !_receiver.isStopped()) {
          _receiver.store(_arrayBuffer.iterator());
          _arrayBuffer.clear();
          commit();
          _numFetchToBuffer=1;
        }
      }
    }
 catch (    Exception ex) {
      _emittedToOffset=_lastComittedOffset;
      _arrayBuffer.clear();
      if (ex instanceof InterruptedException) {
        throw ex;
      }
 else {
        _receiver.reportError("String_Node_Str" + _partition,ex);
      }
    }
  }
}
Program: 4025
Project: 4025
Buggy source:
public void commit(){
  LOG.debug("String_Node_Str",_lastComittedOffset);
  LOG.debug("String_Node_Str",_emittedToOffset);
  LOG.debug("String_Node_Str",_lastEnquedOffset);
  if (_lastEnquedOffset > _lastComittedOffset) {
    LOG.debug("String_Node_Str",_partition);
    Map<Object,Object> data=(Map<Object,Object>)ImmutableMap.builder().put("String_Node_Str",ImmutableMap.of("String_Node_Str",_consumerId)).put("String_Node_Str",_emittedToOffset).put("String_Node_Str",_partition.partition).put("String_Node_Str",ImmutableMap.of("String_Node_Str",_partition.host.host,"String_Node_Str",_partition.host.port)).put("String_Node_Str",_topic).build();
    try {
      _state.writeJSON(committedPath(),data);
      LOG.debug("String_Node_Str" + _emittedToOffset);
      _waitingToEmit.clear();
      _lastComittedOffset=_emittedToOffset;
    }
 catch (    Exception zkEx) {
      LOG.error("String_Node_Str",zkEx);
    }
    LOG.debug("String_Node_Str",_lastComittedOffset,_partition,_consumerId);
  }
 else {
    LOG.debug("String_Node_Str" + "String_Node_Str",_lastEnquedOffset,_lastComittedOffset,_partition,_consumerId);
  }
}

Fixed version (ground truth):
public void commit(){
  LOG.debug("String_Node_Str",_lastComittedOffset);
  LOG.debug("String_Node_Str",_emittedToOffset);
  LOG.debug("String_Node_Str",_lastEnquedOffset);
  if (_lastEnquedOffset >= _lastComittedOffset) {
    LOG.debug("String_Node_Str",_partition);
    Map<Object,Object> data=(Map<Object,Object>)ImmutableMap.builder().put("String_Node_Str",ImmutableMap.of("String_Node_Str",_consumerId)).put("String_Node_Str",_emittedToOffset).put("String_Node_Str",_partition.partition).put("String_Node_Str",ImmutableMap.of("String_Node_Str",_partition.host.host,"String_Node_Str",_partition.host.port)).put("String_Node_Str",_topic).build();
    try {
      _state.writeJSON(committedPath(),data);
      LOG.debug("String_Node_Str" + _emittedToOffset);
      _waitingToEmit.clear();
      _lastComittedOffset=_emittedToOffset;
    }
 catch (    Exception zkEx) {
      LOG.error("String_Node_Str",zkEx);
    }
    LOG.debug("String_Node_Str",_lastComittedOffset,_partition,_consumerId);
  }
 else {
    LOG.debug("String_Node_Str" + "String_Node_Str",_lastEnquedOffset,_lastComittedOffset,_partition,_consumerId);
  }
}
Program: 4026
Project: 4026
Buggy source:
public KafkaConsumer(KafkaConfig blurConfig,ZkState zkState,Receiver receiver){
  _kafkablurconfig=blurConfig;
  _state=zkState;
  _receiver=receiver;
}

Fixed version (ground truth):
public KafkaConsumer(KafkaConfig config,ZkState zkState,Receiver receiver){
  _kafkaconfig=config;
  _state=zkState;
  _receiver=receiver;
}
Program: 4027
Project: 4027
Buggy source:
@Override public void run(){
  try {
    while (!_receiver.isStopped()) {
      this.createStream();
    }
  }
 catch (  Throwable t) {
    this.close();
    throw new RuntimeException(t);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    while (!_receiver.isStopped()) {
      if ((System.currentTimeMillis() - _lastConsumeTime) > _kafkaconfig._fillFreqMs) {
        this.createStream();
        _lastConsumeTime=System.currentTimeMillis();
      }
 else {
        Thread.sleep(_kafkaconfig._fillFreqMs);
      }
    }
  }
 catch (  Throwable t) {
    this.close();
    throw new RuntimeException(t);
  }
}
Program: 4028
Project: 4028
Buggy source:
public void open(int partitionId){
  _currPartitionIndex=partitionId;
  _connections=new DynamicPartitionConnections(_kafkablurconfig,new ZkBrokerReader(_kafkablurconfig,_state));
  _coordinator=new ZkCoordinator(_connections,_kafkablurconfig,_state,partitionId,_receiver,true);
}

Fixed version (ground truth):
public void open(int partitionId){
  _currPartitionIndex=partitionId;
  _connections=new DynamicPartitionConnections(_kafkaconfig,new ZkBrokerReader(_kafkaconfig,_state));
  _coordinator=new ZkCoordinator(_connections,_kafkaconfig,_state,partitionId,_receiver,true);
}
Program: 4030
Project: 4030
Buggy source:
public void writeJSON(String path,Map<Object,Object> data){
  LOG.info("String_Node_Str" + path + "String_Node_Str"+ data.toString());
  writeBytes(path,JSONValue.toJSONString(data).getBytes(Charset.forName("String_Node_Str")));
}

Fixed version (ground truth):
public synchronized void writeJSON(String path,Map<Object,Object> data){
  LOG.info("String_Node_Str" + path + "String_Node_Str"+ data.toString());
  writeBytes(path,JSONValue.toJSONString(data).getBytes(Charset.forName("String_Node_Str")));
}
Program: 4031
Project: 4031
Buggy source:
private void run(){
  Properties props=new Properties();
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  SparkConf _sparkConf=new SparkConf().setAppName("String_Node_Str").set("String_Node_Str","String_Node_Str");
  ;
  JavaStreamingContext jsc=new JavaStreamingContext(_sparkConf,new Duration(1000));
  int numberOfReceivers=3;
  JavaDStream<MessageAndMetadata> unionStreams=ReceiverLauncher.launch(jsc,props,numberOfReceivers,StorageLevel.MEMORY_ONLY());
  unionStreams.foreachRDD(new Function2<JavaRDD<MessageAndMetadata>,Time,Void>(){
    @Override public Void call(    JavaRDD<MessageAndMetadata> rdd,    Time time) throws Exception {
      rdd.collect();
      System.out.println("String_Node_Str" + rdd.count());
      return null;
    }
  }
);
  jsc.start();
  jsc.awaitTermination();
}

Fixed version (ground truth):
private void run(){
  Properties props=new Properties();
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  SparkConf _sparkConf=new SparkConf().setAppName("String_Node_Str").set("String_Node_Str","String_Node_Str");
  ;
  JavaStreamingContext jsc=new JavaStreamingContext(_sparkConf,new Duration(1000));
  int numberOfReceivers=1;
  JavaDStream<MessageAndMetadata> unionStreams=ReceiverLauncher.launch(jsc,props,numberOfReceivers,StorageLevel.MEMORY_ONLY());
  unionStreams.foreachRDD(new Function2<JavaRDD<MessageAndMetadata>,Time,Void>(){
    @Override public Void call(    JavaRDD<MessageAndMetadata> rdd,    Time time) throws Exception {
      rdd.collect();
      System.out.println("String_Node_Str" + rdd.count());
      return null;
    }
  }
);
  jsc.start();
  jsc.awaitTermination();
}
Program: 4032
Project: 4032
Buggy source:
public void start(){
  _executorService=Executors.newFixedThreadPool(_partitionSet.size());
  for (  Integer partitionId : _partitionSet) {
    KafkaConfig kafkaConfig=new KafkaConfig(_props);
    ZkState zkState=new ZkState(kafkaConfig);
    _kConsumer=new KafkaConsumer(kafkaConfig,zkState,this);
    _kConsumer.open(partitionId);
    Thread.UncaughtExceptionHandler eh=new Thread.UncaughtExceptionHandler(){
      public void uncaughtException(      Thread th,      Throwable ex){
        restart("String_Node_Str",ex,5000);
      }
    }
;
    _consumerThread=new Thread(_kConsumer);
    _consumerThread.setDaemon(true);
    _consumerThread.setUncaughtExceptionHandler(eh);
    _executorService.submit(_consumerThread);
  }
}

Fixed version (ground truth):
public void start(){
  _threadList.clear();
  KafkaConfig kafkaConfig=new KafkaConfig(_props);
  ZkState zkState=new ZkState(kafkaConfig);
  for (  Integer partitionId : _partitionSet) {
    _kConsumer=new KafkaConsumer(kafkaConfig,zkState,this);
    _kConsumer.open(partitionId);
    Thread.UncaughtExceptionHandler eh=new Thread.UncaughtExceptionHandler(){
      public void uncaughtException(      Thread th,      Throwable ex){
        restart("String_Node_Str",ex,5000);
      }
    }
;
    _consumerThread=new Thread(_kConsumer);
    _consumerThread.setDaemon(true);
    _consumerThread.setUncaughtExceptionHandler(eh);
    _threadList.add(_consumerThread);
    _consumerThread.start();
  }
}
Program: 4033
Project: 4033
Buggy source:
@Override public void onStop(){
  _executorService.shutdown();
}

Fixed version (ground truth):
@Override public void onStop(){
  for (  Thread t : _threadList) {
    if (t.isAlive())     t.interrupt();
  }
}
Program: 4035
Project: 4035
Buggy source:
/** 
 * Pings a HTTP URL. This effectively sends a HEAD request and returns <code>true</code> if the response code is in the 200-399 range.
 * @param url     The HTTP URL to be pinged.
 * @param timeout The timeout in millis for both the connection timeout and the response read timeout. Note thatthe total timeout is effectively two times the given timeout.
 * @return <code>true</code> if the given HTTP URL has returned response code 200-399 on a HEAD request within thegiven timeout, otherwise <code>false</code>.
 */
public static boolean ping(String url,int timeout){
  url=url.replaceFirst("String_Node_Str","String_Node_Str");
  try {
    HttpURLConnection connection=(HttpURLConnection)new URL(url).openConnection();
    connection.setConnectTimeout(timeout);
    connection.setReadTimeout(timeout);
    connection.setRequestMethod("String_Node_Str");
    int responseCode=connection.getResponseCode();
    return (200 <= responseCode && responseCode <= 399);
  }
 catch (  IOException exception) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Pings a HTTP URL. This effectively sends a HEAD request and returns <code>true</code> if the response code is in the 200-399 range.
 * @param url     The HTTP URL to be pinged.
 * @param timeout The timeout in millis for both the connection timeout and the response read timeout. Note thatthe total timeout is effectively two times the given timeout.
 * @return <code>true</code> if the given HTTP URL has returned response code 200-399 on a HEAD request within thegiven timeout, otherwise <code>false</code>.
 */
public static boolean ping(String url,int timeout){
  url=url.replaceFirst("String_Node_Str","String_Node_Str");
  try {
    HttpURLConnection connection=(HttpURLConnection)new URL(url).openConnection();
    connection.setConnectTimeout(timeout);
    connection.setReadTimeout(timeout);
    connection.setRequestMethod("String_Node_Str");
    connection.setRequestProperty("String_Node_Str","String_Node_Str");
    int responseCode=connection.getResponseCode();
    return (200 <= responseCode && responseCode <= 399);
  }
 catch (  IOException exception) {
    exception.printStackTrace();
    return false;
  }
}
Program: 4036
Project: 4036
Buggy source:
public InternetConnectionChangeReceiver(Bus bus){
  this.bus=bus;
}

Fixed version (ground truth):
public InternetConnectionChangeReceiver(Bus bus){
  super(bus);
}
Program: 4037
Project: 4037
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction().equals(NetworkEventsConfig.INTENT)) {
    boolean connectedToInternet=intent.getBooleanExtra(NetworkEventsConfig.INTENT_EXTRA,false);
    ConnectivityStatus connectivityStatus=(connectedToInternet) ? ConnectivityStatus.WIFI_CONNECTED_HAS_INTERNET : ConnectivityStatus.WIFI_CONNECTED_HAS_NO_INTERNET;
    bus.post(new ConnectivityChanged(connectivityStatus));
  }
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  if (intent.getAction().equals(NetworkEventsConfig.INTENT)) {
    boolean connectedToInternet=intent.getBooleanExtra(NetworkEventsConfig.INTENT_EXTRA,false);
    ConnectivityStatus connectivityStatus=(connectedToInternet) ? ConnectivityStatus.WIFI_CONNECTED_HAS_INTERNET : ConnectivityStatus.WIFI_CONNECTED_HAS_NO_INTERNET;
    if (statusNotChanged(connectivityStatus))     return;
    postConnectivityChanged(connectivityStatus);
  }
}
Program: 4038
Project: 4038
Buggy source:
public NetworkConnectionChangeReceiver(Bus bus){
  this.bus=bus;
}

Fixed version (ground truth):
public NetworkConnectionChangeReceiver(Bus bus){
  super(bus);
}
Program: 4039
Project: 4039
Buggy source:
@Override public void run(){
  ConnectivityStatus connectivityStatus=NetworkHelper.getConnectivityStatus(context);
  bus.post(new ConnectivityChanged(connectivityStatus));
  if (connectivityStatus == ConnectivityStatus.WIFI_CONNECTED) {
    new PingTask(context).execute();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (connectivityStatus == ConnectivityStatus.WIFI_CONNECTED) {
    new Ping(context).execute();
  }
}
Program: 4040
Project: 4040
Buggy source:
@Override public void onReceive(final Context context,Intent intent){
  onReceivePatched(context,new Runnable(){
    @Override public void run(){
      ConnectivityStatus connectivityStatus=NetworkHelper.getConnectivityStatus(context);
      bus.post(new ConnectivityChanged(connectivityStatus));
      if (connectivityStatus == ConnectivityStatus.WIFI_CONNECTED) {
        new PingTask(context).execute();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onReceive(final Context context,Intent intent){
  final ConnectivityStatus connectivityStatus=NetworkHelper.getConnectivityStatus(context);
  if (statusNotChanged(connectivityStatus))   return;
  postConnectivityChanged(connectivityStatus,new Runnable(){
    @Override public void run(){
      if (connectivityStatus == ConnectivityStatus.WIFI_CONNECTED) {
        new Ping(context).execute();
      }
    }
  }
);
}
Program: 4041
Project: 4041
Buggy source:
public WifiSignalStrengthChangeReceiver(Bus bus){
  this.bus=bus;
}

Fixed version (ground truth):
public WifiSignalStrengthChangeReceiver(Bus bus){
  super(bus);
}
Program: 4042
Project: 4042
Buggy source:
@Override public void onItemSelected(Object o,Row row){
}

Fixed version (ground truth):
@Override public void onItemSelected(Object item,Row row){
  if (item instanceof Video) {
    try {
      mBackgroundImageUrl=((Video)item).getBackgroundImageUrl();
      startBackgroundTimer();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else   if (item instanceof VideoGroup) {
    try {
      mBackgroundImageUrl=((VideoGroup)item).getVideo().getBackgroundImageUrl();
      startBackgroundTimer();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 4043
Project: 4043
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  Log.i(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  setupFragment();
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  mBlurTransformation=new BlurTransform(getActivity());
  prepareBackgroundManager();
  setupFragment();
}
Program: 4045
Project: 4045
Buggy source:
@Override protected void onPostExecute(List<SmbFile> files){
  try {
    final int cpuCount=Runtime.getRuntime().availableProcessors();
    final int maxPoolSize=cpuCount * 2 + 1;
    final int partitionSize=files.size() / maxPoolSize;
    List<List<SmbFile>> subSets=ListUtils.partition(files,partitionSize);
    mNumOfSets=subSets.size();
    String[] sections=mPassword.split("String_Node_Str");
    String directory=sections[sections.length - 1];
    for (    List<SmbFile> subSet : subSets) {
      new DownloadMovieInfoTask(directory,subSet,this).executeOnExecutor(THREAD_POOL_EXECUTOR);
    }
  }
 catch (  Exception e) {
    if (mOnTaskCompletedListener != null) {
      mOnTaskCompletedListener.onTaskFailed();
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(List<SmbFile> files){
  try {
    final int cpuCount=Runtime.getRuntime().availableProcessors();
    final int maxPoolSize=cpuCount * 2 + 1;
    final int partitionSize=files.size() < maxPoolSize ? files.size() : (files.size() / maxPoolSize);
    List<List<SmbFile>> subSets=ListUtils.partition(files,partitionSize);
    mNumOfSets=subSets.size();
    String[] sections=mPassword.split("String_Node_Str");
    String directory=sections[sections.length - 1];
    for (    List<SmbFile> subSet : subSets) {
      new DownloadMovieInfoTask(directory,subSet,this).executeOnExecutor(THREAD_POOL_EXECUTOR);
    }
  }
 catch (  Exception e) {
    if (mOnTaskCompletedListener != null) {
      mOnTaskCompletedListener.onTaskFailed();
    }
  }
}
Program: 4046
Project: 4046
Buggy source:
/** 
 * Get all logs that in buffer.
 */
public static Records getBufferedLogs(){
  checkIfPureeHasInitialized();
  return logger.getBufferedLogs();
}

Fixed version (ground truth):
/** 
 * Get all logs that in buffer.
 * @return {@link Records}.
 */
public static Records getBufferedLogs(){
  checkIfPureeHasInitialized();
  return logger.getBufferedLogs();
}
Program: 4047
Project: 4047
Buggy source:
/** 
 * Try to send log. This log is sent immediately or put into buffer (it's depending on output plugin).
 */
public static void send(final PureeLog log){
  checkIfPureeHasInitialized();
  logger.send(log);
}

Fixed version (ground truth):
/** 
 * Try to send log. <p> This log is sent immediately or put into buffer (it's depending on output plugin).
 * @param log {@link PureeLog}.
 */
public static void send(final PureeLog log){
  checkIfPureeHasInitialized();
  logger.send(log);
}
Program: 4048
Project: 4048
Buggy source:
/** 
 * Print mapping of SOURCE -> FILTER... OUTPUT.
 */
public void printMapping(){
  LogDumper.out(sourceOutputMap);
}

Fixed version (ground truth):
/** 
 * Print mapping of SOURCE -&gt; FILTER... OUTPUT.
 */
public void printMapping(){
  LogDumper.out(sourceOutputMap);
}
Program: 4049
Project: 4049
Buggy source:
/** 
 * Start building a new   {@link com.cookpad.puree.PureeConfiguration} instance.
 */
public Builder(Context context){
  this.context=context.getApplicationContext();
}

Fixed version (ground truth):
/** 
 * Start building a new   {@link com.cookpad.puree.PureeConfiguration} instance.
 * @param context {@link Context}.
 */
public Builder(Context context){
  this.context=context.getApplicationContext();
}
Program: 4050
Project: 4050
Buggy source:
/** 
 * Specify a source class of logs, which returns   {@link Source} an{@link Source#to(PureeOutput)} must be called to register an output plugin.
 */
public Source source(Class<? extends PureeLog> logClass){
  return new Source(this,logClass);
}

Fixed version (ground truth):
/** 
 * Specify a source class of logs, which returns   {@link Source} an{@link Source#to(PureeOutput)} must be called to register an output plugin.
 * @param logClass log class.
 * @return {@link Source}.
 */
public Source source(Class<? extends PureeLog> logClass){
  return new Source(this,logClass);
}
Program: 4051
Project: 4051
Buggy source:
/** 
 * Create the   {@link com.cookpad.puree.PureeConfiguration} instance.
 */
public PureeConfiguration build(){
  if (gson == null) {
    gson=new Gson();
  }
  if (storage == null) {
    storage=new PureeSQLiteStorage(context);
  }
  if (executor == null) {
    executor=newBackgroundExecutor();
  }
  return new PureeConfiguration(context,gson,sourceOutputMap,storage,executor);
}

Fixed version (ground truth):
/** 
 * Create the   {@link com.cookpad.puree.PureeConfiguration} instance.
 * @return {@link com.cookpad.puree.PureeConfiguration}.
 */
public PureeConfiguration build(){
  if (gson == null) {
    gson=new Gson();
  }
  if (storage == null) {
    storage=new PureeSQLiteStorage(context);
  }
  if (executor == null) {
    executor=newBackgroundExecutor();
  }
  return new PureeConfiguration(context,gson,sourceOutputMap,storage,executor);
}
Program: 4052
Project: 4052
Buggy source:
/** 
 * Specify the   {@link com.google.gson.Gson} to serialize logs.
 */
public Builder gson(Gson gson){
  this.gson=gson;
  return this;
}

Fixed version (ground truth):
/** 
 * Specify the   {@link com.google.gson.Gson} to serialize logs.
 * @param gson {@link Gson}.
 * @return {@link com.cookpad.puree.PureeConfiguration.Builder}.
 */
public Builder gson(Gson gson){
  this.gson=gson;
  return this;
}
Program: 4053
Project: 4053
Buggy source:
/** 
 * Serialize a   {@link PureeLog} into {@link JsonObject} with {@link Gson}
 */
@Nonnull public JsonObject serializeLog(PureeLog log){
  return (JsonObject)gson.toJsonTree(log);
}

Fixed version (ground truth):
/** 
 * Serialize a   {@link PureeLog} into {@link JsonObject} with {@link Gson}.
 * @param log {@link PureeLog}.
 * @return serialized json object.
 */
@Nonnull public JsonObject serializeLog(PureeLog log){
  return (JsonObject)gson.toJsonTree(log);
}
Program: 4054
Project: 4054
Buggy source:
/** 
 * Specify the   {@link com.cookpad.puree.PureeFilter}. 
 */
public Source filter(PureeFilter filter){
  filters.add(filter);
  return this;
}

Fixed version (ground truth):
/** 
 * Specify the   {@link com.cookpad.puree.PureeFilter}.
 * @param filter {@link PureeFilter}.
 * @return {@link Source}.
 */
public Source filter(PureeFilter filter){
  filters.add(filter);
  return this;
}
Program: 4055
Project: 4055
Buggy source:
/** 
 * Specify the   {@link com.cookpad.puree.PureeFilter}. 
 */
public Source filters(PureeFilter... filters){
  this.filters.addAll(Arrays.asList(filters));
  return this;
}

Fixed version (ground truth):
/** 
 * Specify the   {@link com.cookpad.puree.PureeFilter}.
 * @param filters {@link PureeFilter} list.
 * @return {@link Source}.
 */
public Source filters(PureeFilter... filters){
  this.filters.addAll(Arrays.asList(filters));
  return this;
}
Program: 4056
Project: 4056
Buggy source:
/** 
 * Specify the   {@link com.cookpad.puree.outputs.PureeOutput} that is responded to source. 
 */
public PureeConfiguration.Builder to(PureeOutput output){
  builder.register(logClass,output.withFilters(filters));
  return builder;
}

Fixed version (ground truth):
/** 
 * Specify the   {@link com.cookpad.puree.outputs.PureeOutput} that is responded to source.
 * @param output {@link com.cookpad.puree.outputs.PureeOutput}.
 * @return {@link com.cookpad.puree.PureeConfiguration.Builder}.
 */
public PureeConfiguration.Builder to(PureeOutput output){
  builder.register(logClass,output.withFilters(filters));
  return builder;
}
Program: 4057
Project: 4057
Buggy source:
@Test public void testPureeBufferedOutput() throws Exception {
  logger.send(new PvLog("String_Node_Str"));
  logger.send(new PvLog("String_Node_Str"));
  logger.send(new PvLog("String_Node_Str"));
  logger.flush();
  Thread.sleep(1000);
  assertThat(logs.size(),is(3));
  assertThat(logs.get(0),is("String_Node_Str"));
  assertThat(logs.get(1),is("String_Node_Str"));
  assertThat(logs.get(2),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testPureeBufferedOutput() throws Exception {
  logger=new PureeConfiguration.Builder(context).register(PvLog.class,new BufferedOutput(handler)).build().createPureeLogger();
  logger.discardBufferedLogs();
  logger.send(new PvLog("String_Node_Str"));
  logger.send(new PvLog("String_Node_Str"));
  logger.send(new PvLog("String_Node_Str"));
  logger.flush();
  Thread.sleep(1000);
  assertThat(logs.size(),is(3));
  assertThat(logs.get(0),is("String_Node_Str"));
  assertThat(logs.get(1),is("String_Node_Str"));
  assertThat(logs.get(2),is("String_Node_Str"));
}
Program: 4058
Project: 4058
Buggy source:
@Before public void setUp() throws Exception {
  Context context=InstrumentationRegistry.getTargetContext();
  Handler handler=new Handler(Looper.getMainLooper());
  output=new BufferedOutput(handler);
  logger=new PureeConfiguration.Builder(context).register(PvLog.class,output).build().createPureeLogger();
  logger.discardBufferedLogs();
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  context=InstrumentationRegistry.getTargetContext();
  handler=new Handler(Looper.getMainLooper());
}
Program: 4059
Project: 4059
Buggy source:
@Override public void emit(JsonArray jsonArray,AsyncResult result){
  for (  JsonElement item : jsonArray) {
    logs.add(item.toString());
  }
  result.success();
}

Fixed version (ground truth):
@Override public void emit(JsonArray jsonArray,AsyncResult result){
  throw new AssertionFailedError("String_Node_Str");
}
Program: 4060
Project: 4060
Buggy source:
@After public void tearDown() throws Exception {
  logger.discardBufferedLogs();
}

Fixed version (ground truth):
@After public void tearDown() throws Exception {
  if (logger != null) {
    logger.discardBufferedLogs();
  }
}
Program: 4061
Project: 4061
Buggy source:
@Override public void receive(final JsonObject jsonLog){
  new AsyncRunnableTask(){
    @Override public void run(){
      JsonObject filteredLog=applyFilters(jsonLog);
      storage.insert(type(),filteredLog);
    }
  }
.execute();
  flushTask.tryToStart();
}

Fixed version (ground truth):
@Override public void receive(final JsonObject jsonLog){
  new AsyncRunnableTask(){
    @Override public void run(){
      JsonObject filteredLog=applyFilters(jsonLog);
      if (filteredLog != null) {
        storage.insert(type(),filteredLog);
      }
    }
  }
.execute();
  flushTask.tryToStart();
}
Program: 4062
Project: 4062
Buggy source:
protected JsonObject applyFilters(JsonObject jsonLog){
  JsonObject filteredLog=jsonLog;
  for (  PureeFilter filter : filters) {
    filteredLog=filter.apply(filteredLog);
    if (filteredLog == null) {
      return null;
    }
  }
  return filteredLog;
}

Fixed version (ground truth):
@Nullable protected JsonObject applyFilters(JsonObject jsonLog){
  JsonObject filteredLog=jsonLog;
  for (  PureeFilter filter : filters) {
    filteredLog=filter.apply(filteredLog);
    if (filteredLog == null) {
      return null;
    }
  }
  return filteredLog;
}
Program: 4063
Project: 4063
Buggy source:
protected JSONObject applyFilters(JSONObject jsonLog) throws JSONException {
  if (filters == null || filters.isEmpty()) {
    return jsonLog;
  }
  JSONObject filteredLog=new JSONObject();
  for (  PureeFilter filter : filters) {
    filteredLog=filter.apply(jsonLog);
  }
  return filteredLog;
}

Fixed version (ground truth):
protected JSONObject applyFilters(JSONObject jsonLog) throws JSONException {
  JSONObject filteredLog=jsonLog;
  for (  PureeFilter filter : filters) {
    filteredLog=filter.apply(filteredLog);
    if (filteredLog == null) {
      return null;
    }
  }
  return filteredLog;
}
Program: 4064
Project: 4064
Buggy source:
public static synchronized void initialize(PureeConfiguration conf){
  if (isInitialized) {
    Log.w(TAG,"String_Node_Str");
  }
  gson=conf.getGson();
  storage=new PureeDbHelper(conf.getApplicationContext());
  for (  PureeOutput output : conf.getOutputs()) {
    output.initialize(storage);
    outputMap.put(output.type(),output);
  }
  isInitialized=true;
}

Fixed version (ground truth):
public static synchronized void initialize(PureeConfiguration conf){
  if (isInitialized) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  gson=conf.getGson();
  storage=new PureeDbHelper(conf.getApplicationContext());
  for (  PureeOutput output : conf.getOutputs()) {
    output.initialize(storage);
    outputMap.put(output.type(),output);
  }
  isInitialized=true;
}
Program: 4065
Project: 4065
Buggy source:
public static synchronized void initialize(LogHouseConfiguration conf){
  if (isInitialized) {
    Log.w(TAG,"String_Node_Str");
  }
  gson=conf.getGson();
  storage=new LogHouseDbHelper(conf.getApplicationContext());
  for (  LogHouseOutput output : conf.getOutputs()) {
    output.initialize(conf,storage);
    output.initialize(conf,storage);
    outputs.add(output);
  }
  isInitialized=true;
}

Fixed version (ground truth):
public static synchronized void initialize(LogHouseConfiguration conf){
  if (isInitialized) {
    Log.w(TAG,"String_Node_Str");
  }
  gson=conf.getGson();
  storage=new LogHouseDbHelper(conf.getApplicationContext());
  for (  LogHouseOutput output : conf.getOutputs()) {
    output.initialize(conf,storage);
    outputs.add(output);
  }
  isInitialized=true;
}
Program: 4066
Project: 4066
Buggy source:
public void flushSync(){
  Records records=getRecordsFromStorage();
  if (records.isEmpty()) {
    return;
  }
  while (!records.isEmpty()) {
    final List<JSONObject> serializedLogs=records.getSerializedLogs();
    if (!isTest) {
      boolean isSuccess=flushChunkOfLogs(serializedLogs);
      if (isSuccess) {
        lazyTaskRunner.reset();
      }
 else {
        lazyTaskRunner.retryLater();
        return;
      }
    }
    afterFlushFilter.call(type(),serializedLogs);
    storage.delete(records);
    records=getRecordsFromStorage();
  }
}

Fixed version (ground truth):
public void flushSync(){
  Records records=getRecordsFromStorage();
  if (records.isEmpty()) {
    return;
  }
  while (!records.isEmpty()) {
    final List<JSONObject> serializedLogs=records.getSerializedLogs();
    if (!LogHouseConfiguration.isTest) {
      boolean isSuccess=flushChunkOfLogs(serializedLogs);
      if (isSuccess) {
        lazyTaskRunner.reset();
      }
 else {
        lazyTaskRunner.retryLater();
        return;
      }
    }
    afterFlushFilter.call(type(),serializedLogs);
    storage.delete(records);
    records=getRecordsFromStorage();
  }
}
Program: 4067
Project: 4067
Buggy source:
@Override public void start(JSONObject serializedLog){
  if (isTest) {
    insertSync(type(),serializedLog);
    flushSync();
  }
 else {
    new AsyncInsertTask(this,type(),serializedLog).execute();
    lazyTaskRunner.tryToStart();
  }
}

Fixed version (ground truth):
@Override public void start(JSONObject serializedLog){
  if (LogHouseConfiguration.isTest) {
    insertSync(type(),serializedLog);
    flushSync();
  }
 else {
    new AsyncInsertTask(this,type(),serializedLog).execute();
    lazyTaskRunner.tryToStart();
  }
}