String[] paramValues = (String[]) parameters.get(paramName); this.addParameter(paramName, paramValues);
Object o = parameters.get(paramName); if (o instanceof String[]) { String[] paramValues = (String[]) o; this.addParameter(paramName, paramValues); } else { if (logger.isWarnEnabled()) { logger.warn("ServletRequest.getParameterMap() returned non-String array"); } }
    public SavedRequest(HttpServletRequest request, PortResolver portResolver) {        Assert.notNull(request, "Request required");        Assert.notNull(portResolver, "PortResolver required");        // Cookies        Cookie[] cookies = request.getCookies();        if (cookies != null) {            for (int i = 0; i < cookies.length; i++) {                this.addCookie(cookies[i]);            }        }        // Headers        Enumeration names = request.getHeaderNames();        while (names.hasMoreElements()) {            String name = (String) names.nextElement();            Enumeration values = request.getHeaders(name);            while (values.hasMoreElements()) {                String value = (String) values.nextElement();                this.addHeader(name, value);            }        }        // Locales        Enumeration locales = request.getLocales();        while (locales.hasMoreElements()) {            Locale locale = (Locale) locales.nextElement();            this.addLocale(locale);        }        // Parameters        Map parameters = request.getParameterMap();        Iterator paramNames = parameters.keySet().iterator();        while (paramNames.hasNext()) {            String paramName = (String) paramNames.next();            String[] paramValues = (String[]) parameters.get(paramName);            this.addParameter(paramName, paramValues);        }        // Primitives        this.method = request.getMethod();        this.pathInfo = request.getPathInfo();        this.queryString = request.getQueryString();        this.requestURI = request.getRequestURI();        this.serverPort = portResolver.getServerPort(request);        this.requestURL = request.getRequestURL().toString();        this.scheme = request.getScheme();        this.serverName = request.getServerName();        this.contextPath = request.getContextPath();        this.servletPath = request.getServletPath();    }