nus-yam/ex-repair huggingface dataset:
Program: 105042
Project: 105042
Buggy source:
/** 
 * Initializes a new <tt>Agent</tt> instance which implements the ICE protocol and which is to be used by this instance to implement the Jingle ICE-UDP transport.
 * @return a new <tt>Agent</tt> instance which implements the ICE protocoland which is to be used by this instance to implement the Jingle ICE-UDP transport
 * @throws IOException if initializing a new <tt>Agent</tt> instance for thepurposes of this <tt>TransportManager</tt> fails
 */
private Agent createIceAgent(boolean isControlling,String iceStreamName) throws IOException {
  NetworkAddressManagerService nams=ServiceUtils.getService(getBundleContext(),NetworkAddressManagerService.class);
  Agent iceAgent=nams.createIceAgent();
  appendVideobridgeHarvesters(iceAgent);
  iceAgent.setControlling(isControlling);
  iceAgent.setPerformConsentFreshness(true);
synchronized (IceUdpTransportManager.class) {
    if (initializePortNumbers) {
      initializePortNumbers=false;
      JitsiTransportManager.initializePortNumbers();
    }
  }
  PortTracker portTracker=JitsiTransportManager.getPortTracker(MediaType.AUDIO);
  IceMediaStream iceStream=nams.createIceStream(numComponents,portTracker.getPort(),iceStreamName,iceAgent);
  try {
    portTracker.setNextPort(1 + iceStream.getComponent(Component.RTCP).getLocalCandidates().get(0).getTransportAddress().getPort());
  }
 catch (  Throwable t) {
    if (t instanceof InterruptedException)     Thread.currentThread().interrupt();
 else     if (t instanceof ThreadDeath)     throw (ThreadDeath)t;
  }
  return iceAgent;
}

Fixed version (ground truth):
/** 
 * Initializes a new <tt>Agent</tt> instance which implements the ICE protocol and which is to be used by this instance to implement the Jingle ICE-UDP transport.
 * @return a new <tt>Agent</tt> instance which implements the ICE protocoland which is to be used by this instance to implement the Jingle ICE-UDP transport
 * @throws IOException if initializing a new <tt>Agent</tt> instance for thepurposes of this <tt>TransportManager</tt> fails
 */
private Agent createIceAgent(boolean isControlling,String iceStreamName) throws IOException {
  NetworkAddressManagerService nams=ServiceUtils.getService(getBundleContext(),NetworkAddressManagerService.class);
  Agent iceAgent=nams.createIceAgent();
  appendVideobridgeHarvesters(iceAgent);
  iceAgent.setControlling(isControlling);
  iceAgent.setPerformConsentFreshness(true);
  PortTracker portTracker=JitsiTransportManager.getPortTracker(null);
  int portBase=portTracker.getPort();
  IceMediaStream iceStream=nams.createIceStream(numComponents,portBase,iceStreamName,iceAgent);
  try {
    portTracker.setNextPort(1 + iceStream.getComponent(numComponents > 1 ? Component.RTCP : Component.RTP).getLocalCandidates().get(0).getTransportAddress().getPort());
  }
 catch (  Throwable t) {
    if (t instanceof InterruptedException)     Thread.currentThread().interrupt();
 else     if (t instanceof ThreadDeath)     throw (ThreadDeath)t;
 else     portTracker.setNextPort(numComponents + portBase);
  }
  return iceAgent;
}
Program: 105043
Project: 105043
Buggy source:
/** 
 * Returns <tt>true</tt> if this <tt>SctpConnection</tt> is connected to the remote peer and operational.
 * @return <tt>true</tt> if this <tt>SctpConnection</tt> is connected to theremote peer and operational
 */
public boolean isReady(){
  return assocIsUp && peerAddrIsConfirmed;
}

Fixed version (ground truth):
/** 
 * Returns <tt>true</tt> if this <tt>SctpConnection</tt> is connected to the remote peer and operational.
 * @return <tt>true</tt> if this <tt>SctpConnection</tt> is connected to theremote peer and operational
 */
