Checks if message already processed. If so - it generates 'message
duplicated' compiler error.

@param msgName the name of the message
@param msgNode the node that represents JS message
321721
private void checkIfMessageDuplicated(String msgName, Node msgNode) {
    if (messageNames.containsKey(msgName)) {
      MessageLocation location = messageNames.get(msgName);
      compiler.report(JSError.make(msgNode, MESSAGE_DUPLICATE_KEY,
          msgName, location.messageNode.getSourceFileName(),
          Integer.toString(location.messageNode.getLineno())));
    }
  }
340470
private void incrementPortsIfDuplicateName(String configName, ProcessConfigBean config) {
        int startedCount = getNumberOfInstancesStarted(configName);

        int debugPort = config.getDebugPort();
        if ( debugPort != -1) {
            config.setDebugPort(debugPort + startedCount);
        }

        int remotingPort = config.getRemotingPort();
        if (remotingPort != -1) {
            config.setRemotingPort(remotingPort + startedCount);
        }
    }
1227953
private Expression generateSingleMsgVariable(MsgNode msgNode, String tmpVarName) {
    String googMsgVarName = buildGoogMsgVarNameHelper(msgNode);

    // Generate the goog.getMsg call.
    GoogMsgCodeGenInfo googMsgCodeGenInfo = genGoogGetMsgCallHelper(googMsgVarName, msgNode);

    if (!msgNode.isPlrselMsg()) {
      // No postprocessing is needed. Simply use the original goog.getMsg var.
      return googMsgCodeGenInfo.googMsgVar;
    }
    // For plural/select messages, generate the goog.i18n.MessageFormat call.
    // We don't want to output the result of goog.getMsg() directly. Instead, we send that
    // string to goog.i18n.MessageFormat for postprocessing. This postprocessing is where we're
    // handling all placeholder replacements, even ones that have nothing to do with
    // plural/select.
    return VariableDeclaration.builder(tmpVarName)
        .setRhs(getMessageFormatCall(googMsgCodeGenInfo))
        .build()
        .ref();
  }
424270
function printMsg ( msgId, data ) {
    var outputFn;

    if ( messages.hasOwnProperty( msgId) ) {
      switch ( msgId.match( /^[A-Z]+/ )[0] ) {
        case 'INFO':
          outputFn = grunt.log.writeln;
          break;

        case 'VERBOSE':
          outputFn = grunt.verbose.writeln;
          break;

        case 'DEBUG':
          outputFn = grunt.log.debug;
          break;

        default:
          outputFn = grunt.fail.warn;
      } // switch

      outputFn( grunt.template.process( messages[ msgId ], { data: data } ) );
    }
  }
674201
private static ImmutableList<SoyMsgPart> buildMsgPartsForChildren(
      MsgBlockNode parent, MsgNode msgNode) {

    ImmutableList.Builder<SoyMsgPart> msgParts = ImmutableList.builder();
    doBuildMsgPartsForChildren(parent, msgNode, msgParts);
    return msgParts.build();
  }
965972
private void addBestEffortMessage(SIMPMessage msgItem) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "addBestEffortMessage", new Object[] { msgItem });
    
    // Get the JsMessage as we need to update the Guaranteed fields
    JsMessage jsMsg = msgItem.getMessage();
 
    long tick = this.messageProcessor.nextTick();

    //Set a unique id in the message if explicitly told to or
    //if one has not already been set
    if(msgItem.getRequiresNewId()  ||  jsMsg.getSystemMessageId()==null)
    {
      jsMsg.setSystemMessageSourceUuid(this.messageProcessor.getMessagingEngineUuid());
      jsMsg.setSystemMessageValue(tick);
      msgItem.setRequiresNewId(false);
    }

    jsMsg.setGuaranteedValueEndTick(tick);
    jsMsg.setGuaranteedValueValueTick(tick);
    jsMsg.setGuaranteedValueRequestedOnly(false);

    // Keep MFP happy
    jsMsg.setGuaranteedValueStartTick(-1);
    jsMsg.setGuaranteedValueCompletedPrefix(-1);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addBestEffortMessage");
  }
401044
public void updateMessageListForHandler(String msgIds, String handlerId) {
        if (msgIds == null) {
            return; // Should never happen, but avoid NPEs
        }

        String[] msgStr = msgIds.split(",");
        ArrayList<String> newMsgList = new ArrayList<String>(Arrays.asList(msgStr));
        newMsgList.remove(""); // Ignore blank value

        // Get the list of existing handlers mapped to this message ID.
        ArrayList<String> prevMsgList = previousHandlerMessageMap.get(handlerId);
        {
            if (prevMsgList == null) {
                prevMsgList = new ArrayList<String>();
            }
        }

        if (prevMsgList.equals(newMsgList)) {
            return; // No change = nothing to do here, skip issuing message
        }

        getMessageRouter(); // Ensure router is not null

        // Check for new messages and add them to the list for the handler
        ArrayList<String> addedMsgs = new ArrayList<String>(newMsgList);
        addedMsgs.removeAll(prevMsgList);

        for (String msgId : addedMsgs) {
            msgRouter.addMsgToLogHandler(msgId, handlerId);
        }

        // Check for removed messages and remove them from the list for the handler
        ArrayList<String> removedMsgs = new ArrayList<String>(prevMsgList);
        removedMsgs.removeAll(newMsgList);

        for (String msgId : removedMsgs) {
            msgRouter.removeMsgFromLogHandler(msgId, handlerId);
        }

        // Save the new map for the next config change
        previousHandlerMessageMap.put(handlerId, newMsgList);

        // Notify that there was a change in this handler's messages
        String setOfIds = "";
        for (String msg : newMsgList) {
            if (!setOfIds.equals("")) {
                setOfIds = setOfIds.concat(" ");
            }
            setOfIds = setOfIds.concat(msg);
        }
        Tr.info(tc, "MSG_ROUTER_UPDATED", new Object[] { handlerId, setOfIds });
    }
