Method to retrieve (and possibly construct) the MessageMap for a particular
multiChoice code
423646
static public synchronized MessageMap getMessageMap(JSchema sfs, BigInteger code) {
    // This method must be synchronized since some of the work done when constructing
    // a new MessageMap is not thread safe.
    MessageMapTable maps = (MessageMapTable)sfs.getInterpreterCache(JMFRegistry.JMF_ENCODING_VERSION);
    if (maps == null) {
      BigInteger count = ((JSType)sfs.getJMFType()).getMultiChoiceCount();
      maps = new MessageMapTable(count);
      sfs.setInterpreterCache(JMFRegistry.JMF_ENCODING_VERSION, maps);
    }
    MessageMap ans = maps.getMap(code);
    if (ans == null)
      maps.set(ans = new MessageMap(sfs, code));
    return ans;
  }
363050
public List<ValidationMessage<Origin>> getMessages(String messageKey) {

        List<ValidationMessage<Origin>> result = new ArrayList<ValidationMessage<Origin>>();

        for (ValidationResult validationResult : results) {
            for (ValidationMessage<Origin> message : validationResult.getMessages()) {
                if (messageKey.equals(message.getMessageKey())) {
                    result.add(message);
                }
            }
        }
        return result;
    }
871422
def map_exception_codes():
    ''''''
    werkex = inspect.getmembers(exceptions, lambda x: getattr(x, 'code', None))
    return {e.code: e for _, e in werkex}
1018467
def _extract_multimap_field(blob, name):
    ''''''
    message = ('"{}" field must be a map whose values are either a string or '
               'list of strings.'.format(name))
    raw_map = typesafe_pop(blob, name, {}) or {}
    if not isinstance(raw_map, dict):
        raise ParserError(message)
    # We use an `OrderedDict` to ensure that multimap fields are processed in a
    # determinist order. This prevents obscure bugs caused by subtly different
    # behavior.
    multimap = collections.OrderedDict()
    # Sort by key so that processing occurs in convenient lexographical order.
    # This keeps things deterministic in a simple way.
    for key, raw_value in sorted(raw_map.items()):
        value = _optional_list(raw_value)
        if value is None:
            raise ParserError(message)
        multimap[key] = value  # Remembers order.
    return multimap
442470
private Map<String, String> getParameter() {

        Map<String, String> ret = new TreeMap<String, String>();
        for (Component c : m_parameter) {
            if (c instanceof CmsRemovableFormRow<?>) {
                String[] parameterStringArray = ((String)((CmsRemovableFormRow<? extends AbstractField<?>>)c).getInput().getValue()).split(
                    "=");
                ret.put(parameterStringArray[0], parameterStringArray[1]);
            }
        }
        return ret;
    }
1206446
@Override
    public String getMessageSelector() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getMessageSelector");

        String messageSelector = null;

        try {
            messageSelector = messageConsumer.getMessageSelector();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "getMessageSelector", messageSelector);
        }
        return messageSelector;
    }
473470
private String getReplicaMethodDelegationCode(Class<?> clazz, CtMethod ctMethod, String classOrInstanceToDelegateTo)
            throws NotFoundException {
        StringBuilder builder = new StringBuilder();
        builder.append("{java.lang.reflect.Method originalMethod = ");
        builder.append(clazz.getName());
        builder.append(".class.getDeclaredMethod(\"");
        builder.append(ctMethod.getName());
        builder.append("\", ");
        final String parametersAsString = getParametersAsString(getParameterTypes(ctMethod));
        if ("".equals(parametersAsString)) {
            builder.append("null");
        } else {
            builder.append(parametersAsString);
        }
        builder.append(");\n");
        builder.append("originalMethod.setAccessible(true);\n");
        final CtClass returnType = ctMethod.getReturnType();
        final boolean isVoid = returnType.equals(CtClass.voidType);
        if (!isVoid) {
            builder.append("return (");
            builder.append(returnType.getName());
            builder.append(") ");
        }
        builder.append("originalMethod.invoke(");
        if (Modifier.isStatic(ctMethod.getModifiers()) || classOrInstanceToDelegateTo == null) {
            builder.append(clazz.getName());
            builder.append(".class");
        } else {
            builder.append(classOrInstanceToDelegateTo);
        }
        builder.append(", $args);}");
        return builder.toString();
    }
707775
public String getFormattedMessage(String messageKey, Object[] param, String defaultKey) {
		String key = getString(messageKey);
		String retVal = MessageFormat.format(key, param);
		return retVal;
	}