public boolean isReady(){
  return assocIsUp && acceptedIncomingConnection;
}
Program: 105044
Project: 105044
Buggy source:
@Override public void run(){
  SctpSocket sctpSocket=null;
  try {
    sctpSocket=SctpConnection.this.sctpSocket;
    while (sctpSocket != null && !sctpSocket.accept()) {
      Thread.sleep(100);
      sctpSocket=SctpConnection.this.sctpSocket;
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  if (sctpSocket == null && logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + getID() + "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  SctpSocket sctpSocket=null;
  try {
    sctpSocket=SctpConnection.this.sctpSocket;
    while (sctpSocket != null) {
      if (sctpSocket.accept()) {
        acceptedIncomingConnection=true;
        break;
      }
      Thread.sleep(100);
      sctpSocket=SctpConnection.this.sctpSocket;
    }
    if (isReady()) {
      notifySctpConnectionReady();
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  if (sctpSocket == null && logger.isInfoEnabled()) {
    logger.info("String_Node_Str" + getID() + "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 105046
Project: 105046
Buggy source:
/** 
 * Implements notification in order to track socket state.
 */
@Override public synchronized void onSctpNotification(SctpSocket socket,SctpNotification notification){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + socket + "String_Node_Str"+ notification);
  }
switch (notification.sn_type) {
case SctpNotification.SCTP_ASSOC_CHANGE:
    SctpNotification.AssociationChange assocChange=(SctpNotification.AssociationChange)notification;
switch (assocChange.state) {
case SctpNotification.AssociationChange.SCTP_COMM_UP:
    if (!assocIsUp) {
      boolean wasReady=isReady();
      assocIsUp=true;
      if (isReady() && !wasReady)       notifySctpConnectionReady();
    }
  break;
case SctpNotification.AssociationChange.SCTP_COMM_LOST:
case SctpNotification.AssociationChange.SCTP_SHUTDOWN_COMP:
case SctpNotification.AssociationChange.SCTP_CANT_STR_ASSOC:
try {
  closeStream();
}
 catch (IOException e) {
  logger.error("String_Node_Str",e);
}
break;
}
break;
case SctpNotification.SCTP_PEER_ADDR_CHANGE:
SctpNotification.PeerAddressChange peerAddrChange=(SctpNotification.PeerAddressChange)notification;
switch (peerAddrChange.state) {
case SctpNotification.PeerAddressChange.SCTP_ADDR_AVAILABLE:
case SctpNotification.PeerAddressChange.SCTP_ADDR_CONFIRMED:
if (!peerAddrIsConfirmed) {
boolean wasReady=isReady();
peerAddrIsConfirmed=true;
if (isReady() && !wasReady) notifySctpConnectionReady();
}
break;
}
break;
}
}

Fixed version (ground truth):
/** 
 * Implements notification in order to track socket state.
 */
@Override public synchronized void onSctpNotification(SctpSocket socket,SctpNotification notification){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + socket + "String_Node_Str"+ notification);
  }
switch (notification.sn_type) {
case SctpNotification.SCTP_ASSOC_CHANGE:
    SctpNotification.AssociationChange assocChange=(SctpNotification.AssociationChange)notification;
switch (assocChange.state) {
case SctpNotification.AssociationChange.SCTP_COMM_UP:
    if (!assocIsUp) {
      boolean wasReady=isReady();
      assocIsUp=true;
      if (isReady() && !wasReady)       notifySctpConnectionReady();
    }
  break;
case SctpNotification.AssociationChange.SCTP_COMM_LOST:
case SctpNotification.AssociationChange.SCTP_SHUTDOWN_COMP:
case SctpNotification.AssociationChange.SCTP_CANT_STR_ASSOC:
try {
  closeStream();
}
 catch (IOException e) {
  logger.error("String_Node_Str",e);
}
break;
}
break;
}
}
Program: 105047
Project: 105047
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected void closeStream() throws IOException {
  try {
synchronized (this) {
      assocIsUp=false;
      peerAddrIsConfirmed=false;
      if (sctpSocket != null) {
        sctpSocket.close();
        sctpSocket=null;
      }
    }
  }
  finally {
    if (iceSocket != null) {
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected void closeStream() throws IOException {
  try {
synchronized (this) {
      assocIsUp=false;
      acceptedIncomingConnection=false;
      if (sctpSocket != null) {
        sctpSocket.close();
        sctpSocket=null;
      }
    }
  }
  finally {
    if (iceSocket != null) {
    }
  }
}
Program: 105048
Project: 105048
Buggy source:
/** 
 * Notifies the <tt>WebRtcDataStreamListener</tt>s added to this instance that this <tt>SctpConnection</tt> is ready i.e. it is connected to the remote peer and operational.
 */
private void notifySctpConnectionReadyInEventDispatcher(){
  try {
    Thread.sleep(1000);
  }
 catch (  InterruptedException ex) {
  }
  if (!isExpired() && isReady()) {
    WebRtcDataStreamListener[] ls=getChannelListeners();
    if (ls != null) {
      for (      WebRtcDataStreamListener l : ls) {
        l.onSctpConnectionReady(this);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies the <tt>WebRtcDataStreamListener</tt>s added to this instance that this <tt>SctpConnection</tt> is ready i.e. it is connected to the remote peer and operational.
 */
private void notifySctpConnectionReadyInEventDispatcher(){
  if (!isExpired() && isReady()) {
    WebRtcDataStreamListener[] ls=getChannelListeners();
    if (ls != null) {
      for (      WebRtcDataStreamListener l : ls) {
        l.onSctpConnectionReady(this);
      }
    }
  }
}
Program: 105050
Project: 105050
Buggy source:
/** 
 * Gets the <tt>RTPTranslator</tt> which forwards the RTP and RTCP traffic between the <tt>Channel</tt>s of this <tt>Content</tt> which use a translator as their RTP-level relay.
 * @return the <tt>RTPTranslator</tt> which forwards the RTP and RTCPtraffic between the <tt>Channel</tt>s of this <tt>Content</tt> which use a translator as their RTP-level relay
 */
public RTPTranslator getRTPTranslator(){
synchronized (rtpLevelRelaySyncRoot) {
    if ((rtpTranslator == null) && !expired) {
      rtpTranslator=getMediaService().createRTPTranslator();
      if (rtpTranslator != null) {
        new RTPTranslatorWriteFilter(rtpTranslator,this);
        if (rtpTranslator instanceof RTPTranslatorImpl) {
          RTPTranslatorImpl rtpTranslatorImpl=(RTPTranslatorImpl)rtpTranslator;
          initialLocalSSRC=new Random().nextInt();
          rtpTranslatorImpl.setLocalSSRC(initialLocalSSRC);
          MediaType mediaType=getMediaType();
          if (MediaType.VIDEO.equals(mediaType))           setRTCPTerminationStrategyFromConfiguration();
          rtcpFeedbackMessageSender=rtpTranslatorImpl.getRtcpFeedbackMessageSender();
        }
      }
    }
    return rtpTranslator;
  }
}

Fixed version (ground truth):
/** 
 * Gets the <tt>RTPTranslator</tt> which forwards the RTP and RTCP traffic between the <tt>Channel</tt>s of this <tt>Content</tt> which use a translator as their RTP-level relay.
 * @return the <tt>RTPTranslator</tt> which forwards the RTP and RTCPtraffic between the <tt>Channel</tt>s of this <tt>Content</tt> which use a translator as their RTP-level relay
 */
public RTPTranslator getRTPTranslator(){
synchronized (rtpLevelRelaySyncRoot) {
    if ((rtpTranslator == null) && !expired) {
      rtpTranslator=getMediaService().createRTPTranslator();
      if (rtpTranslator != null) {
        new RTPTranslatorWriteFilter(rtpTranslator,this);
        if (rtpTranslator instanceof RTPTranslatorImpl) {
          RTPTranslatorImpl rtpTranslatorImpl=(RTPTranslatorImpl)rtpTranslator;
          initialLocalSSRC=Videobridge.RANDOM.nextInt();
          rtpTranslatorImpl.setLocalSSRC(initialLocalSSRC);
          MediaType mediaType=getMediaType();
          if (MediaType.VIDEO.equals(mediaType))           setRTCPTerminationStrategyFromConfiguration();
          rtcpFeedbackMessageSender=rtpTranslatorImpl.getRtcpFeedbackMessageSender();
        }
      }
    }
    return rtpTranslator;
  }
}
Program: 105051
Project: 105051
Buggy source:
/** 
 * Initializes a new <tt>Channel</tt> instance which is to have a specific ID. The initialization is to be considered requested by a specific <tt>Content</tt>.
 * @param content the <tt>Content</tt> which is initializing the newinstance
 * @param id the ID of the new instance. It is expected to be unique withinthe list of <tt>Channel</tt>s listed in <tt>content</tt> while the new instance is listed there as well.
 * @param channelBundleId the ID of the channel-bundle this<tt>RtpChannel</tt> is to be a part of (or <tt>null</tt> if no it is not to be a part of a channel-bundle).
 * @throws Exception if an error occurs while initializing the new instance
 */
public RtpChannel(Content content,String id,String channelBundleId) throws Exception {
  super(content,id,channelBundleId);
  MediaService mediaService=getMediaService();
  MediaType mediaType=getContent().getMediaType();
  stream=mediaService.createMediaStream(null,mediaType,getDtlsControl());
  stream.addPropertyChangeListener(streamPropertyChangeListener);
  stream.setName(getID());
  stream.setProperty(RtpChannel.class.getName(),this);
  initialLocalSSRC=new Random().nextInt();
  conferenceSpeechActivity=getContent().getConference().getSpeechActivity();
  if (conferenceSpeechActivity != null) {
    conferenceSpeechActivity.addPropertyChangeListener(propertyChangeListener);
  }
  touch();
}

Fixed version (ground truth):
/** 
 * Initializes a new <tt>Channel</tt> instance which is to have a specific ID. The initialization is to be considered requested by a specific <tt>Content</tt>.
 * @param content the <tt>Content</tt> which is initializing the newinstance
 * @param id the ID of the new instance. It is expected to be unique withinthe list of <tt>Channel</tt>s listed in <tt>content</tt> while the new instance is listed there as well.
 * @param channelBundleId the ID of the channel-bundle this<tt>RtpChannel</tt> is to be a part of (or <tt>null</tt> if no it is not to be a part of a channel-bundle).
 * @throws Exception if an error occurs while initializing the new instance
 */
public RtpChannel(Content content,String id,String channelBundleId) throws Exception {
  super(content,id,channelBundleId);
  MediaService mediaService=getMediaService();
  MediaType mediaType=getContent().getMediaType();
  stream=mediaService.createMediaStream(null,mediaType,getDtlsControl());
  stream.addPropertyChangeListener(streamPropertyChangeListener);
  stream.setName(getID());
  stream.setProperty(RtpChannel.class.getName(),this);
  initialLocalSSRC=Videobridge.RANDOM.nextInt();
  conferenceSpeechActivity=getContent().getConference().getSpeechActivity();
  if (conferenceSpeechActivity != null) {
    conferenceSpeechActivity.addPropertyChangeListener(propertyChangeListener);
  }
  touch();
}
Program: 105053
Project: 105053
Buggy source:
/** 
 * Handles PubSub configuration responses.
 * @param response the configuration response.
 */
private void handleConfigurationResponse(IQ response){
  if (pendingConfigureRequests.remove(response) != null)   fireResponseCreateEvent(Response.SUCCESS);
}

Fixed version (ground truth):
/** 
 * Handles PubSub configuration responses.
 * @param response the configuration response.
 */
private void handleConfigurationResponse(IQ response){
  if (pendingConfigureRequests.remove(response.getPacketID()) != null)   fireResponseCreateEvent(Response.SUCCESS);
}
Program: 105054
Project: 105054
Buggy source:
/** 
 * Releases the resources for the <tt>PubSubPublisher</tt> and removes it from the list of available instances.
 * @param mgr the <tt>PubSubPublisher</tt> that will be released.
 */
public static void releasePubsubManager(PubSubPublisher mgr){
  instances.remove(mgr);
  mgr.dispose();
}

Fixed version (ground truth):
/** 
 * Releases the resources for the <tt>PubSubPublisher</tt> and removes it from the list of available instances.
 * @param publisher the <tt>PubSubPublisher</tt> that will be released.
 */
public static void releasePubsubManager(PubSubPublisher publisher){
  instances.values().remove(publisher);
  publisher.dispose();
}
Program: 105055
Project: 105055
Buggy source:
/** 
 * Creates and returns <tt>PubSubPublisher</tt> instance for the given service
 * @param serviceName the name of the service
 * @return <tt>PubSubPublisher</tt> instance.
 */
public static PubSubPublisher getPubsubManager(String serviceName){
  if (!instances.containsKey(serviceName)) {
    instances.put(serviceName,new PubSubPublisher(serviceName));
  }
  return instances.get(serviceName);
}

Fixed version (ground truth):
/** 
 * Creates and returns <tt>PubSubPublisher</tt> instance for the given service
 * @param serviceName the name of the service
 * @return <tt>PubSubPublisher</tt> instance.
 */
public static PubSubPublisher getPubsubManager(String serviceName){
  PubSubPublisher publisher;
  if (instances.containsKey(serviceName)) {
    publisher=instances.get(serviceName);
  }
 else {
    publisher=new PubSubPublisher(serviceName);
    instances.put(serviceName,publisher);
  }
  return publisher;
}
Program: 105056
Project: 105056
Buggy source:
/** 
 * Sets the values of the properties of a specific <tt>ColibriConferenceIQ</tt> to the values of the respective properties of this instance. Thus, the specified <tt>iq</tt> may be thought of as a description of this instance. <p> <b>Note</b>: The copying of the values is deep i.e. the <tt>Contents</tt>s of this instance are described in the specified <tt>iq</tt>. </p>
 * @param iq the <tt>ColibriConferenceIQ</tt> to set the values of theproperties of this instance on
 */
public void describeDeep(ColibriConferenceIQ iq){
  describeShallow(iq);
  if (isRecording()) {
    ColibriConferenceIQ.Recording recordingIQ=new ColibriConferenceIQ.Recording(true);
    recordingIQ.setPath(getRecordingPath());
    iq.setRecording(recordingIQ);
  }
  for (  Content content : getContents()) {
    ColibriConferenceIQ.Content contentIQ=iq.getOrCreateContent(content.getName());
    for (    Channel channel : content.getChannels()) {
      ColibriConferenceIQ.Channel channelIQ=new ColibriConferenceIQ.Channel();
      channel.describe(channelIQ);
      contentIQ.addChannel(channelIQ);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the values of the properties of a specific <tt>ColibriConferenceIQ</tt> to the values of the respective properties of this instance. Thus, the specified <tt>iq</tt> may be thought of as a description of this instance. <p> <b>Note</b>: The copying of the values is deep i.e. the <tt>Contents</tt>s of this instance are described in the specified <tt>iq</tt>. </p>
 * @param iq the <tt>ColibriConferenceIQ</tt> to set the values of theproperties of this instance on
 */
public void describeDeep(ColibriConferenceIQ iq){
  describeShallow(iq);
  if (isRecording()) {
    ColibriConferenceIQ.Recording recordingIQ=new ColibriConferenceIQ.Recording(true);
    recordingIQ.setPath(getRecordingPath());
    iq.setRecording(recordingIQ);
  }
  for (  Content content : getContents()) {
    ColibriConferenceIQ.Content contentIQ=iq.getOrCreateContent(content.getName());
    for (    Channel channel : content.getChannels()) {
      if (channel instanceof SctpConnection) {
        ColibriConferenceIQ.SctpConnection sctpConnectionIQ=new ColibriConferenceIQ.SctpConnection();
        channel.describe(sctpConnectionIQ);
        contentIQ.addSctpConnection(sctpConnectionIQ);
      }
 else {
        ColibriConferenceIQ.Channel channelIQ=new ColibriConferenceIQ.Channel();
        channel.describe(channelIQ);
        contentIQ.addChannel(channelIQ);
      }
    }
  }
}
Program: 105057
Project: 105057
Buggy source:
public static JSONObject serializeChannelCommon(ColibriConferenceIQ.ChannelCommon channelCommon){
  JSONObject jsonObject;
  if (channelCommon == null) {
    jsonObject=null;
  }
 else {
    String channelBundleId=channelCommon.getChannelBundleId();
    String endpoint=channelCommon.getEndpoint();
    int expire=channelCommon.getExpire();
    Boolean initiator=channelCommon.isInitiator();
    IceUdpTransportPacketExtension transport=channelCommon.getTransport();
    jsonObject=new JSONObject();
    if (channelBundleId != null) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.CHANNEL_BUNDLE_ID_ATTR_NAME,channelBundleId);
    }
    if (endpoint != null) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.ENDPOINT_ATTR_NAME,endpoint);
    }
    if (expire >= 0) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.EXPIRE_ATTR_NAME,expire);
    }
    if (initiator != null) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.INITIATOR_ATTR_NAME,initiator);
    }
    if (transport != null) {
      jsonObject.put(transport.getElementName(),serializeTransport(transport));
    }
  }
  return jsonObject;
}

Fixed version (ground truth):
public static JSONObject serializeChannelCommon(ColibriConferenceIQ.ChannelCommon channelCommon){
  JSONObject jsonObject;
  if (channelCommon == null) {
    jsonObject=null;
  }
 else {
    String id=channelCommon.getID();
    String channelBundleId=channelCommon.getChannelBundleId();
    String endpoint=channelCommon.getEndpoint();
    int expire=channelCommon.getExpire();
    Boolean initiator=channelCommon.isInitiator();
    IceUdpTransportPacketExtension transport=channelCommon.getTransport();
    jsonObject=new JSONObject();
    if (id != null) {
      jsonObject.put(ColibriConferenceIQ.Channel.ID_ATTR_NAME,id);
    }
    if (channelBundleId != null) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.CHANNEL_BUNDLE_ID_ATTR_NAME,channelBundleId);
    }
    if (endpoint != null) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.ENDPOINT_ATTR_NAME,endpoint);
    }
    if (expire >= 0) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.EXPIRE_ATTR_NAME,expire);
    }
    if (initiator != null) {
      jsonObject.put(ColibriConferenceIQ.ChannelCommon.INITIATOR_ATTR_NAME,initiator);
    }
    if (transport != null) {
      jsonObject.put(transport.getElementName(),serializeTransport(transport));
    }
  }
  return jsonObject;
}
Program: 105060
Project: 105060
Buggy source:
/** 
 * Gets the simulcast layers of this simulcast manager.
 * @return
 */
