You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Marcelo Liberato (JIRA)" <ji...@apache.org> on 2007/03/30 23:05:25 UTC

[jira] Created: (BEANUTILS-273) Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils

Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils
-----------------------------------------------------------------------------------------------

                 Key: BEANUTILS-273
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-273
             Project: Commons BeanUtils
          Issue Type: Bug
          Components: Bean / Property Utils
            Reporter: Marcelo Liberato
             Fix For: 1.8.0


When you do something like:

    	TestBean anonymous = new TestBean() {
			public String getStringProperty() {
				return "foo";
			}
    	};
    	PropertyUtils.getProperty(anonymous, "stringProperty");

PropertyUtils fails as:

java.lang.NoSuchMethodException: Property 'stringProperty' has no getter method in class 'class org.apache.commons.beanutils.PropertyUtilsTestCase$1'



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (BEANUTILS-273) Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils

Posted by "Marcelo Liberato (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcelo Liberato updated BEANUTILS-273:
---------------------------------------

        Fix Version/s:     (was: 1.8.0)
    Affects Version/s: 1.7.0

updating affects/fix versions

> Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils
> -----------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-273
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-273
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>            Reporter: Marcelo Liberato
>         Attachments: anonymous-subclass-override-patch.txt
>
>
> When you do something like:
>     	TestBean anonymous = new TestBean() {
> 			public String getStringProperty() {
> 				return "foo";
> 			}
>     	};
>     	PropertyUtils.getProperty(anonymous, "stringProperty");
> PropertyUtils fails as:
> java.lang.NoSuchMethodException: Property 'stringProperty' has no getter method in class 'class org.apache.commons.beanutils.PropertyUtilsTestCase$1'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (BEANUTILS-273) Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated BEANUTILS-273:
--------------------------------------

    Fix Version/s: 1.8.0

> Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils
> -----------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-273
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-273
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>            Reporter: Marcelo Liberato
>             Fix For: 1.8.0
>
>         Attachments: anonymous-subclass-override-patch.txt
>
>
> When you do something like:
>     	TestBean anonymous = new TestBean() {
> 			public String getStringProperty() {
> 				return "foo";
> 			}
>     	};
>     	PropertyUtils.getProperty(anonymous, "stringProperty");
> PropertyUtils fails as:
> java.lang.NoSuchMethodException: Property 'stringProperty' has no getter method in class 'class org.apache.commons.beanutils.PropertyUtilsTestCase$1'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Updated: (BEANUTILS-273) Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils

Posted by "Marcelo Liberato (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcelo Liberato updated BEANUTILS-273:
---------------------------------------

    Attachment: anonymous-subclass-override-patch.txt

The proposed patch adjust MethodUtils.getAccessibleMethodFromInterfaceNest to check for implementation method on superclass chain, besides interfaces from superclass chain.

Some code refactored out on this method too.

> Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils
> -----------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-273
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-273
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>            Reporter: Marcelo Liberato
>             Fix For: 1.8.0
>
>         Attachments: anonymous-subclass-override-patch.txt
>
>
> When you do something like:
>     	TestBean anonymous = new TestBean() {
> 			public String getStringProperty() {
> 				return "foo";
> 			}
>     	};
>     	PropertyUtils.getProperty(anonymous, "stringProperty");
> PropertyUtils fails as:
> java.lang.NoSuchMethodException: Property 'stringProperty' has no getter method in class 'class org.apache.commons.beanutils.PropertyUtilsTestCase$1'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (BEANUTILS-273) Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved BEANUTILS-273.
---------------------------------------

    Resolution: Fixed
      Assignee: Niall Pemberton

Thanks for taking the time to provide a patch and test case - although I decided to use a slightly different approach - leave the interface checking alone and provide and additional check through the parent class hierarchy if all else failed.

> Public methods overriden in anonymous or private subclasses are not recognized by PropertyUtils
> -----------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-273
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-273
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>            Reporter: Marcelo Liberato
>            Assignee: Niall Pemberton
>             Fix For: 1.8.0
>
>         Attachments: anonymous-subclass-override-patch.txt
>
>
> When you do something like:
>     	TestBean anonymous = new TestBean() {
> 			public String getStringProperty() {
> 				return "foo";
> 			}
>     	};
>     	PropertyUtils.getProperty(anonymous, "stringProperty");
> PropertyUtils fails as:
> java.lang.NoSuchMethodException: Property 'stringProperty' has no getter method in class 'class org.apache.commons.beanutils.PropertyUtilsTestCase$1'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org