Program: 103066
Project: 103066
Buggy source:
/** 
 * Creates a <tt>Vector</tt> containing the <tt>MediaDescription</tt>s of streams that this handler is prepared to initiate depending on available <tt>MediaDevice</tt>s and local on-hold and video transmission preferences.
 * @return a <tt>Vector</tt> containing the <tt>MediaDescription</tt>s ofstreams that this handler is prepared to initiate.
 * @throws OperationFailedException if we fail to create the descriptionsfor reasons like - problems with device interaction, allocating ports, etc.
 */
private Vector<MediaDescription> createMediaDescriptions() throws OperationFailedException {
  Vector<MediaDescription> mediaDescs=new Vector<MediaDescription>();
  QualityPreset sendQualityPreset=null;
  QualityPreset receiveQualityPreset=null;
  if (qualityControls != null) {
    sendQualityPreset=qualityControls.getRemoteReceivePreset();
    receiveQualityPreset=qualityControls.getRemoteSendMaxPreset();
  }
  for (  MediaType mediaType : MediaType.values()) {
    MediaDevice dev=getDefaultDevice(mediaType);
    if (!isDeviceActive(dev,sendQualityPreset,receiveQualityPreset))     continue;
    MediaDirection direction=dev.getDirection().and(getDirectionUserPreference(mediaType));
    if (isLocallyOnHold())     direction=direction.and(MediaDirection.SENDONLY);
    if (direction != MediaDirection.INACTIVE) {
      for (      String proto : getRtpTransports()) {
        QualityPreset effectiveSendQualityPreset=direction.allowsSending() ? sendQualityPreset : null;
        MediaDescription md=createMediaDescription(proto,getLocallySupportedFormats(dev,effectiveSendQualityPreset,receiveQualityPreset),getTransportManager().getStreamConnector(mediaType),direction,dev.getSupportedExtensions());
        try {
          if (mediaType.equals(MediaType.VIDEO) && (receiveQualityPreset != null)) {
            int frameRate=(int)receiveQualityPreset.getFameRate();
            if (frameRate > 0) {
              md.setAttribute("String_Node_Str",String.valueOf(frameRate));
            }
          }
        }
 catch (        SdpException e) {
        }
        if (DtlsControl.UDP_TLS_RTP_SAVP.equals(proto) || DtlsControl.UDP_TLS_RTP_SAVPF.equals(proto)) {
          updateMediaDescriptionForDtls(mediaType,md,null);
        }
 else {
          updateMediaDescriptionForZrtp(mediaType,md,null);
          if (SrtpControl.RTP_SAVP.equals(proto) || SrtpControl.RTP_SAVPF.equals(proto)) {
            updateMediaDescriptionForSDes(mediaType,md,null);
          }
        }
        mediaDescs.add(md);
      }
    }
  }
  if (mediaDescs.isEmpty()) {
    ProtocolProviderServiceSipImpl.throwOperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.GENERAL_ERROR,null,logger);
  }
  return mediaDescs;
}

Fixed version (ground truth):
/** 
 * Creates a <tt>Vector</tt> containing the <tt>MediaDescription</tt>s of streams that this handler is prepared to initiate depending on available <tt>MediaDevice</tt>s and local on-hold and video transmission preferences.
 * @return a <tt>Vector</tt> containing the <tt>MediaDescription</tt>s ofstreams that this handler is prepared to initiate.
 * @throws OperationFailedException if we fail to create the descriptionsfor reasons like - problems with device interaction, allocating ports, etc.
 */
private Vector<MediaDescription> createMediaDescriptions() throws OperationFailedException {
  Vector<MediaDescription> mediaDescs=new Vector<MediaDescription>();
  QualityPreset sendQualityPreset=null;
  QualityPreset receiveQualityPreset=null;
  if (qualityControls != null) {
    sendQualityPreset=qualityControls.getRemoteReceivePreset();
    receiveQualityPreset=qualityControls.getRemoteSendMaxPreset();
  }
  for (  MediaType mediaType : MediaType.values()) {
    MediaDevice dev=getDefaultDevice(mediaType);
    if (!isDeviceActive(dev,sendQualityPreset,receiveQualityPreset))     continue;
    MediaDirection direction=dev.getDirection().and(getDirectionUserPreference(mediaType));
    if (isLocallyOnHold())     direction=direction.and(MediaDirection.SENDONLY);
    if (direction != MediaDirection.INACTIVE) {
      for (      String proto : getRtpTransports()) {
        QualityPreset effectiveSendQualityPreset=direction.allowsSending() ? sendQualityPreset : null;
        MediaDescription md=createMediaDescription(proto,getLocallySupportedFormats(dev,effectiveSendQualityPreset,receiveQualityPreset),getTransportManager().getStreamConnector(mediaType),direction,dev.getSupportedExtensions());
        try {
          if (mediaType.equals(MediaType.VIDEO) && (receiveQualityPreset != null)) {
            int frameRate=(int)receiveQualityPreset.getFameRate();
            if (frameRate > 0) {
              md.setAttribute("String_Node_Str",String.valueOf(frameRate));
            }
          }
        }
 catch (        SdpException e) {
        }
        if (DtlsControl.UDP_TLS_RTP_SAVP.equals(proto) || DtlsControl.UDP_TLS_RTP_SAVPF.equals(proto)) {
          updateMediaDescriptionForDtls(mediaType,md,null);
        }
 else {
          updateMediaDescriptionForZrtp(mediaType,md,null);
          if (SrtpControl.RTP_SAVP.equals(proto) || SrtpControl.RTP_SAVPF.equals(proto)) {
            updateMediaDescriptionForSDes(mediaType,md,null);
          }
          if (SrtpControl.RTP_SAVPF.equals(proto)) {
            updateMediaDescriptionForDtls(mediaType,md,null);
          }
        }
        mediaDescs.add(md);
      }
    }
  }
  if (mediaDescs.isEmpty()) {
    ProtocolProviderServiceSipImpl.throwOperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.GENERAL_ERROR,null,logger);
  }
  return mediaDescs;
}