Ejemplo n.º 1
0
  /**
   * A hack to fix the problem with swapped ids in SRL in the mentor delivery 08032?
   *
   * @param typedCircularMessages
   */
  private void correctMessageIds(final Collection<TypedCircularMessage> typedCircularMessages) {
    for (TypedCircularMessage typedCircularMessage : typedCircularMessages) {
      Struct struct = typedCircularMessage.getStruct();

      /*
       * Detect id - name mismatch
       */
      if (struct.getId() == Message.UML_SEND.srlTypeId()) {
        if (struct.getName().equals("srl_UmlSignalReceive")) {
          struct.setId(Message.UML_RECEIVE.srlTypeId());
        }
      } else if (struct.getId() == Message.UML_RECEIVE.srlTypeId()) {
        if (struct.getName().equals("srl_UmlSignalSend")) {
          struct.setId(Message.UML_SEND.srlTypeId());
        }
      }
    }
  }