/*
Tweaked from geronimo-javamail_1.4_spec-1.7.1. ParameterList
966243
protected static Map<String, String> getParameters(String list, Map<String, String> params) throws ParseException {
        HeaderTokenizer tokenizer = new HeaderTokenizer(list);
        while (true) {
            Token token = tokenizer.next();
            switch (token.getType()) {
                case Token.EOF:
                    // the EOF token terminates parsing.
                    return params;

                case ';':
                    // each new parameter is separated by a semicolon, including
                    // the first, which separates
                    // the parameters from the main part of the header.
                    // the next token needs to be a parameter name
                    token = tokenizer.next();
                    // allow a trailing semicolon on the parameters.
                    if (token.getType() == Token.EOF) {
                        return params;
                    }

                    if (token.getType() != Token.ATOM) {
                        throw new ParseException("Invalid parameter name: " + token.getValue());
                    }

                    // get the parameter name as a lower case version for better
                    // mapping.
                    String name = token.getValue().toLowerCase(Locale.ENGLISH);

                    token = tokenizer.next();

                    // parameters are name=value, so we must have the "=" here.
                    if (token.getType() != '=') {
                        throw new ParseException("Missing '='");
                    }

                    // now the value, which may be an atom or a literal
                    token = tokenizer.next();

                    if (token.getType() != Token.ATOM && token.getType() != Token.QUOTEDSTRING) {
                        throw new ParseException("Invalid parameter value: " + token.getValue());
                    }

                    String value = token.getValue();

                    // we might have to do some additional decoding. A name that
                    // ends with "*" is marked as being encoded, so if requested, we
                    // decode the value.
                    if (name.endsWith("*")) {
                        name = name.substring(0, name.length() - 1);
                        value = decodeRFC2231value(value);
                    }
                    params.put(name, value);
                    break;
                default:
                    throw new ParseException("Missing ';'");
            }
        }
    }
953745
private List<Object> reprocessFormParams(Method method, List<Object> origParams, Message m) {
        Form form = null;
        boolean hasFormParamAnnotations = false;
        Object[] newValues = new Object[origParams.size()];
        java.lang.reflect.Parameter[] methodParams = method.getParameters();
        for (int i = 0; i < methodParams.length; i++) {
            if (Form.class.equals(methodParams[i].getType())) {
                form = (Form) origParams.get(i);
            }
            if (methodParams[i].getAnnotation(FormParam.class) != null) {
                hasFormParamAnnotations = true;
            } else {
                newValues[i] = origParams.get(i);
            }
        }

        if (!hasFormParamAnnotations || form == null) {
            return origParams;
        }

        for (int i = 0; i < newValues.length; i++) {
            if (newValues[i] == null) {
                String formFieldName = methodParams[i].getAnnotation(FormParam.class).value();
                List<String> values = form.asMap().get(formFieldName);
                newValues[i] = InjectionUtils.createParameterObject(values, 
                                                                    methodParams[i].getType(),
                                                                    methodParams[i].getParameterizedType(),
                                                                    methodParams[i].getAnnotations(),
                                                                    (String) origParams.get(i),
                                                                    false,
                                                                    ParameterType.FORM,
                                                                    m);
                if (LOG.isLoggable(Level.FINEST)) {
                    LOG.log(Level.FINEST, "replacing @FormParam value of {0} with {1}",
                        new Object[]{origParams.get(i), newValues[i]});
                }
            }
        }
        return Arrays.asList(newValues);
    }
497061
private List getInfoListAllServiceInnerEx(Map requestParamMap,String tableName,Map sortMap,String cusWhere,String cusSelect,String modelName,int limit,List cusPlaceList) throws Exception{
		String tempKeyId=calcuIdKey();

		String sort=(String) sortMap.get("sort");
		String order=(String) sortMap.get("order");
		String cusSort=(String) sortMap.get("cusSort");
		
		if(modelName==null || "".equals(modelName)){
			modelName=tableName;
		}
		
		//add 201807 ning
		//Map requestParamMap=changeCase4Param(requestParamMap0);		
		
		String id=(String) requestParamMap.get(tempKeyId);

		String where="";
		
		if(cusWhere !=null && !"".equals(cusWhere)){
			where="where "+cusWhere;
		}
		
		if(modelName==null || "".equals(modelName)){
			modelName=tableName;
		}
		
		String whereCols="";		
	
		
		Map whereColsMap=requestParamMap;
		if(whereColsMap!=null && !whereColsMap.isEmpty()){
			StringBuilder sb=new StringBuilder("");
			Set<String> keySet=whereColsMap.keySet();
			int i=0;
			for(String key:keySet){
				if(!key.contains(".")){
					continue;
				}
				if(key.contains("dbcol_")){
					continue;
				}
				String colName=key;
				String realColName=colName.replace(".", CheckModelTypeUtil.DUMMY_SPLIT);
				String colsStr=colName+" as "+realColName;
				if(i==0){
					sb.append(colsStr);	
				}else{
					sb.append(",").append(colsStr);
				}
				i++;
			}
			whereCols=sb.toString();
		}		
		
		Map modelEntryMap=getModelEntryMap(requestParamMap,tableName,modelName,dbName,whereCols);
		List placeList=new ArrayList();
		String whereInStr=createWhereInStr(requestParamMap,modelEntryMap,placeList);
		if(cusPlaceList==null){
			cusPlaceList=new ArrayList();
		}
		List realPlaceList=new ArrayList();
		realPlaceList.addAll(placeList);
		realPlaceList.addAll(cusPlaceList);
		if(whereInStr!=null && !"".equals(whereInStr)){
			if(!where.equals("")){
				where=where+" and "+whereInStr;
			}else{
				where="where "+whereInStr;
			}
		}
	
		String select="";
		if(cusSelect!=null && !"".equals(cusSelect)){
			select="select "+cusSelect+" from "+tableName+" "+where;
		}else{
			select="select * from "+tableName+" "+where;
		}
		//String orderSql="order by ";
		String orderSql="";
		if(cusSort!=null && !"".equals(cusSort)){
			orderSql="order by "+cusSort;
		}else if(sort!=null && !sort.equals("")){
			orderSql="order by "+sort+" "+order;
		}
/*		String orderSql="";
		if(sort!=null && !sort.equals("")){
			orderSql="order by "+sort+" "+order;
		}*/
