[jira] Created: (NANO-59) Property setting through ognl shouldn't use Arrays.asList()

jira-yCVjj/[email protected] Thu, 25 Mar 2004 21:33:31 -0500 (EST)
Newsgroups gmane.comp.java.nanocontainer.devel
Message-ID <[email protected]>
Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/secure/ViewIssue.jspa?key=NANO-59

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: NANO-59
    Summary: Property setting through ognl shouldn't use Arrays.asList()
       Type: Bug

     Status: Unassigned
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: NanoContainer
 Components: 
             nanoweb

   Assignee: 
   Reporter: Miguel A Paraz

    Created: Thu, 25 Mar 2004 9:33 PM
    Updated: Thu, 25 Mar 2004 9:33 PM
Environment: Tomcat 5.0.19, ognl 2.5.1

Description:
A HttpServletRequest has the URI keywords as keys, and String[] as values. I don't understand the intention of setPropertiesWithOgnl():

            Object value = parameterMap.get(parameterKey);
            if (value instanceof String[]) {
                value = Arrays.asList((String[]) value);
            }
            try {
                Ognl.setValue(parameterKey, action, value);
            } catch (OgnlException e) {
                e.printStackTrace();
                throw new ServletException(e);
            }

Why convert to Arrays.asList()? I did a test with Ognl standalone. It can match String[] as input, for a String[] property. With the current code, it will yield:

java.lang.NoSuchMethodException: setNumber(java.util.Arrays$ArrayList)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:551)
...

Where it doesn't match the internal ArrayList used by Arrays.asList().





---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira