Skip to content

Commit

Permalink
Temp fix for non-serializable method filters when ignoring calls to f…
Browse files Browse the repository at this point in the history
…inalize
  • Loading branch information
nickarls committed Mar 4, 2010
1 parent 403354f commit fd1f66e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -93,6 +93,11 @@ public ClientProxyMethodHandler(Bean<?> bean, String id)
*/
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);
Expand Down
6 changes: 4 additions & 2 deletions impl/src/main/java/org/jboss/weld/util/Proxies.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -103,7 +104,8 @@ public ProxyFactory createProxyFactory()
{
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)
{
Expand Down

0 comments on commit fd1f66e

Please sign in to comment.