238063
public static String getMapContents(Map m) {
        StringBuffer sb = new StringBuffer(1000);
        Object[] sortedArray = m.keySet().toArray();
        Arrays.sort(sortedArray);

        for (Object element : sortedArray) {
            sb.append(element.toString() + " - " + m.get(element) + System.getProperty("line.separator"));
        }
        return sb.toString();
    }
844931
public function getFormattedChoices()
    {
        $ret    = [];
        $loaded = [];

        // Populate the raw formatted array with just values as values
        foreach (array_keys($this->choices) as $value) {
            $ret[$value] = $value;
        }

        // First start with arbitrarily set choices map
        if ($this->choicesMap) {
            $loaded = array_intersect_key($this->choicesMap, $ret);
        }

        // Execute the user given callback
        if ($this->choicesCallback) {

              $callbackLoaded = call_user_func(
                  $this->choicesCallback,
                  // Exclude already loaded items to leave the choices map
                  // having precedence over the callback
                  array_diff_key($ret, $loaded)
              );

              // We are forced to proceed to a two step merge (using foreach)
              // else array_merge() as well as the + operator would terribly
              // fail merging integer keys
              if ($callbackLoaded) {
                  foreach ($callbackLoaded as $value => $title) {
                      $loaded[$value] = $title;
                  }
              }
        }

        // Append the count for each value
        foreach ($this->choices as $value => $count) {
            $append = ' <span class="badge">' . $count . '</span>';
            if (isset($loaded[$value])) {
                $ret[$value] = $loaded[$value] . $append;
            } elseif(!$this->exclusiveMode) {
                $ret[$value] .= $append;
            }
            else {
                unset($ret[$value]);
            }
        }

        return $ret;
    }
1147015
private String getMessageFromCode(final int messageCode) {
        String res = "";
        switch (messageCode) {
            case 100:
                res = "Initializing";
                break;
            case 200:
                res = "";// Provisioned for custom pre-init task
                break;
            case 300:
                res = "";// Provisioned for custom pre-init task
                break;
            case 400:
                res = "Loading Messages Properties";
                break;
            case 500:
                res = "Loading Parameters Properties";
                break;
            case 600:
                res = "Preparing Core Engine";
                break;
            case 700:
                res = "Preloading Resources";
                break;
            case 800:
                res = "Preloading Modules";
                break;
            case 900:
                res = "";// Provisioned for custom post-init task
                break;
            case 1000:
                res = "Starting";
                break;
            default:
        }
        return res;
    }
419759
function extractPlaceholders(messageBundle) {
	      var messageMap = messageBundle.getMessageMap();
	      var placeholders = {};
	      Object.keys(messageMap).forEach(function (msgId) {
	          placeholders[msgId] = messageMap[msgId].placeholders;
	      });
	      return placeholders;
	  }
622671
private String getMessage(final String[] codes, final Optional<String> defaultMessage) {
        for(String code : codes) {
            try {
                final Optional<String> message = messageResolver.getMessage(code);
                if(message.isPresent()) {
                    return message.get();
                }
                
            } catch(Throwable e) {
                continue;
            }
        }
        
        if(defaultMessage.isPresent()) {
            return defaultMessage.get();
        }
        
        throw new RuntimeException(String.format("not found message code [%s].", Utils.join(codes, ",")));
    }
216100
def MapSizer(field_descriptor, is_message_map):
  """"""

  # Can't look at field_descriptor.message_type._concrete_class because it may
  # not have been initialized yet.
  message_type = field_descriptor.message_type
  message_sizer = MessageSizer(field_descriptor.number, False, False)

  def FieldSize(map_value):
    total = 0
    for key in map_value:
      value = map_value[key]
      # It's wasteful to create the messages and throw them away one second
      # later since we'll do the same for the actual encode.  But there's not an
      # obvious way to avoid this within the current design without tons of code
      # duplication. For message map, value.ByteSize() should be called to
      # update the status.
      entry_msg = message_type._concrete_class(key=key, value=value)
      total += message_sizer(entry_msg)
      if is_message_map:
        value.ByteSize()
    return total

  return FieldSize
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;
  }
526353
protected MultiValueMap<String, Object> buildResponseEntityErrorModel(final HttpStatus code, final String message) {
        return CollectionUtils.asMultiValueMap("code",
            code.value(),
            "message", message);
    }
669064
def reverse_code_map(self):
        """"""

        return {c.value: (c.ikey if c.ikey else c.key) for c in self.codes}