You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Daniel Pitts (Created) (JIRA)" <ji...@apache.org> on 2011/11/21 19:44:52 UTC
[jira] [Created] (OGNL-41) OgnlRuntime.getMethod fails to return
correct method in some circumstances.
OgnlRuntime.getMethod fails to return correct method in some circumstances.
---------------------------------------------------------------------------
Key: OGNL-41
URL: https://issues.apache.org/jira/browse/OGNL-41
Project: OGNL
Issue Type: Bug
Reporter: Daniel Pitts
OgnlRuntime.getMethod fails to return correct method in some circumstances, causing the wrong method to be called in "compiled" expressions.
The test case class is "Messages", which has a few "format" methods. When attempting to call message.format("SomeString", one), OgnlRuntime.getMethod returns null, instead of finding "format(String, Object)".
The problem is partially masked by the next call in ASTMethod: "OgnlRuntime.getReadMethod", which returns the "format(String, Object[])" method.
In the unit tests, MethodTest[3] is the one that is wrong. The expected result should be "first", but is instead "foo".
When running MethodTest with compilation turned off, "foo" is return as expected.
It looks like the logic in "getAppropriateMethod" is correct, but currently relies on actual arguments, rather than just argument types. I think it could be refactored and used for both the compiled and uncompiled use cases.
I have no patch at the moment.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OGNL-41) OgnlRuntime.getMethod fails to return
correct method in some circumstances.
Posted by "Daniel Pitts (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OGNL-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Pitts updated OGNL-41:
-----------------------------
Issue Type: Sub-task (was: Bug)
Parent: OGNL-40
> OgnlRuntime.getMethod fails to return correct method in some circumstances.
> ---------------------------------------------------------------------------
>
> Key: OGNL-41
> URL: https://issues.apache.org/jira/browse/OGNL-41
> Project: OGNL
> Issue Type: Sub-task
> Reporter: Daniel Pitts
>
> OgnlRuntime.getMethod fails to return correct method in some circumstances, causing the wrong method to be called in "compiled" expressions.
> The test case class is "Messages", which has a few "format" methods. When attempting to call message.format("SomeString", one), OgnlRuntime.getMethod returns null, instead of finding "format(String, Object)".
> The problem is partially masked by the next call in ASTMethod: "OgnlRuntime.getReadMethod", which returns the "format(String, Object[])" method.
> In the unit tests, MethodTest[3] is the one that is wrong. The expected result should be "first", but is instead "foo".
> When running MethodTest with compilation turned off, "foo" is return as expected.
> It looks like the logic in "getAppropriateMethod" is correct, but currently relies on actual arguments, rather than just argument types. I think it could be refactored and used for both the compiled and uncompiled use cases.
> I have no patch at the moment.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira