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=40282>.
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=40282

           Summary: Boolean bean property not found due to Introspector
                    limitation
           Product: Tomcat 5
           Version: 5.5.17
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


There is a bug in the java.beans.Introspector which means that it cannot find
the read method for a property of Boolean type (because it looks for the "get"
prefix, not the "is" prefix). This is arguably the expected behaviour of the
Introspector, however since the java.beans.PropertyDescriptor acts differently
(it can identify the property read method), this inconsistency hints it's a bug.
Also, with the advent of autoboxing, developers are supposed to be able to free
themselves from primitive types.

The commons EL library is affected by this bug, so using an interface like: -

public interface Bean {
    Boolean isEnabled();
}

and an expression like: -
${bean.enabled}

fails with an ELException saying that the property could not be found (see
attached log snippet).

WebLogic does not suffer from this problem, presumably because they implement
their own EL parser (don't use commons.el) which doesn't use the Introspector. I
have written a suggested workaround for this problem which would allow the
commons.el library to continue its use of the Introspector, but deal with this
flaw (see attached). The AdditionalIntrospection could be used in the
BeanInfoManager.initialise() method, like so: -

PropertyDescriptor [] pds = mBeanInfo.getPropertyDescriptors ();
pds = AdditionalIntrospection.findMissingMethods(mBeanClass, pds); // new step

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to