/*		else{
			orderSql=orderSql+"id desc";
		}*/
		List infoList=null;
		String sql=select+" "+orderSql;
		if(limit>=0){

			infoList=getInnerDao().queryLimitObjJoinByCondition(sql,realPlaceList.toArray(),limit);
		}else{
			infoList=getInnerDao().queryObjJoinByCondition(sql,realPlaceList.toArray());			
		}

		

		if(infoList==null){
			return null;
		}
		CheckModelTypeUtil.addMetaCols(infoList);
		//CheckModelTypeUtil.changeDateCols(infoList);
		CheckModelTypeUtil.changeNoStrCols(infoList);
		return infoList;
	}
1339121
int findParameterIndex(String parameterName) throws SQLException {

        checkClosed();

        int index = parameterNameMap.get(parameterName, -1);

        if (index >= 0) {
            return index + 1;
        }

        throw Util.sqlException(ErrorCode.JDBC_COLUMN_NOT_FOUND,
                                parameterName);
    }
807802
static List<String> sanitiseAndSplit(final String param) {
        if (Strings.isNullOrEmpty(param)) return ImmutableList.of();
        // sanitize the user input, only keep letters, digits, and any of a small number of approved params
        final String sanitized = JAVA_LETTER_OR_DIGIT.or(anyOf(".,_-[]")).retainFrom(param);
        return Splitter.on(',').trimResults().omitEmptyStrings().splitToList(sanitized);
    }
16992
public void assertOne(final String paramName,
            final ParameterList parameters) throws ValidationException {

        if (parameters.getParameters(paramName).size() != 1) {
            throw new ValidationException(ASSERT_ONE_MESSAGE, new Object[] {paramName});
        }
    }
254804
private static List<DataUsage> parseDataUsageString(String dataUsageString) throws ParameterException {
		List<String> dataUsageStrings = Arrays.asList(dataUsageString.split("\\s*,\\s*"));
		List<DataUsage> dataUsageList = new ArrayList<>(dataUsageStrings.size());
		for (String d : dataUsageStrings) {
			DataUsage dataUsage = DataUsage.parse(d);
			if (!dataUsageList.contains(dataUsage))
				dataUsageList.add(dataUsage);
		}
		return dataUsageList;
	}
293438
@Override
    public Map<String, Object> getParameters(
            HttpServletRequest request, HttpServletResponse response) {
        final LocaleManager localeManager = this.getLocaleManager(request);

        final List<Locale> locales = localeManager.getLocales();
        if (locales != null && locales.size() > 0 && locales.get(0) != null) {
            final String locale = locales.get(0).toString();
            final String xslLocale = locale.replace('_', '-');
            this.logger.debug("Setting USER_LANG to {}", xslLocale);
            return Collections.singletonMap("USER_LANG", (Object) xslLocale);
        }

        return null;
    }
