Program: 105023
Project: 105023
Buggy source:
/** 
 * {@inheritDoc}Keeps   {@link #sctpConnection} and {@link #channelForDtls} up to date.
 */
@Override public boolean close(Channel channel){
  boolean removed=super.close(channel);
  if (removed) {
    if (channel == sctpConnection) {
      sctpConnection=null;
    }
    if (channel == channelForDtls) {
      if (sctpConnection != null) {
        channelForDtls=sctpConnection;
      }
 else       if (channel instanceof RtpChannel) {
        RtpChannel newChannelForDtls=null;
        for (        Channel c : getChannels()) {
          if (c instanceof RtpChannel)           newChannelForDtls=(RtpChannel)c;
        }
        if (newChannelForDtls != null) {
          newChannelForDtls.getDatagramFilter(false).setAcceptNonRtp(true);
          newChannelForDtls.getDatagramFilter(true).setAcceptNonRtp(!rtcpmux);
        }
        channelForDtls=newChannelForDtls;
      }
      if (channel instanceof RtpChannel) {
        RtpChannel rtpChannel=(RtpChannel)channel;
        rtpChannel.getDatagramFilter(false).setAcceptNonRtp(false);
        rtpChannel.getDatagramFilter(true).setAcceptNonRtp(false);
      }
    }
    try {
      StreamConnector connector=channel.getStreamConnector();
      if (connector != null) {
        DatagramSocket datagramSocket=connector.getDataSocket();
        if (datagramSocket != null)         datagramSocket.close();
        datagramSocket=connector.getControlSocket();
        if (datagramSocket != null)         datagramSocket.close();
        Socket socket=connector.getDataTCPSocket();
        if (socket != null)         socket.close();
        socket=connector.getControlTCPSocket();
        if (socket != null)         socket.close();
      }
    }
 catch (    IOException ioe) {
      logd("String_Node_Str" + ioe);
    }
    updatePayloadTypeFilters();
    EventAdmin eventAdmin=conference.getVideobridge().getEventAdmin();
    if (eventAdmin != null) {
      eventAdmin.sendEvent(EventFactory.transportChannelRemoved(channel));
    }
    channel.transportClosed();
  }
  if (getChannels().isEmpty())   close();
  return removed;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Keeps   {@link #sctpConnection} and {@link #channelForDtls} up to date.
 */
@Override public boolean close(Channel channel){
  boolean removed=super.close(channel);
  if (removed) {
    if (channel == sctpConnection) {
      sctpConnection=null;
    }
    if (channel == channelForDtls) {
      if (sctpConnection != null) {
        channelForDtls=sctpConnection;
      }
 else       if (channel instanceof RtpChannel) {
        RtpChannel newChannelForDtls=null;
        for (        Channel c : getChannels()) {
          if (c instanceof RtpChannel)           newChannelForDtls=(RtpChannel)c;
        }
        if (newChannelForDtls != null) {
          newChannelForDtls.getDatagramFilter(false).setAcceptNonRtp(true);
          newChannelForDtls.getDatagramFilter(true).setAcceptNonRtp(!rtcpmux);
        }
        channelForDtls=newChannelForDtls;
      }
      if (channel instanceof RtpChannel) {
        RtpChannel rtpChannel=(RtpChannel)channel;
        rtpChannel.getDatagramFilter(false).setAcceptNonRtp(false);
        rtpChannel.getDatagramFilter(true).setAcceptNonRtp(false);
      }
    }
    try {
      StreamConnector connector=channel.getStreamConnector();
      if (connector != null) {
        DatagramSocket datagramSocket=connector.getDataSocket();
        if (datagramSocket != null)         datagramSocket.close();
        datagramSocket=connector.getControlSocket();
        if (datagramSocket != null)         datagramSocket.close();
        Socket socket=connector.getDataTCPSocket();
        if (socket != null)         socket.close();
        socket=connector.getControlTCPSocket();
        if (socket != null)         socket.close();
      }
    }
 catch (    IOException ioe) {
      logd("String_Node_Str" + ioe);
    }
    EventAdmin eventAdmin=conference.getVideobridge().getEventAdmin();
    if (eventAdmin != null) {
      eventAdmin.sendEvent(EventFactory.transportChannelRemoved(channel));
    }
    channel.transportClosed();
  }
  if (getChannels().isEmpty())   close();
  return removed;
}