1035003
function (message) {
    var that = this;
    that._traceLogEventsCount(TypeMsg$4.OnCreateError);
    that.mc.trigger(TypeMsg$4.OnCreateError, message);
  }
525825
private void renderMsgFromTranslation(
      MsgNode msg, ImmutableList<SoyMsgPart> msgParts, @Nullable ULocale locale) {
    SoyMsgPart firstPart = msgParts.get(0);

    if (firstPart instanceof SoyMsgPluralPart) {
      new PlrselMsgPartsVisitor(msg, locale).visitPart((SoyMsgPluralPart) firstPart);

    } else if (firstPart instanceof SoyMsgSelectPart) {
      new PlrselMsgPartsVisitor(msg, locale).visitPart((SoyMsgSelectPart) firstPart);

    } else {
      for (SoyMsgPart msgPart : msgParts) {

        if (msgPart instanceof SoyMsgRawTextPart) {
          RenderVisitor.append(
              master.getCurrOutputBufForUseByAssistants(),
              ((SoyMsgRawTextPart) msgPart).getRawText());

        } else if (msgPart instanceof SoyMsgPlaceholderPart) {
          String placeholderName = ((SoyMsgPlaceholderPart) msgPart).getPlaceholderName();
          visit(msg.getRepPlaceholderNode(placeholderName));

        } else {
          throw new AssertionError();
        }
      }
    }
  }
1212127
function (message) {
    var that = this;
    that._traceLogEventsCount();
    that.mc.trigger(TypeMsg$2.OnCreateError, message);
  }
199201
protected void addMessage(String message)
    {
        messages.add(message);
        messageCount++;
        if (messageCount > messagesQueueMax)
        {
            messages.remove();
            messageCount--;
        }
    }
1039033
function (errorMessage) {

            var msg = null;

            for (var i = 0; i < errorMessage.length; i++) {
                if (msg === null && errorMessage[i]) {
                    msg = errorMessage[i];
                }
            }

            return msg;
        }
801594
function getExistingMessage(svc, name) {
  var msg = svc.message(name);
  if (!msg) {
    throw new Error(f('unknown message: %s', name));
  }
  return msg;
}
605799
@Override
    public HttpRequestMessage duplicate() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Duplicating the request message: " + this);
        }

        HttpRequestMessageImpl msg = null;
        HttpObjectFactory factory = getObjectFactory();
        if (null == factory) {
            msg = new HttpRequestMessageImpl();
        } else {
            msg = factory.getRequest();
        }
        msg.setIncoming(isIncoming());
        // set the request specifics
        msg.setMethod(this.myMethod);
        msg.setRequestURI(this.myURIBytes);
        msg.setScheme(this.myScheme);
        msg.setQueryString(this.myQueryBytes);
        msg.iUrlPort = this.iUrlPort;
        msg.sUrlHost = this.sUrlHost;
        msg.iHdrPort = this.iHdrPort;
        msg.sHdrHost = this.sHdrHost;

        // set the common object values
        super.duplicate(msg);
        return msg;
    }
1159336
@Override
  public final void onMessageReceived(final Session session, final Object msg) {
    Command command = (Command) msg;
    if (this.statisticsHandler.isStatistics()) {
      if (command.getCopiedMergeCount() > 0 && command instanceof MapReturnValueAware) {
        Map<String, CachedData> returnValues = ((MapReturnValueAware) command).getReturnValues();
        int size = returnValues.size();
        this.statisticsHandler.statistics(CommandType.GET_HIT, size);
        this.statisticsHandler.statistics(CommandType.GET_MISS,
            command.getCopiedMergeCount() - size);
      } else if (command instanceof TextGetOneCommand || command instanceof BinaryGetCommand) {
        if (command.getResult() != null) {
          this.statisticsHandler.statistics(CommandType.GET_HIT);
        } else {
          this.statisticsHandler.statistics(CommandType.GET_MISS);
        }
      } else {
        if (command.getCopiedMergeCount() > 0) {
          this.statisticsHandler.statistics(command.getCommandType(),
              command.getCopiedMergeCount());
        } else
          this.statisticsHandler.statistics(command.getCommandType());
      }
    }
  }
1293947
private JsMessage getTrackedMessage(NodeTraversal t, String msgName) {
    boolean isUnnamedMessage = isUnnamedMessageName(msgName);
    if (!isUnnamedMessage) {
      MessageLocation location = messageNames.get(msgName);
      return location == null ? null : location.message;
    } else {
      Var var = t.getScope().getVar(msgName);
      if (var != null) {
        return unnamedMessages.get(var);
      }
    }
    return null;
  }
1370700
private void checkEglError(String msg) {
        int error;
        if ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) {
            throw new RuntimeException(msg + ": EGL error: 0x" + Integer.toHexString(error));
        }
    }