<commit_before>module OmfCommon

  class MPMessage < OML4R::MPBase
    name :message
    param :time, :type => :double
    param :operation, :type => :string
    param :mid, :type => :string
    param :cid, :type => :string
    param :content, :type => :string
  end

  class Message

    OMF_NAMESPACE = "http://schema.mytestbed.net/omf/#{OmfCommon::PROTOCOL_VERSION}/protocol"
    OMF_CORE_READ = [:operation, :ts, :src, :mid, :replyto, :cid, :itype, :rtype, :guard, :res_id]
    OMF_CORE_WRITE = [:replyto, :itype, :guard]

    @@providers = {
      xml: {
        require: 'omf_common/message/xml/message',
        constructor: 'OmfCommon::Message::XML::Message'
      },
      json: {
        require: 'omf_common/message/json/json_message',
        constructor: 'OmfCommon::Message::Json::Message'
      }
    }
    @@message_class = nil

    def self.create(type, properties, body = {})
      @@message_class.create(type, properties, body)
    end

    def self.create_inform_message(itype = nil, properties = {}, body = {})
      body[:itype] = itype if itype
      create(:inform, properties, body)<commit_msg>Some components in the RC create messages with 'nil' as the property. This fix ensures that the actual message classes are being called with an empty hash instead.<commit_after>module OmfCommon

  class MPMessage < OML4R::MPBase
    name :message
    param :time, :type => :double
    param :operation, :type => :string
    param :mid, :type => :string
    param :cid, :type => :string
    param :content, :type => :string
  end

  class Message

    OMF_NAMESPACE = "http://schema.mytestbed.net/omf/#{OmfCommon::PROTOCOL_VERSION}/protocol"
    OMF_CORE_READ = [:operation, :ts, :src, :mid, :replyto, :cid, :itype, :rtype, :guard, :res_id]
    OMF_CORE_WRITE = [:replyto, :itype, :guard]

    @@providers = {
      xml: {
        require: 'omf_common/message/xml/message',
        constructor: 'OmfCommon::Message::XML::Message'
      },
      json: {
        require: 'omf_common/message/json/json_message',
        constructor: 'OmfCommon::Message::Json::Message'
      }
    }
    @@message_class = nil

    def self.create(type, properties, body = {})
      @@message_class.create(type, properties || {}, body)
    end

    def self.create_inform_message(itype = nil, properties = {}, body = {})
      body[:itype] = itype if itype
      create(:inform, properties, body)
{'fraction_non_alphanumeric': 0.14202172096908938, 'fraction_numerical': 0.000835421888053467, 'mean_word_length': 3.24645390070922, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1541516', 'n_tokens_mistral': 788, 'n_tokens_neox': 778, 'n_words': 186}