jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37061] New: - BSFManager.undeclareBean undeclares wrong bean
Date Thu, 13 Oct 2005 00:12:23 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=37061>.
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=37061

           Summary: BSFManager.undeclareBean undeclares wrong bean
           Product: BSF
           Version: 2.3.0-rc1
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: framework
        AssignedTo: bsf-dev@jakarta.apache.org
        ReportedBy: tim@adjective.org


For the code (direct from SVN)
---------------------
        BSFDeclaredBean tempBean = null;
        for (int i = 0; i < declaredBeans.size(); i++) {
            tempBean = (BSFDeclaredBean) declaredBeans.elementAt(i);
            if (tempBean.name.equals(beanName)) {
                break;
            }
        }

        if (tempBean != null) {
----------------------
If "declaredBeans" is non-empty, but no bean exists with "beanName", then after
the for loop, "tempBean" will point to the last valid bean in the list, and will
*not* be null. Thus, attempting to undeclare a bean that was never declared,
will actually undeclare an unrelated bean.
The javadoc states: "Quietly returns if the bean is unknown."
Well, I guess it's "quiet", but it's probably not what the author intended :)

-- 
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: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


Mime
View raw message