Author: nickarls
Date: 2010-03-04 15:57:38 -0500 (Thu, 04 Mar 2010)
New Revision: 6001
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
Log:
Temp fix for non-serializable method filters when ignoring calls to finalize
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2010-03-04
19:01:22 UTC (rev 6000)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2010-03-04
20:57:38 UTC (rev 6001)
@@ -93,6 +93,11 @@
*/
public Object invoke(Object self, Method proxiedMethod, Method proceed, Object[] args)
throws Throwable
{
+ // FIXME: Temporary fix until we have serializable method filters
+ if (proxiedMethod.getName().equals("finalize"))
+ {
+ return null;
+ }
if (bean == null)
{
bean =
Container.instance().services().get(ContextualStore.class).<Bean<Object>,
Object>getContextual(id);
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 19:01:22 UTC
(rev 6000)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java 2010-03-04 20:57:38 UTC
(rev 6001)
@@ -20,6 +20,7 @@
import static org.jboss.weld.logging.messages.UtilMessage.INSTANCE_NOT_A_PROXY;
import static org.jboss.weld.util.reflection.Reflections.EMPTY_CLASSES;
+import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -48,7 +49,7 @@
public class Proxies
{
- private static class IgnoreFinalizeMethodFilter implements MethodFilter
+ private static class IgnoreFinalizeMethodFilter implements MethodFilter, Serializable
{
public boolean isHandled(Method m)
@@ -103,7 +104,8 @@
{
ProxyFactory proxyFactory = new ProxyFactory();
ProxyFactory.useCache = false;
- proxyFactory.setFilter(new IgnoreFinalizeMethodFilter());
+// FIXME: Check for calls to "finalize" in ClientProxyMethodHandler until
serialization stuff is sorted out
+// proxyFactory.setFilter(new IgnoreFinalizeMethodFilter());
Class<?> superClass = getSuperClass();
if(superClass != null && superClass != Object.class)
{
Show replies by date