code: @SuppressWarnings("unchecked")
      protected UrlMapping lookupMapping(String controller, String action, String namespace, String pluginName, String httpMethod, String version, Map params) {
          final UrlMappingsListKey lookupKey = new UrlMappingsListKey(controller, action, namespace, pluginName, httpMethod, version);
          Collection mappingKeysSet = mappingsListLookup.get(lookupKey);
  
          final String actionName = lookupKey.action;
          boolean secondAttempt = false;
          final boolean isIndexAction = GrailsControllerClass.INDEX_ACTION.equals(actionName);
          if (null == mappingKeysSet) {
              lookupKey.httpMethod=UrlMapping.ANY_HTTP_METHOD;
              mappingKeysSet = mappingsListLookup.get(lookupKey);
          }
          if (null == mappingKeysSet && actionName != null) {
              lookupKey.action=null;
  
              mappingKeysSet = mappingsListLookup.get(lookupKey);
              secondAttempt = true;
          }
          if (null == mappingKeysSet) return null;
  
          Set<String> lookupParams = new HashSet<String>(params.keySet());
          if (secondAttempt) {
              lookupParams.removeAll(DEFAULT_ACTION_PARAMS);
              lookupParams.addAll(DEFAULT_ACTION_PARAMS);
          }
  
          UrlMappingKey[] mappingKeys = (UrlMappingKey[]) mappingKeysSet.toArray(new UrlMappingKey[mappingKeysSet.size()]);
          for (int i = mappingKeys.length; i > 0; i--) {
              UrlMappingKey mappingKey = mappingKeys[i - 1];
              if (lookupParams.containsAll(mappingKey.paramNames)) {
                  final UrlMapping mapping = mappingsLookup.get(mappingKey);
                  if (canInferAction(actionName, secondAttempt, isIndexAction, mapping)) {
                      return mapping;
                  }
                  if (!secondAttempt) {
                      return mapping;
                  }
              }
          }
          return null;
      }
docs: Performs a match uses reverse mappings to looks up a mapping from the
  controller, action and params. This is refactored to use a list of mappings
  identified by only controller and action and then matches the mapping to select
  the mapping that best matches the params (most possible matches).
  
  
  @param controller The controller name
  @param action The action name
  @param httpMethod The HTTP method
  @param version
  @param params The params  @return A UrlMapping instance or null