commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject [beanutils] indexed vs mapped vs simple bug?
Date Wed, 17 Dec 2003 08:31:58 GMT

Is there a known bug in that beanutils hides properties when there are
multiple ways of accessing them? Or is this against the bean spec?

ie) an indexed property, and a simple property that changes the underyling
List:

    public ArrayList getCertifications() {
        return certifications;
    }

    public void setCertifications(ArrayList newCertifications) {
        this.certifications = newCertifications;
    }

    public String getCertifications(int index) {
        return (String)certifications.get(index);
    }

    public void setCertifications(int index, String value) {
        certifications.set(index, value);
    }

It seems that PropertyUtilsBean [getPropertyDescriptor()] will act so that
a mapped value takes precedence over an indexed value over a simple value.
So exceptions are thrown if you try to use beanutils to access the simple
value 'certifications' above.

[Bugzilla took Safari out, so I chose to ask here instead]

Hen


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


Mime
View raw message