openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yingw...@apache.org
Subject svn commit: r939780 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
Date Fri, 30 Apr 2010 18:57:12 GMT
Author: yingwang
Date: Fri Apr 30 18:57:12 2010
New Revision: 939780

URL: http://svn.apache.org/viewvc?rev=939780&view=rev
Log:
[OWB-366] one correction, we could not delegate the finalize() call to the bean from the proxied
obj, since the JVM will invoke bean.finalize() directly.

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

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=939780&r1=939779&r2=939780&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
Fri Apr 30 18:57:12 2010
@@ -71,6 +71,16 @@ public class NormalScopedBeanInterceptor
     @Override
     public Object invoke(Object instance, Method method, Method proceed, Object[] arguments)
throws Exception
     {
+        if (method.getName().equals("finalize") &&
+            method.getParameterTypes().length == 0
+        	&& method.getReturnType().equals(Void.TYPE)) 
+        {
+        	// we should NOT invoke the bean's finalize() from proxied 
+        	// finalize() method since JVM will invoke it directly. 
+        	// OWB-366
+        	return null;
+        }
+
         //Get instance from context
         Object webbeansInstance = getContextualInstance();
         



Mime
View raw message