Author: sanka
Date: Tue Nov  8 08:59:46 2005
New Revision: 331843

URL: http://svn.apache.org/viewcvs?rev=331843&view=rev
Log:
Fixed: BSFManager.undeclareBean(..) undeclares wrong bean when bean to be 
undeclared not found and vector of declared beans is not empty.

Modified:
    jakarta/bsf/trunk/src/org/apache/bsf/BSFManager.java

Modified: jakarta/bsf/trunk/src/org/apache/bsf/BSFManager.java
URL: 
http://svn.apache.org/viewcvs/jakarta/bsf/trunk/src/org/apache/bsf/BSFManager.java?rev=331843&r1=331842&r2=331843&view=diff
==============================================================================
--- jakarta/bsf/trunk/src/org/apache/bsf/BSFManager.java (original)
+++ jakarta/bsf/trunk/src/org/apache/bsf/BSFManager.java Tue Nov  8 08:59:46 
2005
@@ -828,14 +828,16 @@
         unregisterBean(beanName);
 
         BSFDeclaredBean tempBean = null;
+        boolean found = false;
         for (int i = 0; i < declaredBeans.size(); i++) {
             tempBean = (BSFDeclaredBean) declaredBeans.elementAt(i);
             if (tempBean.name.equals(beanName)) {
+               found = true;
                 break;
             }
         }
 
-        if (tempBean != null) {
+        if (found) {
             declaredBeans.removeElement(tempBean);
 
             Enumeration enginesEnum = loadedEngines.elements();



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to