jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nil...@opensource.lk
Subject [PATCH]"Cannot Register A Null Bean -- Fixed"
Date Tue, 27 Apr 2004 04:46:41 GMT
--- BSFManager.java	2004-04-08 16:50:30.000000000 +0600
+++ BSFManagerModified.java	2004-04-08 16:48:22.000000000 +0600
@@ -686,7 +686,7 @@
      */
     public Object lookupBean(String beanName) {
         try {
-            return objectRegistry.lookup(beanName);
+            return ((BSFDeclaredBean)objectRegistry.lookup(beanName)).bean;
         }
         catch (IllegalArgumentException e) {
             return null;
@@ -701,6 +701,12 @@
      * @param bean     the bean to register
      */
     public void registerBean(String beanName, Object bean) {
+			BSFDeclaredBean tempBean;
+			if(bean == null){
+				tempBean = new BSFDeclaredBean(beanName, null, null);
+			}else {
+				tempBean = new BSFDeclaredBean(beanName, bean, bean.getClass());
+			}
         objectRegistry.register(beanName, bean);
     }



---------------------------------------------------------------------
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