commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36985] - [beanutils] PropertyUtils.getProperty depends on jdk version
Date Sun, 16 Oct 2005 00:10:01 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36985>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36985


niallp@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




------- Additional Comments From niallp@apache.org  2005-10-16 02:10 -------
The problem here is that you are trying to mix and match indexed and non-
indexed properties and are therefore "breaking the rules" as far as the java 
beans specification is concerned. The specifcation defines the method 
signatures for indexed properties as:

    public Foo getFoo(int index)
    public Foo[] getFoo()
    public void setFoo(int index, Foo foo)
    public void setFoo(Foo[] foos)

See section 7.2 on Indexed Properties

    http://java.sun.com/products/javabeans/docs/spec.html

Having said that, earlier java versions didn't check that the types on the 
simple getter/setter methods were consistent with the indexed methods. Sun 
tightened the rules on indexed properties between versions of the JDK, although 
I thought this change happened from 1.3 to 1.4 and was fixed under the 
following bug:

    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4619536

I applied a change to PropertyUtilsBean so that it caters for simple 
getter/setter methods that set/return a java.util.List type (see Bug 28358) so 
that BeanUtils is compatbile accross JDK versions for people who used List's 
rather than arrays for their indexed properties - but that doesn't help you.

I think your choice is to either change your method names so that they conform 
to the property naming convention or, as suggested in the above sun bug 
(4619536), use a BeanInfo class for your bean that creates an 
IndexedPropertyDescriptor with the appropriate methods.

The only thing I find confusing about this, is the fact that you say it works 
in JDK 1.4 and not in JDK 1.5 - however the problem is not a BeanUtils issue 
and therefore I'm closing this.



*** This bug has been marked as a duplicate of 28358 ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message