1165012
function namedParameterList()
    {
        return array( $this->RemoveName  => array( 'offset'            => array( "type"      => "integer",
                                                                                 "required"  => true,
                                                                                 "default"   => false ),
                                                   'length'            => array( "type"      => "integer",
                                                                                 "required"  => false,
                                                                                 "default"   => 1 ) ),
                      $this->RepeatName  => array( 'repeat_times'      => array( "type"      => "integer",
                                                                                 "required"  => false,
                                                                                 "default"   => 1 ) ),
                      $this->InsertName  => array( 'insert_position'   => array( "type"      => "integer",
                                                                                 "required"  => true,
                                                                                 "default"   => false ),
                                                   'insert_string'     => array( "type"      => "string",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ),
                      $this->ExplodeName => array( 'explode_first'     => array( "type"      => "mixed",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ),
                      $this->ExtractName => array( 'extract_start'     => array( "type"      => "integer",
                                                                                 "required"  => true,
                                                                                 "default"   => false ),
                                                   'extract_length'    => array( "type"      => "integer",
                                                                                 "required"  => false,
                                                                                 "default"   => false ) ),
                      $this->ExtractLeftName  => array( 'length'       => array( "type"      => "integer",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ),
                      $this->ExtractRightName => array( 'length'       => array( "type"      => "integer",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ),
                      $this->ReplaceName      => array( 'offset'       => array( "type"      => "integer",
                                                                                 "required"  => true,
                                                                                 "default"   => false),
                                                        'length'       => array( "type"      => "integer",
                                                                                 "required"  => false,
                                                                                 "default"   => false) ),
                      $this->PrependName    => array( 'prepend_string' => array( "type"      => "string",
                                                                                 "required"  => false,
                                                                                 "default"   => false ) ),
                      $this->ContainsName   => array( 'match'          => array( "type"      => "string",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ),
                      $this->BeginsWithName => array( 'match'          => array( "type"      => "string",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ),
                      $this->EndsWithName   => array( 'match'          => array( "type"      => "string",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ),
                      $this->ImplodeName    => array( 'separator'      => array( "type"      => "string",
                                                                                 "required"  => true,
                                                                                 "default"   => false) ),
                      $this->CompareName    => array( 'compare'        => array( "type"      => "mixed",
                                                                                 "required"  => true,
                                                                                 "default"   => false ) ) );
    }
13722
function namedParameterList()
    {
        return array( 'l10n' =>     array( 'type' =>      array( 'type' => 'string',  'required' => true,  'default' => false ),
                                           'locale' =>    array( 'type' => 'string',  'required' => false, 'default' => false ),
                                           'param' =>     array( 'type' => 'string',  'required' => false, 'default' => false ) ),
                      'datetime' => array( 'class' =>     array( 'type' => 'string',  'required' => true,  'default' => false ),
                                           'data' =>      array( 'type' => 'mixed',   'required' => false, 'default' => false ) ),
                      'gettime' =>  array( 'timestamp' => array( 'type' => 'integer', 'required' => false, 'default' => false ) ),
                      'maketime' => array( 'hour' =>      array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'minute' =>    array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'second' =>    array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'month' =>     array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'day' =>       array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'year' =>      array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'dst' =>       array( 'type' => 'integer', 'required' => false, 'default' => false ) ),
                      'makedate' => array( 'month' =>     array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'day' =>       array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'year' =>      array( 'type' => 'integer', 'required' => false, 'default' => false ),
                                           'dst' =>       array( 'type' => 'integer', 'required' => false, 'default' => false ) ) );
    }
584969
private static String[] convertParameters(Class<?>[] params)
   {
      List<String> tmp = new ArrayList<String>();
      for (Class<?> c : params)
      {
         if (c.isArray())
         {
            StringBuffer sb = new StringBuffer();
            Class<?> subType = c.getComponentType();
            sb.append(subType.getName());
            // Convert to type[][]...[]
            while (subType != null)
            {
               sb.append("[]");
               subType = subType.getComponentType();
            }
            tmp.add(sb.toString());
         }
         else
         {
            tmp.add(c.getName());
         }
      }
      String[] sig = new String[tmp.size()];
      tmp.toArray(sig);
      return sig;
   }
1368947
private String getParamJVMSignature(String paramsig) throws SignatureException {
        String paramJVMSig = "";
        String componentType ="";

        if(paramsig != null){

            if(paramsig.contains("[]")) {
                // Gets array dimension.
                int endindex = paramsig.indexOf("[]");
                componentType = paramsig.substring(0, endindex);
                String dimensionString =  paramsig.substring(endindex);
                if(dimensionString != null){
                    while(dimensionString.contains("[]")){
                        paramJVMSig += "[";
                        int beginindex = dimensionString.indexOf("]") + 1;
                        if(beginindex < dimensionString.length()){
                            dimensionString = dimensionString.substring(beginindex);
                        }else
                            dimensionString = "";
                    }
                }
            } else componentType = paramsig;

            paramJVMSig += getComponentType(componentType);
        }
        return paramJVMSig;
    }
151666
@Override
    public Map<String, List<String>> parameters() {
        Map<String, List<String>> result = new HashMap<>();
        for (String key : request.params().names()) {
            result.put(key, request.params().getAll(key));
        }
        return result;
    }
1060734
public static void validateNestedParameterizedType(Type parameterType) {
    if (isParameterized(parameterType)
        || GenericArrayType.class.isAssignableFrom(parameterType.getClass())) {
      throw new IllegalArgumentException(
          "Invalid field. Cannot marshal fields of type Collection<GenericType> or GenericType[].");
    }
  }
496099
public List<String> getFormParameterList(@NotNull final String name) {
        return request.formAttributes().getAll(name);
    }
886463
public ParameterList getQueryStringParams() {
        try {
            final ParameterList result = new ParameterList();
            final String queryString = new URL(url).getQuery();
            result.addQuerystring(queryString);
            result.addAll(querystringParams);
            return result;
        } catch (MalformedURLException mue) {
            throw new OAuthException("Malformed URL", mue);
        }
    }
323749
public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException {
        if (parameters.getParameter(paramName) != null) {
            throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName});
        }
    }