Program: 103578
Project: 103578
Buggy source:
/** 
 * Creates a <tt>List</tt> containing the   {@link ContentPacketExtension}s of the 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 {@link List} containing the {@link ContentPacketExtension}s of streams 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.
 */
public List<ContentPacketExtension> createContentList() throws OperationFailedException {
  List<ContentPacketExtension> mediaDescs=new ArrayList<ContentPacketExtension>();
  for (  MediaType mediaType : MediaType.values()) {
    MediaDevice dev=getDefaultDevice(mediaType);
    if (dev != null) {
      MediaDirection direction=dev.getDirection().and(getDirectionUserPreference(mediaType));
      if (isLocallyOnHold())       direction=direction.and(MediaDirection.SENDONLY);
      if (direction != MediaDirection.INACTIVE) {
        ContentPacketExtension content=createContentForOffer(dev.getSupportedFormats(),direction,dev.getSupportedExtensions());
        if (peer.getCall().isSipZrtpAttribute()) {
          ZrtpControl control=getZrtpControls().get(mediaType);
          if (control == null) {
            control=JabberActivator.getMediaService().createZrtpControl();
            getZrtpControls().put(mediaType,control);
          }
          String helloHash=control.getHelloHash();
          if (helloHash != null && helloHash.length() > 0) {
            ZrtpHashPacketExtension hash=new ZrtpHashPacketExtension();
            hash.setValue(helloHash);
          }
        }
        mediaDescs.add(content);
      }
    }
  }
  if (mediaDescs.isEmpty()) {
    ProtocolProviderServiceJabberImpl.throwOperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.GENERAL_ERROR,null,logger);
  }
  getTransportManager().startCandidateHarvest(mediaDescs);
  return getTransportManager().wrapupHarvest();
}

Fixed version (ground truth):
/** 
 * Creates a <tt>List</tt> containing the   {@link ContentPacketExtension}s of the 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 {@link List} containing the {@link ContentPacketExtension}s of streams 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.
 */
public List<ContentPacketExtension> createContentList() throws OperationFailedException {
  List<ContentPacketExtension> mediaDescs=new ArrayList<ContentPacketExtension>();
  for (  MediaType mediaType : MediaType.values()) {
    MediaDevice dev=getDefaultDevice(mediaType);
    if (dev != null) {
      MediaDirection direction=dev.getDirection().and(getDirectionUserPreference(mediaType));
      if (isLocallyOnHold())       direction=direction.and(MediaDirection.SENDONLY);
      if (direction != MediaDirection.INACTIVE) {
        ContentPacketExtension content=createContentForOffer(dev.getSupportedFormats(),direction,dev.getSupportedExtensions());
        if (peer.getCall().isSipZrtpAttribute()) {
          ZrtpControl control=getZrtpControls().get(mediaType);
          if (control == null) {
            control=JabberActivator.getMediaService().createZrtpControl();
            getZrtpControls().put(mediaType,control);
          }
          String helloHash=control.getHelloHash();
          if (helloHash != null && helloHash.length() > 0) {
            ZrtpHashPacketExtension hash=new ZrtpHashPacketExtension();
            hash.setValue(helloHash);
            content.addChildExtension(hash);
          }
        }
        mediaDescs.add(content);
      }
    }
  }
  if (mediaDescs.isEmpty()) {
    ProtocolProviderServiceJabberImpl.throwOperationFailedException("String_Node_Str" + "String_Node_Str",OperationFailedException.GENERAL_ERROR,null,logger);
  }
  getTransportManager().startCandidateHarvest(mediaDescs);
  return getTransportManager().wrapupHarvest();
}