Program: 50759
Project: 50759
Buggy source:
/** 
 * {@inheritDoc}
 */
public void handleEvent(EventObject event){
  org.apache.camel.Exchange exch=((org.apache.camel.management.event.AbstractExchangeEvent)event).getExchange();
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + exch);
  }
  org.switchyard.bus.camel.CamelMessage mesg=(org.switchyard.bus.camel.CamelMessage)exch.getIn();
  ExchangePhase phase=exch.getProperty("String_Node_Str",ExchangePhase.class);
  if (phase == null) {
    LOG.severe("String_Node_Str" + exch);
    return;
  }
  if (mesg == null) {
    LOG.severe("String_Node_Str" + phase + "String_Node_Str"+ exch);
    return;
  }
  org.switchyard.Context context=new org.switchyard.bus.camel.CamelCompositeContext(exch,mesg);
  Service provider=exch.getProperty("String_Node_Str",Service.class);
  ServiceReference consumer=exch.getProperty("String_Node_Str",ServiceReference.class);
  SecurityContext securityContext=exch.getProperty("String_Node_Str",SecurityContext.class);
  BaseExchangeContract contract=exch.getProperty("String_Node_Str",BaseExchangeContract.class);
  String messageId=null;
  String relatesTo=null;
  String contentType=null;
  java.util.Set<Property> props=context.getProperties(org.switchyard.Scope.MESSAGE);
  for (  Property p : props) {
    if (LOG.isLoggable(Level.FINEST)) {
      LOG.finest("String_Node_Str" + p.getName() + "String_Node_Str"+ p.getValue());
    }
    if (p.getName().equals("String_Node_Str")) {
      messageId=(String)p.getValue();
    }
 else     if (p.getName().equals("String_Node_Str")) {
      relatesTo=(String)p.getValue();
    }
 else     if (p.getName().equals("String_Node_Str")) {
      contentType=((QName)p.getValue()).toString();
    }
  }
  QName serviceType=consumer.getName();
  String opName=contract.getConsumerOperation().getName();
  if (phase == ExchangePhase.IN) {
    String intf=getInterface(consumer,provider);
    if (consumer.getConsumerMetadata().isBinding()) {
      getActivityCollector().startScope();
    }
 else {
      RequestSent sent=new RequestSent();
      if (provider == null || !provider.getProviderMetadata().isBinding()) {
        sent.setServiceType(serviceType.toString());
      }
      sent.setInterface(intf);
      sent.setOperation(opName);
      sent.setMessageId(messageId);
      record(mesg,contentType,sent,securityContext,exch);
      if (intf == null) {
        exch.setProperty("String_Node_Str",sent);
      }
    }
    if (provider == null || !provider.getProviderMetadata().isBinding()) {
      RequestReceived recvd=new RequestReceived();
      recvd.setServiceType(serviceType.toString());
      recvd.setInterface(intf);
      recvd.setOperation(opName);
      recvd.setMessageId(messageId);
      record(mesg,contentType,recvd,securityContext,exch);
      if (intf == null) {
        exch.setProperty("String_Node_Str",recvd);
      }
    }
  }
 else   if (phase == ExchangePhase.OUT) {
    if (contentType == null) {
      if (LOG.isLoggable(Level.FINEST)) {
        LOG.finest("String_Node_Str");
      }
      return;
    }
    String intf=getInterface(consumer,provider);
    RequestReceived rr=(RequestReceived)exch.getProperty("String_Node_Str");
    RequestSent rs=(RequestSent)exch.getProperty("String_Node_Str");
    if (intf != null) {
      if (rr != null) {
        rr.setInterface(intf);
      }
      if (rs != null) {
        rs.setInterface(intf);
      }
    }
    if (provider == null || !provider.getProviderMetadata().isBinding()) {
      ResponseSent sent=new ResponseSent();
      if (provider == null || !provider.getProviderMetadata().isBinding()) {
        sent.setServiceType(serviceType.toString());
      }
      sent.setInterface(intf);
      sent.setOperation(opName);
      sent.setMessageId(messageId);
      sent.setReplyToId(relatesTo);
      record(mesg,contentType,sent,securityContext,exch);
    }
    if (consumer.getConsumerMetadata().isBinding()) {
      getActivityCollector().endScope();
    }
 else {
      ResponseReceived recvd=new ResponseReceived();
      recvd.setServiceType(serviceType.toString());
      recvd.setInterface(intf);
      recvd.setOperation(opName);
      recvd.setMessageId(messageId);
      recvd.setReplyToId(relatesTo);
      record(mesg,contentType,recvd,securityContext,exch);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void handleEvent(EventObject event){
  org.apache.camel.Exchange exch=((org.apache.camel.management.event.AbstractExchangeEvent)event).getExchange();
  if (LOG.isLoggable(Level.FINEST)) {
    LOG.finest("String_Node_Str" + exch);
  }
  org.switchyard.bus.camel.CamelMessage mesg=(org.switchyard.bus.camel.CamelMessage)exch.getIn();
  ExchangePhase phase=exch.getProperty("String_Node_Str",ExchangePhase.class);
  if (phase == null) {
    LOG.severe("String_Node_Str" + exch);
    return;
  }
  if (mesg == null) {
    LOG.severe("String_Node_Str" + phase + "String_Node_Str"+ exch);
    return;
  }
  org.switchyard.Context context=new org.switchyard.bus.camel.CamelCompositeContext(exch,mesg);
  Service provider=exch.getProperty("String_Node_Str",Service.class);
  ServiceReference consumer=exch.getProperty("String_Node_Str",ServiceReference.class);
  String messageId=null;
  String relatesTo=null;
  String contentType=null;
  java.util.Set<Property> props=context.getProperties(org.switchyard.Scope.MESSAGE);
  for (  Property p : props) {
    if (LOG.isLoggable(Level.FINEST)) {
      LOG.finest("String_Node_Str" + p.getName() + "String_Node_Str"+ p.getValue());
    }
    if (p.getName().equals("String_Node_Str")) {
      messageId=(String)p.getValue();
    }
 else     if (p.getName().equals("String_Node_Str")) {
      relatesTo=(String)p.getValue();
    }
 else     if (p.getName().equals("String_Node_Str")) {
      contentType=((QName)p.getValue()).toString();
    }
  }
  if (phase == ExchangePhase.IN) {
    handleInExchange(exch,provider,consumer,messageId,contentType,mesg);
  }
 else   if (phase == ExchangePhase.OUT) {
    if (contentType == null) {
      if (LOG.isLoggable(Level.FINEST)) {
        LOG.finest("String_Node_Str");
      }
      return;
    }
    handleOutExchange(exch,provider,consumer,messageId,relatesTo,contentType,mesg);
  }
}