openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1176080 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: component/AbstractOwbBean.java intercept/NormalScopedBeanInterceptorHandler.java
Date Mon, 26 Sep 2011 21:54:58 GMT
Author: struberg
Date: Mon Sep 26 21:54:58 2011
New Revision: 1176080

URL: http://svn.apache.org/viewvc?rev=1176080&view=rev
Log:
OWB-618 only invoke instance disposal if instance != null

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java?rev=1176080&r1=1176079&r2=1176080&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractOwbBean.java
Mon Sep 26 21:54:58 2011
@@ -229,7 +229,6 @@ public abstract class AbstractOwbBean<T>
     /**
      * {@inheritDoc}
      */
-    @Override
     public T createNewInstance(CreationalContext<T> creationalContext)
     {
         return createInstance(creationalContext);
@@ -246,8 +245,13 @@ public abstract class AbstractOwbBean<T>
             InjectionTargetWrapper<T> wrapper = getManager().getInjectionTargetWrapper(this);
             if(wrapper != null)
             {
-                wrapper.preDestroy(instance);
-                wrapper.dispose(instance);
+                // instance might be null if we only created a proxy
+                // but no actual contextual instance for this bean!
+                if (instance != null)
+                {
+                    wrapper.preDestroy(instance);
+                    wrapper.dispose(instance);
+                }
             }
             else
             {
@@ -279,7 +283,6 @@ public abstract class AbstractOwbBean<T>
     /**
      * {@inheritDoc}
      */
-    @Override
     public void destroyCreatedInstance(T instance, CreationalContext<T> creationalContext)
     {
         destroyInstance(instance, creationalContext);
@@ -454,7 +457,6 @@ public abstract class AbstractOwbBean<T>
      * (non-Javadoc)
      * @see javax.webbeans.manager.Bean#getQualifiers()
      */
-    @Override
     public Set<Annotation> getQualifiers()
     {
         return this.implQualifiers;
@@ -464,7 +466,6 @@ public abstract class AbstractOwbBean<T>
      * (non-Javadoc)
      * @see javax.webbeans.manager.Bean#getScope()
      */
-    @Override
     public Class<? extends Annotation> getScope()
     {
         return this.scopeClass;
@@ -489,7 +490,6 @@ public abstract class AbstractOwbBean<T>
     /**
      * {@inheritDoc}
      */
-    @Override
     public void setNullable(boolean nullable)
     {
         this.nullable = nullable;
@@ -499,7 +499,6 @@ public abstract class AbstractOwbBean<T>
     /**
      * {@inheritDoc}
      */
-    @Override
     public void setSerializable(boolean serializable)
     {
         this.serializable = serializable;
@@ -509,7 +508,6 @@ public abstract class AbstractOwbBean<T>
     /**
      * {@inheritDoc}
      */
-    @Override
     public boolean isNullable()
     {
         return this.nullable;
@@ -518,7 +516,6 @@ public abstract class AbstractOwbBean<T>
     /**
      * {@inheritDoc}
      */
-    @Override
     public boolean isSerializable()
     {
         return this.serializable;
@@ -690,13 +687,11 @@ public abstract class AbstractOwbBean<T>
         return logger;
     }
 
-    @Override
-    public boolean isDependent() 
+    public boolean isDependent()
     {
         return getScope().equals(Dependent.class);
     }
     
-    @Override
     public void validatePassivationDependencies()
     {
         if(isPassivationCapable() || (this instanceof AbstractProducerBean))

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java?rev=1176080&r1=1176079&r2=1176080&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
Mon Sep 26 21:54:58 2011
@@ -103,7 +103,6 @@ public class NormalScopedBeanInterceptor
     /**
      * {@inheritDoc}
      */
-    @Override
     public Object invoke(Object instance, Method method, Method proceed, Object[] arguments)
throws Exception
     {
         if (method.getName() == FINALIZE &&   // Method.getName() is defined to return
.intern() in the VM spec.



Mime
View raw message