Author: pete.muir(a)jboss.org
Date: 2010-03-04 14:01:22 -0500 (Thu, 04 Mar 2010)
New Revision: 6000
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
Log:
always ignore finalize
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java 2010-03-04
15:10:24 UTC (rev 5999)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java 2010-03-04
19:01:22 UTC (rev 6000)
@@ -49,11 +49,6 @@
public Object invoke(Object self, Method proxiedMethod, Method proceed, Object[] args)
throws Throwable
{
- // Ignore calls to finalize
- if ("finalize".equals(proxiedMethod.getName()))
- {
- return null;
- }
Object instance = callable.call();
if (instance == null)
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java 2010-03-04 15:10:24 UTC
(rev 5999)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java 2010-03-04 19:01:22 UTC
(rev 6000)
@@ -21,6 +21,7 @@
import static org.jboss.weld.util.reflection.Reflections.EMPTY_CLASSES;
import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
@@ -28,6 +29,7 @@
import java.util.LinkedHashSet;
import java.util.Set;
+import javassist.util.proxy.MethodFilter;
import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
@@ -46,6 +48,17 @@
public class Proxies
{
+ private static class IgnoreFinalizeMethodFilter implements MethodFilter
+ {
+
+ public boolean isHandled(Method m)
+ {
+ return m.getName().equals("finalize");
+ }
+
+ }
+
+
public static class TypeInfo
{
@@ -90,6 +103,7 @@
{
ProxyFactory proxyFactory = new ProxyFactory();
ProxyFactory.useCache = false;
+ proxyFactory.setFilter(new IgnoreFinalizeMethodFilter());
Class<?> superClass = getSuperClass();
if(superClass != null && superClass != Object.class)
{
Show replies by date