[ 
https://issues.apache.org/jira/browse/OGNL-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lon Varscsak updated OGNL-250:
------------------------------
    Description: 
In OnglRuntime's getMethodValue method it attempts first to get the "get" 
method, if this fails, it trys to getReadMethod, which fails to find a method 
even though there is one matching the propertyName.

I believe that:

{code}
        if ( method == null )
        {
            method = getReadMethod( targetClass, propertyName, 0 );
        }
{code}

Should be:

{code}
        if ( method == null )
        {
            method = getReadMethod( targetClass, propertyName, -1);
        }
{code}

Since the getReadMethod does not return any method if you pass in 0 (the check 
is < 0 or > 0)


  was:
In OnglRuntime's getMethodValue method it attempts first to get the "get" 
method, if this fails, it trys to getReadMethod, which fails to find a method 
even though there is one matching the propertyName.

I believe that:

        if ( method == null )
        {
            method = getReadMethod( targetClass, propertyName, 0 );
        }

Should be:

        if ( method == null )
        {
            method = getReadMethod( targetClass, propertyName, -1);
        }

Since the getReadMethod does not return any method if you pass in 0 (the check 
is < 0 or > 0)



> OnglRuntime getMethodValue fails to find method matching propertyName
> ---------------------------------------------------------------------
>
>                 Key: OGNL-250
>                 URL: https://issues.apache.org/jira/browse/OGNL-250
>             Project: Commons OGNL
>          Issue Type: Bug
>          Components: Core Runtime
>            Reporter: Lon Varscsak
>         Attachments: test.tar.gz
>
>
> In OnglRuntime's getMethodValue method it attempts first to get the "get" 
> method, if this fails, it trys to getReadMethod, which fails to find a method 
> even though there is one matching the propertyName.
> I believe that:
> {code}
>         if ( method == null )
>         {
>             method = getReadMethod( targetClass, propertyName, 0 );
>         }
> {code}
> Should be:
> {code}
>         if ( method == null )
>         {
>             method = getReadMethod( targetClass, propertyName, -1);
>         }
> {code}
> Since the getReadMethod does not return any method if you pass in 0 (the 
> check is < 0 or > 0)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to