aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1335068 - /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
Date Mon, 07 May 2012 15:36:59 GMT
Author: sergeyb
Date: Mon May  7 15:36:58 2012
New Revision: 1335068

URL: http://svn.apache.org/viewvc?rev=1335068&view=rev
Log:
[ARIES-847] Applying a patch on behalf of Christian Schneider

Modified:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java?rev=1335068&r1=1335067&r2=1335068&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BeanRecipe.java
Mon May  7 15:36:58 2012
@@ -843,9 +843,13 @@ public class BeanRecipe extends Abstract
     
     @Override
     public void destroy(Object obj) {
-        //This object should *always* be an UnwrapperedBeanHolder, so cast it and get the
bean out.
-    	obj = ((UnwrapperedBeanHolder)obj).unwrapperedBean;
-    	
+        if (!(obj instanceof UnwrapperedBeanHolder)) {
+            LOGGER.warn("Object to be destroyed is not an instance of UnwrapperedBeanHolder,
type: " + obj);
+            return;
+        }
+    
+        obj = ((UnwrapperedBeanHolder)obj).unwrapperedBean;
+    
         for (BeanProcessor processor : blueprintContainer.getProcessors(BeanProcessor.class))
{
             processor.beforeDestroy(obj, getName());
         }



Mime
View raw message