From 0fbf4ff5e8d1ed4ede394c24436b63251e2c8a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Westk=C3=A4mper?= Date: Wed, 7 Jan 2009 10:38:53 +0000 Subject: [PATCH] added checks for method invocations --- .../alias/PropertyAccessInvocationHandler.java | 13 ++----------- .../com/mysema/query/collections/MiniApiTest.java | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/querydsl-collections/src/main/java/com/mysema/query/collections/alias/PropertyAccessInvocationHandler.java b/querydsl-collections/src/main/java/com/mysema/query/collections/alias/PropertyAccessInvocationHandler.java index b2cac68d8..e8d3e5676 100644 --- a/querydsl-collections/src/main/java/com/mysema/query/collections/alias/PropertyAccessInvocationHandler.java +++ b/querydsl-collections/src/main/java/com/mysema/query/collections/alias/PropertyAccessInvocationHandler.java @@ -100,10 +100,6 @@ class PropertyAccessInvocationHandler implements MethodInterceptor{ } aliasFactory.setCurrent(propToExpr.get(ptyName)); - }else if (isEquals(method)){ - rv = methodProxy.invokeSuper(proxy, args); - aliasFactory.setCurrent(((Expr)parent).eq(args[0])); - }else if (isContains(method)){ rv = false; aliasFactory.setCurrent(Grammar.in(args[0], (CollectionType)parent)); @@ -118,7 +114,8 @@ class PropertyAccessInvocationHandler implements MethodInterceptor{ valueType = (Class) args[0]; }else{ - rv = methodProxy.invokeSuper(proxy, args); +// rv = methodProxy.invokeSuper(proxy, args); + throw new IllegalArgumentException("Invocation of " + method.getName() + " not supported"); } return rv; } @@ -134,12 +131,6 @@ class PropertyAccessInvocationHandler implements MethodInterceptor{ && method.getParameterTypes().length == 1 && method.getParameterTypes()[0].equals(int.class); } - - private boolean isEquals(Method method){ - return method.getName().equals("equals") - && method.getReturnType().equals(boolean.class) - && method.getParameterTypes().length == 1; - } private boolean isGetter(Method method){ return method.getParameterTypes().length == 0 diff --git a/querydsl-collections/src/test/java/com/mysema/query/collections/MiniApiTest.java b/querydsl-collections/src/test/java/com/mysema/query/collections/MiniApiTest.java index e60a7bed7..4e2040f6f 100644 --- a/querydsl-collections/src/test/java/com/mysema/query/collections/MiniApiTest.java +++ b/querydsl-collections/src/test/java/com/mysema/query/collections/MiniApiTest.java @@ -154,7 +154,7 @@ public class MiniApiTest { Cat other = new Cat(); from($(c),cats) - .where($(c.equals(other))) + .where($(c).eq(other)) .iterate($(c)).iterator(); }