[jira] Closed: (NANO-59) Property setting through ognl shouldn't use Arrays.asList()
jira-yCVjj/[email protected] Fri, 26 Mar 2004 09:58:31 -0500 (EST)
| Newsgroups | gmane.comp.java.nanocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Message:
The following issue has been closed.
Resolver: Aslak Hellesoy
Date: Fri, 26 Mar 2004 9:58 AM
Fixed. Both arrays and lists are supported now. (First try array, if it fails try list).
---------------------------------------------------------------------
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: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NanoContainer
Components:
nanoweb
Fix Fors:
1.0-beta-1
Assignee: Aslak Hellesoy
Reporter: Miguel A Paraz
Created: Thu, 25 Mar 2004 9:33 PM
Updated: Fri, 26 Mar 2004 9:58 AM
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