public SortedSet<SimulcastLayer> getSimulcastLayers(){
  return new TreeSet<SimulcastLayer>(simulcastLayers);
}

Fixed version (ground truth):
/** 
 * Gets the simulcast layers of this simulcast manager.
 * @return
 */
public SortedSet<SimulcastLayer> getSimulcastLayers(){
synchronized (simulcastLayersSyncRoot) {
    return simulcastLayers == null ? null : new TreeSet<SimulcastLayer>(simulcastLayers);
  }
}
Program: 105064
Project: 105064
Buggy source:
/** 
 * {@inheritDoc}SCTP input data callback.
 */
@Override public void onSctpPacket(byte[] data,int sid,int ssn,int tsn,long ppid,int context,int flags){
  if (ppid == WEB_RTC_PPID_CTRL) {
    try {
      onCtrlPacket(data,sid);
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
  }
 else   if (ppid == WEB_RTC_PPID_STRING || ppid == WEB_RTC_PPID_BIN) {
    WebRtcDataStream channel;
synchronized (this) {
      channel=channels.get(sid);
    }
    if (channel == null) {
      logger.error("String_Node_Str" + sid);
      return;
    }
    if (ppid == WEB_RTC_PPID_STRING) {
      channel.onStringMsg(new String(data));
    }
 else {
      channel.onBinaryMsg(data);
    }
  }
 else {
    logger.warn("String_Node_Str" + ppid);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}SCTP input data callback.
 */
@Override public void onSctpPacket(byte[] data,int sid,int ssn,int tsn,long ppid,int context,int flags){
  if (ppid == WEB_RTC_PPID_CTRL) {
    try {
      onCtrlPacket(data,sid);
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
  }
 else   if (ppid == WEB_RTC_PPID_STRING || ppid == WEB_RTC_PPID_BIN) {
    WebRtcDataStream channel;
synchronized (this) {
      channel=channels.get(sid);
    }
    if (channel == null) {
      logger.error("String_Node_Str" + sid);
      return;
    }
    if (ppid == WEB_RTC_PPID_STRING) {
      String str;
      String charsetName="String_Node_Str";
      try {
        str=new String(data,charsetName);
      }
 catch (      UnsupportedEncodingException uee) {
        logger.error("String_Node_Str" + charsetName,uee);
        str=null;
      }
      channel.onStringMsg(str);
    }
 else {
      channel.onBinaryMsg(data);
    }
  }
 else {
    logger.warn("String_Node_Str" + ppid);
  }
}
Program: 105065
Project: 105065
Buggy source:
/** 
 * Sends given text message over this WebRTC data channel using UTF8 encoding.
 * @param strMsg the text to be sent.
 * @throws IOException if IO error occurs while sending the message.
 */
public void sendString(String strMsg) throws IOException {
  try {
    byte[] raw=strMsg.getBytes("String_Node_Str");
    int res=socket.send(raw,true,sid,SctpConnection.WEB_RTC_PPID_STRING);
    if (res != raw.length) {
      throw new IOException("String_Node_Str");
    }
  }
 catch (  UnsupportedEncodingException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * Sends given text message over this WebRTC data channel using UTF8 encoding.
 * @param strMsg the text to be sent.
 * @throws IOException if IO error occurs while sending the message.
 */
public void sendString(String strMsg) throws IOException {
  try {
    byte[] bytes=strMsg.getBytes("String_Node_Str");
    int res=socket.send(bytes,true,sid,SctpConnection.WEB_RTC_PPID_STRING);
    if (res != bytes.length) {
      throw new IOException("String_Node_Str");
    }
  }
 catch (  UnsupportedEncodingException e) {
    throw new IOException(e);
  }
}
Program: 105066
Project: 105066
Buggy source:
/** 
 * Initializes a new <tt>Channel</tt> instance which is to have a specific ID. The initialization is to be considered requested by a specific <tt>Content</tt>.
 * @param content the <tt>Content</tt> which is initializing the newinstance
 * @param id the ID of the new instance. It is expected to be unique withinthe list of <tt>Channel</tt>s listed in <tt>content</tt> while the new instance is listed there as well.
 * @throws Exception if an error occurs while initializing the new instance
 */
public RtpChannel(Content content,String id) throws Exception {
  super(content);
  if (id == null)   throw new NullPointerException("String_Node_Str");
  this.id=id;
  MediaService mediaService=getMediaService();
  MediaType mediaType=getContent().getMediaType();
  stream=mediaService.createMediaStream(null,mediaType,mediaService.createSrtpControl(SrtpControlType.DTLS_SRTP));
  stream.addPropertyChangeListener(streamPropertyChangeListener);
  stream.setName(this.id);
  stream.setProperty(RtpChannel.class.getName(),this);
  if (RTPLevelRelayType.MIXER.equals(getRTPLevelRelayType())) {
    initialLocalSSRC=new Random().nextInt();
    stream.setSSRCFactory(new SSRCFactoryImpl(initialLocalSSRC));
  }
  conferenceSpeechActivity=getContent().getConference().getSpeechActivity();
  if (conferenceSpeechActivity != null) {
    conferenceSpeechActivity.addPropertyChangeListener(new WeakReferencePropertyChangeListener(this));
  }
  touch();
}

Fixed version (ground truth):
/** 
 * Initializes a new <tt>Channel</tt> instance which is to have a specific ID. The initialization is to be considered requested by a specific <tt>Content</tt>.
 * @param content the <tt>Content</tt> which is initializing the newinstance
 * @param id the ID of the new instance. It is expected to be unique withinthe list of <tt>Channel</tt>s listed in <tt>content</tt> while the new instance is listed there as well.
 * @throws Exception if an error occurs while initializing the new instance
 */
public RtpChannel(Content content,String id) throws Exception {
  super(content);
  if (id == null)   throw new NullPointerException("String_Node_Str");
  this.id=id;
  MediaService mediaService=getMediaService();
  MediaType mediaType=getContent().getMediaType();
  stream=mediaService.createMediaStream(null,mediaType,mediaService.createSrtpControl(SrtpControlType.DTLS_SRTP));
  stream.addPropertyChangeListener(streamPropertyChangeListener);
  stream.setName(this.id);
  stream.setProperty(RtpChannel.class.getName(),this);
  initialLocalSSRC=new Random().nextInt();
  conferenceSpeechActivity=getContent().getConference().getSpeechActivity();
  if (conferenceSpeechActivity != null) {
    conferenceSpeechActivity.addPropertyChangeListener(new WeakReferencePropertyChangeListener(this));
  }
  touch();
}
Program: 105068
Project: 105068
Buggy source:
/** 
 * Sets the values of the properties of a specific <tt>ColibriConferenceIQ.ChannelCommon</tt> to the values of the respective properties of this instance. Thus, the specified <tt>iq</tt> may be thought of as a description of this instance.
 * @param commonIq the <tt>ColibriConferenceIQ.ChannelCommon</tt> on whichto set the values of the properties of this instance.
 */
public void describe(ColibriConferenceIQ.ChannelCommon commonIq){
  super.describe(commonIq);
  ColibriConferenceIQ.Channel iq=(ColibriConferenceIQ.Channel)commonIq;
  iq.setRTPLevelRelayType(getRTPLevelRelayType());
  iq.setDirection(stream.getDirection());
  iq.setID(getID());
  iq.setLastN(lastN);
  long initialLocalSSRC=getInitialLocalSSRC();
  if (initialLocalSSRC != -1 && announceLocalSSRC()) {
    SourcePacketExtension source=new SourcePacketExtension();
    source.setSSRC(initialLocalSSRC);
    iq.addSource(source);
  }
  iq.setSSRCs(getReceiveSSRCs());
}

Fixed version (ground truth):
/** 
 * Sets the values of the properties of a specific <tt>ColibriConferenceIQ.ChannelCommon</tt> to the values of the respective properties of this instance. Thus, the specified <tt>iq</tt> may be thought of as a description of this instance.
 * @param commonIq the <tt>ColibriConferenceIQ.ChannelCommon</tt> on whichto set the values of the properties of this instance.
 */
@Override public void describe(ColibriConferenceIQ.ChannelCommon commonIq){
  ColibriConferenceIQ.Channel iq=(ColibriConferenceIQ.Channel)commonIq;
  iq.setRTPLevelRelayType(getRTPLevelRelayType());
  super.describe(commonIq);
  iq.setDirection(stream.getDirection());
  iq.setID(getID());
  iq.setLastN(lastN);
  long initialLocalSSRC=getInitialLocalSSRC();
  if (initialLocalSSRC != -1 && announceLocalSSRC()) {
    SourcePacketExtension source=new SourcePacketExtension();
    source.setSSRC(initialLocalSSRC);
    iq.addSource(source);
  }
  iq.setSSRCs(getReceiveSSRCs());
}
Program: 105069
Project: 105069
Buggy source:
/** 
 * Initializes OSGi and the videobridge.
 */
@BeforeClass public static void setUp() throws InterruptedException {
  StackProperties.initialize();
  OSGi.start(new BundleActivator(){
    @Override public void start(    BundleContext bundleContext) throws Exception {
      FocusControlTest.bc=bundleContext;
synchronized (FocusControlTest.class) {
        FocusControlTest.class.notify();
      }
    }
    @Override public void stop(    BundleContext bundleContext) throws Exception {
    }
  }
);
synchronized (FocusControlTest.class) {
    FocusControlTest.class.wait(5000);
    if (bc == null)     throw new RuntimeException("String_Node_Str");
  }
  bridge=ServiceUtils.getService(bc,Videobridge.class);
}

Fixed version (ground truth):
/** 
 * Initializes OSGi and the videobridge.
 */
@BeforeClass public static void setUp() throws InterruptedException {
  OSGi.start(new BundleActivator(){
    @Override public void start(    BundleContext bundleContext) throws Exception {
      FocusControlTest.bc=bundleContext;
synchronized (FocusControlTest.class) {
        FocusControlTest.class.notify();
      }
    }
    @Override public void stop(    BundleContext bundleContext) throws Exception {
    }
  }
);
synchronized (FocusControlTest.class) {
    FocusControlTest.class.wait(5000);
    if (bc == null)     throw new RuntimeException("String_Node_Str");
  }
  bridge=ServiceUtils.getService(bc,Videobridge.class);
}
Program: 105070
Project: 105070
Buggy source:
public Channel(Content content,String id) throws Exception {
  if (content == null)   throw new NullPointerException("String_Node_Str");
  if (id == null)   throw new NullPointerException("String_Node_Str");
  this.content=content;
  this.id=id;
  streamConnector=createStreamConnector();
  stream=getMediaService().createMediaStream(this.content.getMediaType());
  stream.setConnector(streamConnector);
  stream.setName(this.id);
  stream.setRTPTranslator(this.content.getRTPTranslator());
  stream.addPropertyChangeListener(streamPropertyChangeListener);
  stream.start();
  touch();
}

Fixed version (ground truth):
public Channel(Content content,String id) throws Exception {
  if (content == null)   throw new NullPointerException("String_Node_Str");
  if (id == null)   throw new NullPointerException("String_Node_Str");
  this.content=content;
  this.id=id;
  streamConnector=createStreamConnector();
  stream=getMediaService().createMediaStream(this.content.getMediaType());
  stream.addPropertyChangeListener(streamPropertyChangeListener);
  stream.setConnector(streamConnector);
  stream.setName(this.id);
  stream.setRTPTranslator(this.content.getRTPTranslator());
  stream.start();
  touch();
}
Program: 105071
Project: 105071
Buggy source:
/** 
 * Notifies this <tt>Channel</tt> that the value of a property of  {@link #stream} has changed from a specific old value to a specific newvalue.
 * @param ev a <tt>PropertyChangeEvent</tt> which specifies the name of theproperty which had its value changed and the old and new values of that property
 */
private void streamPropertyChange(PropertyChangeEvent ev){
  String propertyName=ev.getPropertyName();
  String prefix=MediaStreamImpl.class.getName() + "String_Node_Str";
  if (propertyName.startsWith(prefix)) {
    Object newValue=ev.getNewValue();
    if (newValue instanceof RTPConnectorInputStream) {
      String rtpConnectorPropertyName=propertyName.substring(0,prefix.length());
      DatagramPacketFilter datagramPacketFilter;
      if (rtpConnectorPropertyName.equals("String_Node_Str")) {
        datagramPacketFilter=new DatagramPacketFilter(){
          public boolean accept(          DatagramPacket p){
            return acceptControlInputStreamDatagramPacket(p);
          }
        }
;
      }
 else       if (rtpConnectorPropertyName.equals("String_Node_Str")) {
        datagramPacketFilter=new DatagramPacketFilter(){
          public boolean accept(          DatagramPacket p){
            return acceptDataInputStreamDatagramPacket(p);
          }
        }
;
      }
 else       datagramPacketFilter=null;
      if (datagramPacketFilter != null) {
        ((RTPConnectorInputStream)newValue).addDatagramPacketFilter(datagramPacketFilter);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies this <tt>Channel</tt> that the value of a property of  {@link #stream} has changed from a specific old value to a specific newvalue.
 * @param ev a <tt>PropertyChangeEvent</tt> which specifies the name of theproperty which had its value changed and the old and new values of that property
 */
private void streamPropertyChange(PropertyChangeEvent ev){
  String propertyName=ev.getPropertyName();
  String prefix=MediaStreamImpl.class.getName() + "String_Node_Str";
  if (propertyName.startsWith(prefix)) {
    Object newValue=ev.getNewValue();
    if (newValue instanceof RTPConnectorInputStream) {
      String rtpConnectorPropertyName=propertyName.substring(prefix.length());
      DatagramPacketFilter datagramPacketFilter;
      if (rtpConnectorPropertyName.equals("String_Node_Str")) {
        datagramPacketFilter=new DatagramPacketFilter(){
          public boolean accept(          DatagramPacket p){
            return acceptControlInputStreamDatagramPacket(p);
          }
        }
;
      }
 else       if (rtpConnectorPropertyName.equals("String_Node_Str")) {
        datagramPacketFilter=new DatagramPacketFilter(){
          public boolean accept(          DatagramPacket p){
            return acceptDataInputStreamDatagramPacket(p);
          }
        }
;
      }
 else       datagramPacketFilter=null;
      if (datagramPacketFilter != null) {
        ((RTPConnectorInputStream)newValue).addDatagramPacketFilter(datagramPacketFilter);
      }
    }
  }
}
Program: 105072
Project: 105072
Buggy source:
@Override public NetworkACLItem moveNetworkAclRuleToNewPosition(MoveNetworkAclItemCmd moveNetworkAclItemCmd){
  String uuidRuleBeingMoved=moveNetworkAclItemCmd.getUuidRuleBeingMoved();
  String nextAclRuleUuid=moveNetworkAclItemCmd.getNextAclRuleUuid();
  String previousAclRuleUuid=moveNetworkAclItemCmd.getPreviousAclRuleUuid();
  if (StringUtils.isBlank(previousAclRuleUuid) && StringUtils.isBlank(nextAclRuleUuid)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  NetworkACLItemVO ruleBeingMoved=_networkACLItemDao.findByUuid(uuidRuleBeingMoved);
  if (ruleBeingMoved == null) {
    throw new InvalidParameterValueException(String.format("String_Node_Str",uuidRuleBeingMoved));
  }
  NetworkACLItemVO previousRule=retrieveAndValidateAclRule(previousAclRuleUuid);
  NetworkACLItemVO nextRule=retrieveAndValidateAclRule(nextAclRuleUuid);
  validateMoveAclRulesData(ruleBeingMoved,previousRule,nextRule);
  List<NetworkACLItemVO> allAclRules=getAllAclRulesSortedByNumber(ruleBeingMoved.getAclId());
  if (previousRule == null) {
    return moveRuleToTheTop(ruleBeingMoved,allAclRules);
  }
  if (nextRule == null) {
    return moveRuleToTheBottom(ruleBeingMoved,allAclRules);
  }
  return moveRuleBetweenAclRules(ruleBeingMoved,allAclRules,previousRule,nextRule);
}

Fixed version (ground truth):
@Override public NetworkACLItem moveNetworkAclRuleToNewPosition(MoveNetworkAclItemCmd moveNetworkAclItemCmd){
  String uuidRuleBeingMoved=moveNetworkAclItemCmd.getUuidRuleBeingMoved();
  String nextAclRuleUuid=moveNetworkAclItemCmd.getNextAclRuleUuid();
  String previousAclRuleUuid=moveNetworkAclItemCmd.getPreviousAclRuleUuid();
  if (StringUtils.isBlank(previousAclRuleUuid) && StringUtils.isBlank(nextAclRuleUuid)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  NetworkACLItemVO ruleBeingMoved=_networkACLItemDao.findByUuid(uuidRuleBeingMoved);
  if (ruleBeingMoved == null) {
    throw new InvalidParameterValueException(String.format("String_Node_Str",uuidRuleBeingMoved));
  }
  NetworkACLItemVO previousRule=retrieveAndValidateAclRule(previousAclRuleUuid);
  NetworkACLItemVO nextRule=retrieveAndValidateAclRule(nextAclRuleUuid);
  validateMoveAclRulesData(ruleBeingMoved,previousRule,nextRule);
  try {
    NetworkACLVO lockedAcl=_networkACLDao.acquireInLockTable(ruleBeingMoved.getAclId());
    List<NetworkACLItemVO> allAclRules=getAllAclRulesSortedByNumber(lockedAcl.getId());
    validateAclConsistency(moveNetworkAclItemCmd,lockedAcl,allAclRules);
    if (previousRule == null) {
      return moveRuleToTheTop(ruleBeingMoved,allAclRules);
    }
    if (nextRule == null) {
      return moveRuleToTheBottom(ruleBeingMoved,allAclRules);
    }
    return moveRuleBetweenAclRules(ruleBeingMoved,allAclRules,previousRule,nextRule);
  }
  finally {
    _networkACLDao.releaseFromLockTable(ruleBeingMoved.getAclId());
  }
}
Program: 105073
Project: 105073
Buggy source:
@Test public void moveNetworkAclRuleToNewPositionTestMoveRuleToBottom(){
  configureNextAndPreviousAclRuleUuidsForMoveAclRuleCommand(nextAclRuleUuid,previousAclRuleUuid);
  Mockito.doNothing().when(networkAclServiceImpl).validateMoveAclRulesData(aclRuleBeingMovedMock,previousAclRuleMock,null);
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclItemDaoMock).findByUuid(uuidAclRuleBeingMoved);
  Mockito.doReturn(previousAclRuleMock).when(networkAclServiceImpl).retrieveAndValidateAclRule(previousAclRuleUuid);
  Mockito.doReturn(null).when(networkAclServiceImpl).retrieveAndValidateAclRule(nextAclRuleUuid);
  configureMoveMethodsToDoNothing();
  networkAclServiceImpl.moveNetworkAclRuleToNewPosition(moveNetworkAclItemCmdMock);
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleToTheTop(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(1)).moveRuleToTheBottom(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleBetweenAclRules(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class),Mockito.eq(previousAclRuleMock),Mockito.eq(nextAclRuleMock));
}

Fixed version (ground truth):
@Test public void moveNetworkAclRuleToNewPositionTestMoveRuleToBottom(){
  configureNextAndPreviousAclRuleUuidsForMoveAclRuleCommand(nextAclRuleUuid,previousAclRuleUuid);
  Mockito.doNothing().when(networkAclServiceImpl).validateMoveAclRulesData(aclRuleBeingMovedMock,previousAclRuleMock,null);
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclItemDaoMock).findByUuid(uuidAclRuleBeingMoved);
  Mockito.doReturn(previousAclRuleMock).when(networkAclServiceImpl).retrieveAndValidateAclRule(previousAclRuleUuid);
  Mockito.doReturn(null).when(networkAclServiceImpl).retrieveAndValidateAclRule(nextAclRuleUuid);
  configureMoveMethodsToDoNothing();
  networkAclServiceImpl.moveNetworkAclRuleToNewPosition(moveNetworkAclItemCmdMock);
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleToTheTop(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(1)).moveRuleToTheBottom(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleBetweenAclRules(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class),Mockito.eq(previousAclRuleMock),Mockito.eq(nextAclRuleMock));
  Mockito.verify(networkAclServiceImpl,Mockito.times(1)).validateAclConsistency(Mockito.any(MoveNetworkAclItemCmd.class),Mockito.any(NetworkACLVO.class),Mockito.anyListOf(NetworkACLItemVO.class));
}
Program: 105074
Project: 105074
Buggy source:
@Test public void moveNetworkAclRuleToNewPositionTestMoveRuleToTop(){
  configureNextAndPreviousAclRuleUuidsForMoveAclRuleCommand(nextAclRuleUuid,previousAclRuleUuid);
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclItemDaoMock).findByUuid(uuidAclRuleBeingMoved);
  Mockito.doReturn(null).when(networkAclServiceImpl).retrieveAndValidateAclRule(previousAclRuleUuid);
  Mockito.doReturn(nextAclRuleMock).when(networkAclServiceImpl).retrieveAndValidateAclRule(nextAclRuleUuid);
  Mockito.doNothing().when(networkAclServiceImpl).validateMoveAclRulesData(aclRuleBeingMovedMock,null,nextAclRuleMock);
  configureMoveMethodsToDoNothing();
  networkAclServiceImpl.moveNetworkAclRuleToNewPosition(moveNetworkAclItemCmdMock);
  Mockito.verify(networkAclServiceImpl,Mockito.times(1)).moveRuleToTheTop(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleToTheBottom(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleBetweenAclRules(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class),Mockito.eq(previousAclRuleMock),Mockito.eq(nextAclRuleMock));
}

Fixed version (ground truth):
@Test public void moveNetworkAclRuleToNewPositionTestMoveRuleToTop(){
  configureNextAndPreviousAclRuleUuidsForMoveAclRuleCommand(nextAclRuleUuid,previousAclRuleUuid);
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclItemDaoMock).findByUuid(uuidAclRuleBeingMoved);
  Mockito.doReturn(null).when(networkAclServiceImpl).retrieveAndValidateAclRule(previousAclRuleUuid);
  Mockito.doReturn(nextAclRuleMock).when(networkAclServiceImpl).retrieveAndValidateAclRule(nextAclRuleUuid);
  Mockito.doNothing().when(networkAclServiceImpl).validateMoveAclRulesData(aclRuleBeingMovedMock,null,nextAclRuleMock);
  configureMoveMethodsToDoNothing();
  networkAclServiceImpl.moveNetworkAclRuleToNewPosition(moveNetworkAclItemCmdMock);
  Mockito.verify(networkAclServiceImpl,Mockito.times(1)).moveRuleToTheTop(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleToTheBottom(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.verify(networkAclServiceImpl,Mockito.times(0)).moveRuleBetweenAclRules(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class),Mockito.eq(previousAclRuleMock),Mockito.eq(nextAclRuleMock));
  Mockito.verify(networkAclServiceImpl,Mockito.times(1)).validateAclConsistency(Mockito.any(MoveNetworkAclItemCmd.class),Mockito.any(NetworkACLVO.class),Mockito.anyListOf(NetworkACLItemVO.class));
}
Program: 105075
Project: 105075
Buggy source:
private void configureMoveMethodsToDoNothing(){
  Mockito.doReturn(new ArrayList<>()).when(networkAclServiceImpl).getAllAclRulesSortedByNumber(networkAclMockId);
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclServiceImpl).moveRuleToTheTop(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclServiceImpl).moveRuleToTheBottom(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclServiceImpl).moveRuleBetweenAclRules(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class),Mockito.eq(previousAclRuleMock),Mockito.eq(nextAclRuleMock));
}

Fixed version (ground truth):
private void configureMoveMethodsToDoNothing(){
  Mockito.doReturn(networkACLVOMock).when(networkAclDaoMock).acquireInLockTable(Mockito.anyLong());
  Mockito.doReturn(true).when(networkAclDaoMock).releaseFromLockTable(Mockito.anyLong());
  Mockito.doNothing().when(networkAclServiceImpl).validateAclConsistency(Mockito.any(MoveNetworkAclItemCmd.class),Mockito.any(NetworkACLVO.class),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.doReturn(new ArrayList<>()).when(networkAclServiceImpl).getAllAclRulesSortedByNumber(networkAclMockId);
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclServiceImpl).moveRuleToTheTop(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclServiceImpl).moveRuleToTheBottom(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class));
  Mockito.doReturn(aclRuleBeingMovedMock).when(networkAclServiceImpl).moveRuleBetweenAclRules(Mockito.eq(aclRuleBeingMovedMock),Mockito.anyListOf(NetworkACLItemVO.class),Mockito.eq(previousAclRuleMock),Mockito.eq(nextAclRuleMock));
}
Program: 105076
Project: 105076
Buggy source:
@Before public void befoteTest(){
  PowerMockito.mockStatic(CallContext.class);
  PowerMockito.when(CallContext.current()).thenReturn(Mockito.mock(CallContext.class));
  Mockito.when(networkAclDaoMock.findById(networkAclListId)).thenReturn(networkACLVOMock);
  Mockito.when(createNetworkAclCmdMock.getNetworkId()).thenReturn(1L);
  Mockito.when(createNetworkAclCmdMock.getProtocol()).thenReturn("String_Node_Str");
  Mockito.when(networkMock.getNetworkOfferingId()).thenReturn(networkOfferingMockId);
  Mockito.when(networkMock.getVpcId()).thenReturn(networkMockVpcMockId);
  Mockito.when(moveNetworkAclItemCmdMock.getUuidRuleBeingMoved()).thenReturn(uuidAclRuleBeingMoved);
  Mockito.when(aclRuleBeingMovedMock.getUuid()).thenReturn(uuidAclRuleBeingMoved);
  Mockito.when(aclRuleBeingMovedMock.getAclId()).thenReturn(networkAclMockId);
  Mockito.when(previousAclRuleMock.getUuid()).thenReturn(previousAclRuleUuid);
  Mockito.when(nextAclRuleMock.getUuid()).thenReturn(nextAclRuleUuid);
  Mockito.when(networkAclMock.getVpcId()).thenReturn(networkMockVpcMockId);
}

Fixed version (ground truth):
@Before public void befoteTest(){
  PowerMockito.mockStatic(CallContext.class);
  PowerMockito.when(CallContext.current()).thenReturn(callContextMock);
  Mockito.doReturn(Mockito.mock(User.class)).when(callContextMock).getCallingUser();
  Mockito.doReturn(Mockito.mock(Account.class)).when(callContextMock).getCallingAccount();
  Mockito.when(networkAclDaoMock.findById(networkAclListId)).thenReturn(networkACLVOMock);
  Mockito.when(createNetworkAclCmdMock.getNetworkId()).thenReturn(1L);
  Mockito.when(createNetworkAclCmdMock.getProtocol()).thenReturn("String_Node_Str");
  Mockito.when(networkMock.getNetworkOfferingId()).thenReturn(networkOfferingMockId);
  Mockito.when(networkMock.getVpcId()).thenReturn(networkMockVpcMockId);
  Mockito.when(moveNetworkAclItemCmdMock.getUuidRuleBeingMoved()).thenReturn(uuidAclRuleBeingMoved);
  Mockito.when(aclRuleBeingMovedMock.getUuid()).thenReturn(uuidAclRuleBeingMoved);
  Mockito.when(aclRuleBeingMovedMock.getAclId()).thenReturn(networkAclMockId);
  Mockito.when(previousAclRuleMock.getUuid()).thenReturn(previousAclRuleUuid);
  Mockito.when(nextAclRuleMock.getUuid()).thenReturn(nextAclRuleUuid);
  Mockito.when(networkAclMock.getVpcId()).thenReturn(networkMockVpcMockId);
}