nus-yam/ex-repair huggingface dataset:
Program: 105004
Project: 105004
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean accept(RawPacket pkt){
  if (pkt == null) {
    return false;
  }
  SimulcastStream next=getNext();
  if (next != null && next.matches(pkt) && next.isKeyFrame(pkt)) {
    weakCurrent=new WeakReference<>(next);
    weakNext=null;
    return true;
  }
  SimulcastStream current=getCurrent();
  return current != null && current.matches(pkt);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean accept(RawPacket pkt){
  if (pkt == null) {
    return false;
  }
  State oldState=this.state;
  SimulcastStream next=oldState.weakNext != null ? oldState.weakNext.get() : null;
  if (next != null && next.matches(pkt) && next.isKeyFrame(pkt)) {
    this.state=new State(new WeakReference<>(next),null);
    return true;
  }
  SimulcastStream current=oldState.weakCurrent != null ? oldState.weakCurrent.get() : null;
  return current != null && current.matches(pkt);
}
Program: 105005
Project: 105005
Buggy source:
/** 
 * Configures this mode to receive the low quality stream.
 * @param urgent if urgent is true, switch immediately and don't wait for akeyframe of the low quality stream.
 */
public abstract void receive(SimulcastStream simStream,boolean urgent);

Fixed version (ground truth):
/** 
 * Configures this mode to receive the low quality stream.
 */
public abstract void receive(SimulcastStream simStream);
Program: 105006
Project: 105006
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void receive(SimulcastStream simStream,boolean urgent){
  SwitchingModeOptions options=new SwitchingModeOptions();
  options.setNextOrder(simStream.getOrder());
  options.setHardSwitch(true);
  options.setUrgent(urgent);
  configure(options);
synchronized (sendStreamsSyncRoot) {
    SimulcastStream next=getNext();
    if (next != null && !next.isStreaming()) {
      this.weakNext=null;
      this.seenNext=0;
      nextSimulcastStreamStopped(next);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void receive(SimulcastStream simStream){
  SwitchingModeOptions options=new SwitchingModeOptions();
  options.setNextOrder(simStream.getOrder());
  options.setHardSwitch(true);
  configure(options);
synchronized (sendStreamsSyncRoot) {
    SimulcastStream next=getNext();
    if (next != null && !next.isStreaming()) {
      this.weakNext=null;
      this.seenNext=0;
      nextSimulcastStreamStopped(next);
    }
  }
}
Program: 105008
Project: 105008
Buggy source:
/** 
 * Initializes the constants used by this class from the configuration.
 */
private static void initializeConfiguration(ConfigurationService cfg){
  if (configurationInitialized)   return;
synchronized (AdaptiveSimulcastBitrateController.class) {
    if (cfg != null) {
      PROCESS_INTERVAL_MS=cfg.getInt(PROCESS_INTERVAL_MS_PNAME,PROCESS_INTERVAL_MS);
      CLIMB_INTERVAL_MS=cfg.getInt(CLIMB_INTERVAL_MS_PNAME,CLIMB_INTERVAL_MS);
      CLIMB_MIN_RATIO=cfg.getDouble(CLIMB_MIN_RATIO_PNAME,CLIMB_MIN_RATIO);
      OVERSENDING_COEF=cfg.getDouble(OVERSENDING_COEF_PNAME,OVERSENDING_COEF);
      OVERSENDING_INTERVAL_MS=cfg.getInt(OVERSENDING_INTERVAL_MS_PNAME,OVERSENDING_INTERVAL_MS);
      INITIAL_PERIOD_MS=cfg.getInt(INITIAL_PERIOD_MS_PNAME,INITIAL_PERIOD_MS);
      ENABLE_TRIGGER=cfg.getBoolean(ENABLE_TRIGGER_PNAME,ENABLE_TRIGGER);
    }
    recurringProcessibleExecutor=new RecurringProcessibleExecutor();
    configurationInitialized=true;
  }
}

Fixed version (ground truth):
/** 
 * Initializes the constants used by this class from the configuration.
 */
private static void initializeConfiguration(ConfigurationService cfg){
synchronized (AdaptiveSimulcastBitrateController.class) {
    if (configurationInitialized)     return;
    configurationInitialized=true;
    if (cfg != null) {
      PROCESS_INTERVAL_MS=cfg.getInt(PROCESS_INTERVAL_MS_PNAME,PROCESS_INTERVAL_MS);
      CLIMB_INTERVAL_MS=cfg.getInt(CLIMB_INTERVAL_MS_PNAME,CLIMB_INTERVAL_MS);
      CLIMB_MIN_RATIO=cfg.getDouble(CLIMB_MIN_RATIO_PNAME,CLIMB_MIN_RATIO);
      OVERSENDING_COEF=cfg.getDouble(OVERSENDING_COEF_PNAME,OVERSENDING_COEF);
      OVERSENDING_INTERVAL_MS=cfg.getInt(OVERSENDING_INTERVAL_MS_PNAME,OVERSENDING_INTERVAL_MS);
      INITIAL_PERIOD_MS=cfg.getInt(INITIAL_PERIOD_MS_PNAME,INITIAL_PERIOD_MS);
      ENABLE_TRIGGER=cfg.getBoolean(ENABLE_TRIGGER_PNAME,ENABLE_TRIGGER);
    }
    recurringProcessibleExecutor=new RecurringProcessibleExecutor();
  }
}
Program: 105009
Project: 105009
Buggy source:
/** 
 * Notifies this   {@code Endpoint} that a {@code PinnedEndpointChangedEvent}has been received by the associated   {@code SctpConnection}.
 * @param src the {@code WebRtcDataStream} by which {@code jsonObject} hasbeen received
 * @param jsonObject the JSON object with {@link Videobridge#COLIBRI_CLASS}{@code PinnedEndpointChangedEvent} which has been received by theassociated  {@code SctpConnection}
 */
private void onPinnedEndpointChangedEvent(WebRtcDataStream src,JSONObject jsonObject){
  String newPinnedEndpointID=(String)jsonObject.get("String_Node_Str");
  if (logger.isDebugEnabled()) {
    StringCompiler sc=new StringCompiler();
    sc.bind("String_Node_Str",newPinnedEndpointID);
    sc.bind("String_Node_Str",this);
    logger.debug(sc.c("String_Node_Str" + "String_Node_Str"));
  }
  List<String> newPinnedIDList=Collections.EMPTY_LIST;
  if (newPinnedEndpointID == null || "String_Node_Str".equals(newPinnedEndpointID)) {
    newPinnedIDList=Collections.singletonList(newPinnedEndpointID);
  }
  pinnedEndpointsChanged(newPinnedIDList);
}

Fixed version (ground truth):
/** 
 * Notifies this   {@code Endpoint} that a {@code PinnedEndpointChangedEvent}has been received by the associated   {@code SctpConnection}.
 * @param src the {@code WebRtcDataStream} by which {@code jsonObject} hasbeen received
 * @param jsonObject the JSON object with {@link Videobridge#COLIBRI_CLASS}{@code PinnedEndpointChangedEvent} which has been received by theassociated  {@code SctpConnection}
 */
private void onPinnedEndpointChangedEvent(WebRtcDataStream src,JSONObject jsonObject){
  String newPinnedEndpointID=(String)jsonObject.get("String_Node_Str");
  if (logger.isDebugEnabled()) {
    StringCompiler sc=new StringCompiler();
    sc.bind("String_Node_Str",newPinnedEndpointID);
    sc.bind("String_Node_Str",this);
    logger.debug(sc.c("String_Node_Str" + "String_Node_Str"));
  }
  List<String> newPinnedIDList=Collections.EMPTY_LIST;
  if (newPinnedEndpointID != null && !"String_Node_Str".equals(newPinnedEndpointID)) {
    newPinnedIDList=Collections.singletonList(newPinnedEndpointID);
  }
  pinnedEndpointsChanged(newPinnedIDList);
}
Program: 105010
Project: 105010
Buggy source:
/** 
 * Adds a received value to this list.
 * @param time the time of reception.
 * @param rate the value.
 */
private void add(long time,long rate){
  sum+=rate;
  receivedRembs.put(time,rate);
  clean(time);
}

Fixed version (ground truth):
/** 
 * Adds a received value to this list.
 * @param time the time of reception.
 * @param rate the value.
 */
private void add(long time,long rate){
  sum+=rate;
  receivedRembs.put(time,rate);
  last=rate;
  clean(time);
}
Program: 105011
Project: 105011
Buggy source:
int calcNumEndpointsThatFitIn(){
  final long now=System.currentTimeMillis();
  final long availableBandwidth=(long)(receivedRembs.getAverage(now) * REMB_MULT_CONSTANT);
  long remainingBandwidth=availableBandwidth;
  int numEndpointsThatFitIn=0;
  final Iterator<Endpoint> it=null;
  final Endpoint thisEndpoint=channel.getEndpoint();
  while (it.hasNext()) {
    Endpoint endpoint=it.next();
    if (endpoint != null && !endpoint.equals(thisEndpoint)) {
      long endpointBitrate=getEndpointBitrate(endpoint);
      if (remainingBandwidth >= endpointBitrate) {
        numEndpointsThatFitIn+=1;
        remainingBandwidth-=endpointBitrate;
      }
 else {
        break;
      }
    }
  }
  return numEndpointsThatFitIn;
}

Fixed version (ground truth):
int calcNumEndpointsThatFitIn(){
  final long availableBandwidth=receivedRembs.getLast();
  long remainingBandwidth=availableBandwidth;
  int numEndpointsThatFitIn=0;
  Conference conference=channel.getContent().getConference();
  for (  String endpointId : lastNController.getForwardedEndpoints()) {
    Endpoint endpoint=conference.getEndpoint(endpointId);
    if (endpoint != null) {
      long endpointBitrate=getEndpointBitrate(endpoint);
      if (remainingBandwidth >= endpointBitrate) {
        numEndpointsThatFitIn+=1;
        remainingBandwidth-=endpointBitrate;
      }
 else {
        break;
      }
    }
  }
  return numEndpointsThatFitIn;
}
Program: 105012
Project: 105012
Buggy source:
/** 
 * Initializes a new <tt>BitrateController</tt> instance.
 * @param channel the <tt>VideoChannel</tt> for which the new instance is toserve.
 */
public BitrateController(LastNController lastNController,VideoChannel channel){
  this.channel=channel;
  this.lastNController=lastNController;
  initializeConfiguration();
  BandwidthEstimator be=((VideoMediaStream)channel.getStream()).getOrCreateBandwidthEstimator();
  be.addListener(this);
}

Fixed version (ground truth):
/** 
 * Initializes a new <tt>BitrateController</tt> instance.
 * @param channel the <tt>VideoChannel</tt> for which the new instance is toserve.
 */
public BitrateController(LastNController lastNController,VideoChannel channel){
  this.channel=channel;
  this.lastNController=lastNController;
  initializeConfiguration(ServiceUtils.getService(channel.getBundleContext(),ConfigurationService.class));
  BandwidthEstimator be=((VideoMediaStream)channel.getStream()).getOrCreateBandwidthEstimator();
  be.addListener(this);
}
Program: 105013
Project: 105013
Buggy source:
/** 
 * Notifies this instance that an RTCP REMB packet with a bitrate value of <tt>remb</tt> was received on its associated <tt>VideoChannel</tt>.
 * @param remb the bitrate of the REMB packet received.
 */
@Override public void bandwidthEstimationChanged(long remb){
  logger.warn("String_Node_Str" + remb);
  BitrateAdaptor bitrateAdaptor=getOrCreateBitrateAdaptor();
  if (bitrateAdaptor == null) {
    return;
  }
  logger.warn(hashCode() + "String_Node_Str" + remb);
  long now=System.currentTimeMillis();
  int receivingEndpointCount=0;
  if (firstRemb == -1)   firstRemb=now;
  receivedRembs.add(now,remb);
  if (now - firstRemb <= INITIAL_INTERVAL_MS)   return;
  if (!bitrateAdaptor.touch())   return;
  int numEndpointsThatFitIn=calcNumEndpointsThatFitIn();
  if (numEndpointsThatFitIn < receivingEndpointCount) {
    lastNonIncrease=now;
    if (now - lastNonDecrease >= DECREASE_LAG_MS) {
      lastNonDecrease=now;
      bitrateAdaptor.decrease();
    }
  }
 else   if (numEndpointsThatFitIn == receivingEndpointCount) {
    lastNonDecrease=now;
  }
 else   if (numEndpointsThatFitIn > receivingEndpointCount) {
    lastNonDecrease=now;
    if (now - lastNonIncrease >= INCREASE_LAG_MS) {
      lastNonIncrease=now;
      bitrateAdaptor.increase();
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies this instance that an RTCP REMB packet with a bitrate value of <tt>remb</tt> was received on its associated <tt>VideoChannel</tt>.
 * @param remb the bitrate of the REMB packet received.
 */
@Override public void bandwidthEstimationChanged(long remb){
  BitrateAdaptor bitrateAdaptor=getOrCreateBitrateAdaptor();
  if (bitrateAdaptor == null) {
    return;
  }
  long now=System.currentTimeMillis();
  int receivingEndpointCount=lastNController.getForwardedEndpoints().size();
  if (firstRemb == -1)   firstRemb=now;
  receivedRembs.add(now,remb);
  if (now - firstRemb <= INITIAL_INTERVAL_MS)   return;
  if (!bitrateAdaptor.touch())   return;
  int numEndpointsThatFitIn=calcNumEndpointsThatFitIn();
  if (numEndpointsThatFitIn < receivingEndpointCount) {
    lastNonIncrease=now;
    if (now - lastNonDecrease >= DECREASE_LAG_MS) {
      lastNonDecrease=now;
      bitrateAdaptor.decrease();
    }
  }
 else   if (numEndpointsThatFitIn == receivingEndpointCount) {
    lastNonDecrease=now;
  }
 else   if (numEndpointsThatFitIn > receivingEndpointCount) {
    lastNonDecrease=now;
    if (now - lastNonIncrease >= INCREASE_LAG_MS) {
      lastNonIncrease=now;
      bitrateAdaptor.increase();
    }
  }
}
Program: 105014
Project: 105014
Buggy source:
/** 
 * Initializes the constants used by this class from the configuration.
 */
private void initializeConfiguration(){
synchronized (BitrateController.class) {
    if (configurationInitialized)     return;
    configurationInitialized=true;
    ConfigurationService cfg=ServiceUtils.getService(channel.getBundleContext(),ConfigurationService.class);
    if (cfg != null) {
      INCREASE_LAG_MS=cfg.getInt(INCREASE_LAG_MS_PNAME,INCREASE_LAG_MS);
      INCREASE_LAG_MS=cfg.getInt(DECREASE_LAG_MS_PNAME,DECREASE_LAG_MS);
      INITIAL_INTERVAL_MS=cfg.getInt(INITIAL_INTERVAL_MS_PNAME,INITIAL_INTERVAL_MS);
      String rembMultConstantStr=cfg.getString(REMB_MULT_CONSTANT_PNAME,null);
      if (rembMultConstantStr != null) {
        try {
          REMB_MULT_CONSTANT=Double.parseDouble(rembMultConstantStr);
        }
 catch (        Exception e) {
        }
      }
      REMB_AVERAGE_INTERVAL_MS=cfg.getInt(REMB_AVERAGE_INTERVAL_MS_PNAME,REMB_AVERAGE_INTERVAL_MS);
      MIN_ASSUMED_ENDPOINT_BITRATE_BPS=cfg.getInt(MIN_ASSUMED_ENDPOINT_BITRATE_BPS_PNAME,MIN_ASSUMED_ENDPOINT_BITRATE_BPS);
    }
  }
}

Fixed version (ground truth):
/** 
 * Initializes the constants used by this class from the configuration.
 */
private static void initializeConfiguration(ConfigurationService cfg){
synchronized (BitrateController.class) {
    if (configurationInitialized)     return;
    configurationInitialized=true;
    if (cfg != null) {
      INCREASE_LAG_MS=cfg.getInt(INCREASE_LAG_MS_PNAME,INCREASE_LAG_MS);
      INCREASE_LAG_MS=cfg.getInt(DECREASE_LAG_MS_PNAME,DECREASE_LAG_MS);
      INITIAL_INTERVAL_MS=cfg.getInt(INITIAL_INTERVAL_MS_PNAME,INITIAL_INTERVAL_MS);
      String rembMultConstantStr=cfg.getString(REMB_MULT_CONSTANT_PNAME,null);
      if (rembMultConstantStr != null) {
        try {
          REMB_MULT_CONSTANT=Double.parseDouble(rembMultConstantStr);
        }
 catch (        Exception e) {
        }
      }
      REMB_AVERAGE_INTERVAL_MS=cfg.getInt(REMB_AVERAGE_INTERVAL_MS_PNAME,REMB_AVERAGE_INTERVAL_MS);
      MIN_ASSUMED_ENDPOINT_BITRATE_BPS=cfg.getInt(MIN_ASSUMED_ENDPOINT_BITRATE_BPS_PNAME,MIN_ASSUMED_ENDPOINT_BITRATE_BPS);
    }
  }
}
Program: 105015
Project: 105015
Buggy source:
/** 
 * Returns the incoming bitrate in bits per second from all <tt>VideoChannel</tt>s of the endpoint <tt>endpoint</tt> or  {@link #MIN_ASSUMED_ENDPOINT_BITRATE_BPS} if the actual bitrate is thatlimit.
 * @param endpoint the endpoint.
 * @return the incoming bitrate in bits per second from <tt>endpoint</tt>,or  {@link #MIN_ASSUMED_ENDPOINT_BITRATE_BPS} if the actual bitrate isbelow that limit.
 */
private long getEndpointBitrate(Endpoint endpoint){
  SimulcastEngine mySM=this.channel.getTransformEngine().getSimulcastEngine();
  long bitrate=0;
  for (  RtpChannel channel : endpoint.getChannels(MediaType.VIDEO)) {
    if (channel != null && channel instanceof VideoChannel) {
      VideoChannel vc=(VideoChannel)channel;
      SimulcastEngine simulcastEngine=vc.getTransformEngine().getSimulcastEngine();
      if (mySM != null && simulcastEngine != null && simulcastEngine.getSimulcastReceiver().isSimulcastSignaled()) {
      }
 else {
        bitrate+=((VideoChannel)channel).getIncomingBitrate();
      }
    }
  }
  return Math.max(bitrate,MIN_ASSUMED_ENDPOINT_BITRATE_BPS);
}

Fixed version (ground truth):
/** 
 * Returns the incoming bitrate in bits per second from all <tt>VideoChannel</tt>s of the endpoint <tt>endpoint</tt> or  {@link #MIN_ASSUMED_ENDPOINT_BITRATE_BPS} if the actual bitrate is belowthat limit.
 * @param endpoint the endpoint.
 * @return the incoming bitrate in bits per second from <tt>endpoint</tt>,or  {@link #MIN_ASSUMED_ENDPOINT_BITRATE_BPS} if the actual bitrate isbelow that limit.
 */
private long getEndpointBitrate(Endpoint endpoint){
  SimulcastEngine mySM=this.channel.getTransformEngine().getSimulcastEngine();
  long bitrate=0;
  for (  RtpChannel channel : endpoint.getChannels(MediaType.VIDEO)) {
    if (channel != null && channel instanceof VideoChannel) {
      VideoChannel vc=(VideoChannel)channel;
      SimulcastEngine simulcastEngine=vc.getTransformEngine().getSimulcastEngine();
      if (mySM != null && simulcastEngine != null && simulcastEngine.getSimulcastReceiver().isSimulcastSignaled()) {
      }
 else {
        bitrate+=((VideoChannel)channel).getIncomingBitrate();
      }
    }
  }
  return Math.max(bitrate,MIN_ASSUMED_ENDPOINT_BITRATE_BPS);
}
Program: 105016
Project: 105016
Buggy source:
/** 
 * Sets the initial value of lastN.
 * @param lastN The current value of lastN.
 * @return the new value of lastN.
 */
private int setInitialLastN(int lastN){
  VideoChannel channel=bitrateController.getChannel();
  Endpoint thisEndpoint=channel.getEndpoint();
  int endpointCount=0;
  if (lastN < 0 || lastN > endpointCount) {
    lastN=endpointCount;
    channel.setLastN(endpointCount);
  }
  return lastN;
}

Fixed version (ground truth):
/** 
 * Sets the initial value of lastN.
 * @param lastN The current value of lastN.
 * @return the new value of lastN.
 */
private int setInitialLastN(int lastN){
  VideoChannel channel=bitrateController.getChannel();
  int endpointCount=bitrateController.getLastNController().getForwardedEndpoints().size();
  if (lastN < 0 || lastN > endpointCount) {
    lastN=endpointCount;
    channel.setLastN(endpointCount);
  }
  return lastN;
}
Program: 105018
Project: 105018
Buggy source:
/** 
 * Removes a specific RTP SSRC from the list of SSRCs received on this <tt>Channel</tt>.
 * @param receiveSSRC the RTP SSRC to be removed from the list of SSRCsreceived on this <tt>Channel</tt>
 * @return <tt>true</tt> if <tt>receiveSSRC</tt> was found in the list ofSSRCs received on this <tt>Channel</tt>; otherwise, <tt>false</tt>
 */
private synchronized boolean removeReceiveSSRC(int receiveSSRC){
  final int length=receiveSSRCs.length;
  boolean removed=false;
  if (length == 2) {
    if (((int)receiveSSRCs[0]) == receiveSSRC) {
      receiveSSRCs=NO_RECEIVE_SSRCS;
      removed=true;
    }
  }
 else {
    for (int i=0; i < length; i+=2) {
      if (((int)receiveSSRCs[i]) == receiveSSRC) {
        long[] newReceiveSSRCs=new long[length - 2];
        if (i != 0) {
          System.arraycopy(receiveSSRCs,0,newReceiveSSRCs,0,i);
        }
        if (i != newReceiveSSRCs.length) {
          System.arraycopy(receiveSSRCs,i + 2,newReceiveSSRCs,i,newReceiveSSRCs.length - i);
        }
        removed=true;
        break;
      }
    }
  }
  return removed;
}

Fixed version (ground truth):
/** 
 * Removes a specific RTP SSRC from the list of SSRCs received on this <tt>Channel</tt>.
 * @param receiveSSRC the RTP SSRC to be removed from the list of SSRCsreceived on this <tt>Channel</tt>
 * @return <tt>true</tt> if <tt>receiveSSRC</tt> was found in the list ofSSRCs received on this <tt>Channel</tt>; otherwise, <tt>false</tt>
 */
private synchronized boolean removeReceiveSSRC(int receiveSSRC){
  final int length=receiveSSRCs.length;
  boolean removed=false;
  if (length == 2) {
    if (((int)receiveSSRCs[0]) == receiveSSRC) {
      receiveSSRCs=NO_RECEIVE_SSRCS;
      removed=true;
    }
  }
 else {
    for (int i=0; i < length; i+=2) {
      if (((int)receiveSSRCs[i]) == receiveSSRC) {
        long[] newReceiveSSRCs=new long[length - 2];
        if (i != 0) {
          System.arraycopy(receiveSSRCs,0,newReceiveSSRCs,0,i);
        }
        if (i != newReceiveSSRCs.length) {
          System.arraycopy(receiveSSRCs,i + 2,newReceiveSSRCs,i,newReceiveSSRCs.length - i);
        }
        receiveSSRCs=newReceiveSSRCs;
        removed=true;
        break;
      }
    }
  }
  return removed;
}
Program: 105019
Project: 105019
Buggy source:
@Override public void run(){
  while (!closed) {
synchronized (caches) {
      long now=System.currentTimeMillis();
      Iterator<Map.Entry<Long,Cache>> iter=caches.entrySet().iterator();
      while (iter.hasNext()) {
        Map.Entry<Long,Cache> entry=iter.next();
        Cache cache=entry.getValue();
        if (cache.lastInsertTime + SSRC_TIMEOUT_MILLIS < now) {
          logger.debug("String_Node_Str" + entry.getKey());
          cache.empty();
          iter.remove();
        }
      }
    }
    try {
      wait(10000);
    }
 catch (    InterruptedException ie) {
      Thread.currentThread().interrupt();
    }
  }
  logger.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public void run(){
  while (!closed) {
synchronized (caches) {
      long now=System.currentTimeMillis();
      Iterator<Map.Entry<Long,Cache>> iter=caches.entrySet().iterator();
      while (iter.hasNext()) {
        Map.Entry<Long,Cache> entry=iter.next();
        Cache cache=entry.getValue();
        if (cache.lastInsertTime + SSRC_TIMEOUT_MILLIS < now) {
          logger.debug("String_Node_Str" + entry.getKey());
          cache.empty();
          iter.remove();
        }
      }
    }
    try {
synchronized (this) {
        wait(10000);
      }
    }
 catch (    InterruptedException ie) {
      Thread.currentThread().interrupt();
    }
  }
  logger.debug("String_Node_Str");
}
Program: 105020
Project: 105020
Buggy source:
/** 
 * Returns the RTP packet with sequence number <tt>seq</tt> from the cache, or <tt>null</tt> if the cache does not contain a packet with this sequence number.
 * @param seq the RTP sequence number of the packet to get.
 * @return the RTP packet with sequence number <tt>seq</tt> from thecache, or <tt>null</tt> if the cache does not contain a packet with this sequence number.
 */
private synchronized RawPacket get(int seq){
  RawPacket pkt=cache.get(seq + ROC * (1 << 16));
  if (pkt == null && ROC > 0)   pkt=cache.get(seq + (ROC - 1) * (1 << 16));
  return new RawPacket(pkt.getBuffer().clone(),pkt.getOffset(),pkt.getLength());
}

Fixed version (ground truth):
/** 
 * Returns the RTP packet with sequence number <tt>seq</tt> from the cache, or <tt>null</tt> if the cache does not contain a packet with this sequence number.
 * @param seq the RTP sequence number of the packet to get.
 * @return the RTP packet with sequence number <tt>seq</tt> from thecache, or <tt>null</tt> if the cache does not contain a packet with this sequence number.
 */
private synchronized RawPacket get(int seq){
  RawPacket pkt=cache.get(seq + ROC * (1 << 16));
  if (pkt == null && ROC > 0)   pkt=cache.get(seq + (ROC - 1) * (1 << 16));
  return pkt == null ? null : new RawPacket(pkt.getBuffer().clone(),pkt.getOffset(),pkt.getLength());
}
Program: 105021
Project: 105021
Buggy source:
/** 
 * Initializes the transformers used by this instance and returns them as an array.
 */
private TransformEngine[] createChain(){
  List<TransformEngine> transformerList=new LinkedList<TransformEngine>();
  redFilter=new REDFilterTransformEngine(RED_PAYLOAD_TYPE);
  transformerList.add(redFilter);
  absSendTime=new AbsSendTimeEngine();
  transformerList.add(absSendTime);
  boolean enableNackTermination=true;
  Conference conference=channel.getContent().getConference();
  if (conference != null) {
    ConfigurationService cfg=conference.getVideobridge().getConfigurationService();
    if (cfg != null)     enableNackTermination=cfg.getBoolean(DISABLE_NACK_TERMINATION_PNAME,false);
  }
  if (enableNackTermination && channel instanceof NACKHandler) {
    cache=new CachingTransformer();
    transformerList.add(cache);
    nackNotifier=new NACKNotifier((NACKHandler)channel);
    rtcpTransformEngine=new RTCPTransformEngine(new Transformer[]{nackNotifier});
    transformerList.add(rtcpTransformEngine);
  }
  return transformerList.toArray(new TransformEngine[transformerList.size()]);
}

Fixed version (ground truth):
/** 
 * Initializes the transformers used by this instance and returns them as an array.
 */
private TransformEngine[] createChain(){
  List<TransformEngine> transformerList=new LinkedList<TransformEngine>();
  redFilter=new REDFilterTransformEngine(RED_PAYLOAD_TYPE);
  transformerList.add(redFilter);
  absSendTime=new AbsSendTimeEngine();
  transformerList.add(absSendTime);
  boolean enableNackTermination=true;
  Conference conference=channel.getContent().getConference();
  if (conference != null) {
    ConfigurationService cfg=conference.getVideobridge().getConfigurationService();
    if (cfg != null)     enableNackTermination=!cfg.getBoolean(DISABLE_NACK_TERMINATION_PNAME,false);
  }
  if (enableNackTermination && channel instanceof NACKHandler) {
    cache=new CachingTransformer();
    transformerList.add(cache);
    nackNotifier=new NACKNotifier((NACKHandler)channel);
    rtcpTransformEngine=new RTCPTransformEngine(new Transformer[]{nackNotifier});
    transformerList.add(rtcpTransformEngine);
  }
  return transformerList.toArray(new TransformEngine[transformerList.size()]);
}
Program: 105024
Project: 105024
Buggy source:
/** 
 * {@inheritDoc}Assures that no more than one <tt>SctpConnection</tt> is added. Keeps  {@link #sctpConnection} and {@link #channelForDtls} up to date.
 */
@Override public boolean addChannel(Channel channel){
  if (closed)   return false;
  if (channel instanceof SctpConnection && sctpConnection != null && sctpConnection != channel) {
    logd("String_Node_Str");
    return false;
  }
  if (!super.addChannel(channel))   return false;
  if (channel instanceof SctpConnection) {
    sctpConnection=(SctpConnection)channel;
    if (channelForDtls != null) {
      RtpChannel rtpChannelForDtls=(RtpChannel)channelForDtls;
      rtpChannelForDtls.getDatagramFilter(false).setAcceptNonRtp(false);
      rtpChannelForDtls.getDatagramFilter(true).setAcceptNonRtp(false);
    }
    channelForDtls=sctpConnection;
  }
 else   if (channelForDtls == null) {
    channelForDtls=channel;
    RtpChannel rtpChannel=(RtpChannel)channel;
    rtpChannel.getDatagramFilter(false).setAcceptNonRtp(true);
    rtpChannel.getDatagramFilter(true).setAcceptNonRtp(!rtcpmux);
  }
  updatePayloadTypeFilters();
  if (iceConnected)   channel.transportConnected();
  EventAdmin eventAdmin=conference.getVideobridge().getEventAdmin();
  if (eventAdmin != null) {
    eventAdmin.sendEvent(EventFactory.transportChannelAdded(channel));
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Assures that no more than one <tt>SctpConnection</tt> is added. Keeps  {@link #sctpConnection} and {@link #channelForDtls} up to date.
 */
@Override public boolean addChannel(Channel channel){
  if (closed)   return false;
  if (channel instanceof SctpConnection && sctpConnection != null && sctpConnection != channel) {
    logd("String_Node_Str");
    return false;
  }
  if (!super.addChannel(channel))   return false;
  if (channel instanceof SctpConnection) {
    sctpConnection=(SctpConnection)channel;
    if (channelForDtls != null) {
      RtpChannel rtpChannelForDtls=(RtpChannel)channelForDtls;
      rtpChannelForDtls.getDatagramFilter(false).setAcceptNonRtp(false);
      rtpChannelForDtls.getDatagramFilter(true).setAcceptNonRtp(false);
    }
    channelForDtls=sctpConnection;
  }
 else   if (channelForDtls == null) {
    channelForDtls=channel;
    RtpChannel rtpChannel=(RtpChannel)channel;
    rtpChannel.getDatagramFilter(false).setAcceptNonRtp(true);
    rtpChannel.getDatagramFilter(true).setAcceptNonRtp(!rtcpmux);
  }
  if (iceConnected)   channel.transportConnected();
  EventAdmin eventAdmin=conference.getVideobridge().getEventAdmin();
  if (eventAdmin != null) {
    eventAdmin.sendEvent(EventFactory.transportChannelAdded(channel));
  }
  return true;
}
Program: 105025
Project: 105025
Buggy source:
/** 
 * Returns true if this <tt>RtpChannelDatagramFilter</tt> should accept an RTP packet with a payload type number <tt>pt</tt>. Checks whether <tt>pt</tt> is a payload type configured for the <tt>channel</tt>.
 * @param pt the payload type number of the packet.
 * @return true if this <tt>RtpChannelDatagramFilter</tt> should accept anRTP packet with a payload type number <tt>pt</tt>.
 */
private boolean acceptRTP(int pt){
  if (checkRtpPayloadType) {
    int[] channelPTs=channel.receivePTs;
    for (    int channelPT : channelPTs) {
      if (channelPT == pt)       return true;
    }
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Returns true if this <tt>RtpChannelDatagramFilter</tt> should accept an RTP packet with a payload type number <tt>pt</tt>. Checks whether <tt>pt</tt> is a payload type configured for the <tt>channel</tt>.
 * @param pt the payload type number of the packet.
 * @return true if this <tt>RtpChannelDatagramFilter</tt> should accept anRTP packet with a payload type number <tt>pt</tt>.
 */
private boolean acceptRTP(int pt){
  int[] channelPTs=channel.receivePTs;
  if (channelPTs == null || channelPTs.length == 0) {
    if (channel.getChannelBundleId() == null) {
      return true;
    }
 else {
      if (!missingPtsWarningLogged) {
        missingPtsWarningLogged=true;
        logger.warn("String_Node_Str" + channel.getID() + "String_Node_Str"+ "String_Node_Str");
      }
      return false;
    }
  }
  for (  int channelPT : channelPTs) {
    if (channelPT == pt)     return true;
  }
  return false;
}
Program: 105026
Project: 105026
Buggy source:
/** 
 * Returns <tt>true</tt> if this <tt>RtpChannelDatagramFilter</tt> should accept an RTCP packet described by <tt>data</tt>, <tt>off</tt>, and <tt>len</tt>. Checks whether the SSRC of the packet sender is an SSRC received on the <tt>channel</tt>.
 * @param data
 * @param len
 * @param off
 * @return
 */
private boolean acceptRTCP(byte[] data,int off,int len){
  if (checkRtcpSsrc) {
    if (len >= 8) {
      int packetSenderSSRC=RTPTranslatorImpl.readInt(data,off + 4);
      int[] channelSSRCs=channel.getReceiveSSRCs();
      for (      int channelSSRC : channelSSRCs) {
        if (channelSSRC == packetSenderSSRC)         return true;
      }
    }
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Returns <tt>true</tt> if this <tt>RtpChannelDatagramFilter</tt> should accept an RTCP packet described by <tt>data</tt>, <tt>off</tt>, and <tt>len</tt>. Checks whether the SSRC of the packet sender is an SSRC received on the <tt>channel</tt>.
 * @param data
 * @param len
 * @param off
 * @return
 */
private boolean acceptRTCP(byte[] data,int off,int len){
  if (len >= 8) {
    int packetSenderSSRC=RTPTranslatorImpl.readInt(data,off + 4);
    int[] channelSSRCs=channel.getReceiveSSRCs();
    for (    int channelSSRC : channelSSRCs) {
      if (channelSSRC == packetSenderSSRC)       return true;
    }
  }
  return false;
}
Program: 105027
Project: 105027
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean accept(DatagramPacket p){
  int len=p.getLength();
  if (len >= 4) {
    byte[] data=p.getData();
    int off=p.getOffset();
    if (((data[off + 0] & 0xc0) >> 6) == 2) {
      int pt=data[off + 1] & 0xff;
      if (200 <= pt && pt <= 211) {
        return rtcp && acceptRTCP(data,off,len);
      }
 else {
        return !rtcp && acceptRTP(pt & 0x7f);
      }
    }
  }
  return acceptNonRtp && DTLS_DATAGRAM_FILTER.accept(p);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean accept(DatagramPacket p){
  int len=p.getLength();
  if (len >= 4) {
    byte[] data=p.getData();
    int off=p.getOffset();
    if (((data[off + 0] & 0xc0) >> 6) == 2) {
      int pt=data[off + 1] & 0xff;
      if (200 <= pt && pt <= 211) {
        return rtcp && acceptRTCP(data,off,len);
      }
 else {
        return !rtcp && acceptRTP(pt & 0x7f);
      }
    }
  }
  return acceptNonRtp && DTLSDatagramFilter.isDTLS(p);
}
Program: 105028
Project: 105028
Buggy source:
/** 
 * Logs an <tt>Event</tt> to an <tt>InfluxDB</tt> database. This method returns without blocking, the blocking operations are performed by a thread from   {@link #executor}.
 * @param e the <tt>Event</tt> to log.
 */
@SuppressWarnings("String_Node_Str") private void logEvent(InfluxDBEvent e){
  boolean useLocalTime=e.useLocalTime();
  long now=System.currentTimeMillis();
  boolean multipoint=false;
  int pointCount=1;
  JSONArray columns=new JSONArray();
  JSONArray points=new JSONArray();
  Object[] values=e.getValues();
  if (useLocalTime)   columns.add("String_Node_Str");
  Collections.addAll(columns,e.getColumns());
  if (values[0] instanceof Object[]) {
    multipoint=true;
    pointCount=values.length;
  }
  if (multipoint) {
    for (int i=0; i < pointCount; i++) {
      JSONArray point=new JSONArray();
      if (useLocalTime)       point.add(now);
      Collections.addAll(point,values[i]);
      points.add(point);
    }
  }
 else {
    JSONArray point=new JSONArray();
    if (useLocalTime)     point.add(System.currentTimeMillis());
    Collections.addAll(point,values);
    points.add(point);
  }
  JSONObject jsonObject=new JSONObject();
  jsonObject.put("String_Node_Str",e.getName());
  jsonObject.put("String_Node_Str",columns);
  jsonObject.put("String_Node_Str",points);
  JSONArray jsonArray=new JSONArray();
  jsonArray.add(jsonObject);
  final String jsonString=jsonArray.toJSONString();
  executor.execute(new Runnable(){
    @Override public void run(){
      sendPost(jsonString);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Logs an <tt>Event</tt> to an <tt>InfluxDB</tt> database. This method returns without blocking, the blocking operations are performed by a thread from   {@link #executor}.
 * @param e the <tt>Event</tt> to log.
 */
@SuppressWarnings("String_Node_Str") private void logEvent(InfluxDBEvent e){
  boolean useLocalTime=e.useLocalTime();
  long now=System.currentTimeMillis();
  boolean multipoint=false;
  int pointCount=1;
  JSONArray columns=new JSONArray();
  JSONArray points=new JSONArray();
  Object[] values=e.getValues();
  if (useLocalTime)   columns.add("String_Node_Str");
  Collections.addAll(columns,e.getColumns());
  if (values[0] instanceof Object[]) {
    multipoint=true;
    pointCount=values.length;
  }
  if (multipoint) {
    for (int i=0; i < pointCount; i++) {
      if (!(values[i] instanceof Object[]))       continue;
      JSONArray point=new JSONArray();
      if (useLocalTime)       point.add(now);
      Collections.addAll(point,(Object[])values[i]);
      points.add(point);
    }
  }
 else {
    JSONArray point=new JSONArray();
    if (useLocalTime)     point.add(now);
    Collections.addAll(point,values);
    points.add(point);
  }
  JSONObject jsonObject=new JSONObject();
  jsonObject.put("String_Node_Str",e.getName());
  jsonObject.put("String_Node_Str",columns);
  jsonObject.put("String_Node_Str",points);
  JSONArray jsonArray=new JSONArray();
  jsonArray.add(jsonObject);
  final String jsonString=jsonArray.toJSONString();
  executor.execute(new Runnable(){
    @Override public void run(){
      sendPost(jsonString);
    }
  }
);
}
Program: 105029
Project: 105029
Buggy source:
/** 
 * Sets the <tt>Set</tt> of the SSRCs that this <tt>RtpChannel</tt> has signaled and updates the <tt>Content</tt> SSRCs accordingly.
 * @param sources The <tt>List</tt> of <tt>SourcePacketExtension</tt> thatdescribes the list of sources of this <tt>RtpChannel</tt> and that is used as the input in the update of the Sets the <tt>Set</tt> of the SSRCs that this <tt>RtpChannel</tt> has signaled.
 */
public void setSources(List<SourcePacketExtension> sources){
  if (sources == null || sources.isEmpty()) {
    return;
  }
  Set<Integer> oldSignaledSSRCs=signaledSSRCs;
  Set<Integer> newSignaledSSRCs=new HashSet<Integer>();
  for (  SourcePacketExtension source : sources) {
    int ssrc=(int)source.getSSRC();
    if (ssrc != -1) {
      newSignaledSSRCs.add((int)source.getSSRC());
    }
  }
  Set<Integer> addedSSRCs=new HashSet<Integer>(newSignaledSSRCs);
  addedSSRCs.removeAll(oldSignaledSSRCs);
  if (!addedSSRCs.isEmpty()) {
    for (    Integer addedSSRC : addedSSRCs) {
      addReceiveSSRC(addedSSRC);
    }
  }
  oldSignaledSSRCs.removeAll(newSignaledSSRCs);
  if (!oldSignaledSSRCs.isEmpty()) {
    for (    Integer removedSSRC : oldSignaledSSRCs) {
      removeReceiveSSRC(removedSSRC);
    }
  }
  signaledSSRCs=newSignaledSSRCs;
  touch();
}

Fixed version (ground truth):
/** 
 * Sets the <tt>Set</tt> of the SSRCs that this <tt>RtpChannel</tt> has signaled and updates the <tt>Content</tt> SSRCs accordingly.
 * @param sources The <tt>List</tt> of <tt>SourcePacketExtension</tt> thatdescribes the list of sources of this <tt>RtpChannel</tt> and that is used as the input in the update of the Sets the <tt>Set</tt> of the SSRCs that this <tt>RtpChannel</tt> has signaled.
 */
public synchronized void setSources(List<SourcePacketExtension> sources){
  if (sources == null || sources.isEmpty()) {
    return;
  }
  Set<Integer> oldSignaledSSRCs=new HashSet<Integer>(signaledSSRCs);
  Set<Integer> newSignaledSSRCs=new HashSet<Integer>();
  for (  SourcePacketExtension source : sources) {
    int ssrc=(int)source.getSSRC();
    if (ssrc != -1) {
      newSignaledSSRCs.add((int)source.getSSRC());
    }
  }
  Set<Integer> addedSSRCs=new HashSet<Integer>(newSignaledSSRCs);
  addedSSRCs.removeAll(oldSignaledSSRCs);
  if (!addedSSRCs.isEmpty()) {
    for (    Integer addedSSRC : addedSSRCs) {
      addReceiveSSRC(addedSSRC);
    }
  }
  oldSignaledSSRCs.removeAll(newSignaledSSRCs);
  if (!oldSignaledSSRCs.isEmpty()) {
    for (    Integer removedSSRC : oldSignaledSSRCs) {
      removeReceiveSSRC(removedSSRC);
    }
  }
  signaledSSRCs=newSignaledSSRCs;
  touch();
}
Program: 105030
Project: 105030
Buggy source:
/** 
 * Creates a new "transport manager state changed" <tt>Event</tt>, which indicates that a Jitsi Videobridge TransportManager has changed its state.
 * @param transportManager the changed transport manager object
 * @return the <tt>Event</tt> which was created.
 */
public static Event transportStateChanged(IceUdpTransportManager transportManager,IceProcessingState oldState,IceProcessingState newState){
  Dictionary properties=new Hashtable(3);
  properties.put("String_Node_Str",transportManager);
  properties.put("String_Node_Str",oldState);
  properties.put("String_Node_Str",newState);
  return new Event(TRANSPORT_STATE_CHANGED_TOPIC,properties);
}

Fixed version (ground truth):
/** 
 * Creates a new "transport manager state changed" <tt>Event</tt>, which indicates that a Jitsi Videobridge TransportManager has changed its state.
 * @param transportManager the changed transport manager object
 * @return the <tt>Event</tt> which was created.
 */
public static Event transportStateChanged(IceUdpTransportManager transportManager,IceProcessingState oldState,IceProcessingState newState){
  Dictionary properties=new Hashtable(3);
  properties.put(EVENT_SOURCE,transportManager);
  properties.put("String_Node_Str",oldState);
  properties.put("String_Node_Str",newState);
  return new Event(TRANSPORT_STATE_CHANGED_TOPIC,properties);
}
Program: 105033
Project: 105033
Buggy source:
/** 
 * Initializes a new <tt>Endpoint</tt> instance with a specific (unique) identifier/ID of the endpoint of a participant in a <tt>Conference</tt>.
 * @param id the identifier/ID of the endpoint of a participant in a<tt>Conference</tt> with which the new instance is to be initialized
 */
public Endpoint(String id){
  if (id == null)   throw new NullPointerException("String_Node_Str");
  this.id=id;
}

Fixed version (ground truth):
/** 
 * Initializes a new <tt>Endpoint</tt> instance with a specific (unique) identifier/ID of the endpoint of a participant in a <tt>Conference</tt>.
 * @param id the identifier/ID of the endpoint of a participant in a<tt>Conference</tt> with which the new instance is to be initialized
 */
public Endpoint(String id,Conference conference){
  if (id == null)   throw new NullPointerException("String_Node_Str");
  this.weakConference=new WeakReference<Conference>(conference);
  this.id=id;
}
Program: 105034
Project: 105034
Buggy source:
private Endpoint getPinnedEndpoint(){
  Endpoint endpoint=getEndpoint();
  if (endpoint != null) {
    String pinnedEndpointID=endpoint.getPinnedEndpointID();
    if (!StringUtils.isNullOrEmpty(pinnedEndpointID)) {
      return getContent().getConference().getEndpoint(pinnedEndpointID);
    }
  }
  return null;
}

Fixed version (ground truth):
private Endpoint getPinnedEndpoint(){
  Endpoint endpoint=getEndpoint();
  return endpoint != null ? endpoint.getPinnedEndpoint() : null;
}
Program: 105035
Project: 105035
Buggy source:
/** 
 * @param ssrc
 * @return
 */
public boolean accept(long ssrc){
  SimulcastLayer current=getCurrent();
  boolean accept=false;
  if (current != null)   accept=current.accept(ssrc);
  if (!accept) {
    SimulcastLayer next=getNext();
    if (next != null) {
      accept=next.accept(ssrc);
      if (accept)       maybeSwitchToNext();
    }
  }
  SimulcastLayer override=getOverride();
  if (override != null)   accept=override.accept(ssrc);
  return accept;
}

Fixed version (ground truth):
/** 
 * @param ssrc
 * @return
 */
public boolean accept(long ssrc){
  SimulcastLayer current=getCurrent();
  boolean accept=false;
  if (current != null)   accept=current.accept(ssrc);
  if (!accept) {
    SimulcastLayer next=getNext();
    if (next != null) {
      accept=next.accept(ssrc);
      if (accept)       maybeSwitchToNext();
    }
  }
  SimulcastLayer override=getOverride();
  if (override != null)   accept=override.accept(ssrc);
  if (!accept) {
    Integer key=Integer.valueOf((int)ssrc);
    CyclicCounter counter=dropped.getOrCreate(key,0x800);
    accept=counter.cyclicallyIncrementAndGet() < 8;
  }
  return accept;
}
Program: 105038
Project: 105038
Buggy source:
/** 
 * Handles all error responses.
 * @param error the error object.
 * @param packetID the id of the received packet.
 */
private void handleErrorResponse(XMPPError error,String packetID){
  if (error != null && ((XMPPError.Type.CANCEL.equals(error.getType()) && (XMPPError.Condition.conflict.toString().equals(error.getCondition()))) || (XMPPError.Type.AUTH.equals(error.getType()) && (XMPPError.Condition.forbidden.toString().equals(error.getCondition()))))) {
    if (XMPPError.Condition.forbidden.toString().equals(error.getCondition())) {
      logger.warn("String_Node_Str" + "String_Node_Str");
    }
    String nodeName=pendingCreateRequests.get(packetID);
    if (nodeName != null) {
      nodes.add(nodeName);
      pendingCreateRequests.remove(packetID);
      fireResponseCreateEvent(Response.SUCCESS);
      return;
    }
  }
  String errorMessage="String_Node_Str";
  if (pendingCreateRequests.remove(packetID) != null) {
    fireResponseCreateEvent(Response.FAIL);
    errorMessage+="String_Node_Str";
  }
 else   if (pendingConfigureRequests.remove(packetID) != null) {
    errorMessage+="String_Node_Str";
    fireResponseCreateEvent(Response.SUCCESS);
  }
 else   if (pendingPublishRequests.remove(packetID) != null) {
    errorMessage+="String_Node_Str";
    fireResponsePublishEvent(Response.FAIL);
  }
  if (error != null)   errorMessage+="String_Node_Str" + error.getMessage() + "String_Node_Str"+ error.getCondition()+ "String_Node_Str"+ packetID+ "String_Node_Str";
  logger.error(errorMessage);
}

Fixed version (ground truth):
/** 
 * Handles all error responses.
 * @param error the error object.
 * @param packetID the id of the received packet.
 */
private void handleErrorResponse(XMPPError error,String packetID){
  if (error != null && ((XMPPError.Type.CANCEL.equals(error.getType()) && (XMPPError.Condition.conflict.toString().equals(error.getCondition()) || XMPPError.Condition.forbidden.toString().equals(error.getCondition()))))) {
    if (XMPPError.Condition.forbidden.toString().equals(error.getCondition())) {
      logger.warn("String_Node_Str" + "String_Node_Str");
    }
    String nodeName=pendingCreateRequests.get(packetID);
    if (nodeName != null) {
      nodes.add(nodeName);
      pendingCreateRequests.remove(packetID);
      fireResponseCreateEvent(Response.SUCCESS);
      return;
    }
  }
  String errorMessage="String_Node_Str";
  if (pendingCreateRequests.remove(packetID) != null) {
    fireResponseCreateEvent(Response.FAIL);
    errorMessage+="String_Node_Str";
  }
 else   if (pendingConfigureRequests.remove(packetID) != null) {
    errorMessage+="String_Node_Str";
    fireResponseCreateEvent(Response.SUCCESS);
  }
 else   if (pendingPublishRequests.remove(packetID) != null) {
    errorMessage+="String_Node_Str";
    fireResponsePublishEvent(Response.FAIL);
  }
  if (error != null)   errorMessage+="String_Node_Str" + error.getMessage() + "String_Node_Str"+ error.getCondition()+ "String_Node_Str"+ packetID+ "String_Node_Str";
  logger.error(errorMessage);
}
Program: 105039
Project: 105039
Buggy source:
private void maybeForgetNext(){
  SimulcastLayer next=getNext();
  if (next != null && !next.isStreaming()) {
synchronized (receiveLayersSyncRoot) {
      this.weakNext=null;
      this.seenNext=0;
    }
  }
}

Fixed version (ground truth):
private void maybeForgetNext(){
synchronized (receiveLayersSyncRoot) {
    SimulcastLayer next=getNext();
    if (next != null && !next.isStreaming()) {
      this.weakNext=null;
      this.seenNext=0;
    }
  }
}
Program: 105041
Project: 105041
Buggy source:
/** 
 */
private void maybeSwitchToNext(){
  SimulcastLayer next=getNext();
  if (next != null) {
synchronized (receiveLayersSyncRoot) {
      seenNext++;
      if (seenNext > MAX_NEXT_SEEN) {
        this.sendSimulcastLayersChangedEvent(next);
        this.weakCurrent=weakNext;
        this.weakNext=null;
        if (logger.isDebugEnabled()) {
          Map<String,Object> map=new HashMap<String,Object>(3);
          map.put("String_Node_Str",getSelf());
          map.put("String_Node_Str",getPeer());
          map.put("String_Node_Str",next);
          StringCompiler sc=new StringCompiler(map);
          logger.debug(sc.c("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void maybeSwitchToNext(){
synchronized (receiveLayersSyncRoot) {
    SimulcastLayer next=getNext();
    if (next != null) {
      seenNext++;
      if (seenNext > MAX_NEXT_SEEN * Math.pow(2,next.getOrder())) {
        this.sendSimulcastLayersChangedEvent(next);
        this.weakCurrent=weakNext;
        this.weakNext=null;
        if (logger.isDebugEnabled()) {
          Map<String,Object> map=new HashMap<String,Object>(3);
          map.put("String_Node_Str",getSelf());
          map.put("String_Node_Str",getPeer());
          map.put("String_Node_Str",next);
          StringCompiler sc=new StringCompiler(map);
          logger.debug(sc.c("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"));
        }
      }
    }
  }
}