summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2008-03-30 19:59:50 +0000
committerRich Hickey <richhickey@gmail.com>2008-03-30 19:59:50 +0000
commit3a858f99f9804ce98f6ba57dc5d60e5c893d5298 (patch)
treef3348b094edd023b8d961bec37189e5a7efa2f90
parentc66601446550a1edac179bb1000dfa3bd5325b72 (diff)
proxy - handle interfaces that redeclare Object methods
-rw-r--r--src/proxy.clj7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/proxy.clj b/src/proxy.clj
index d9aceffb..c49cbdf0 100644
--- a/src/proxy.clj
+++ b/src/proxy.clj
@@ -175,9 +175,10 @@
;add methods matching interfaces', if no mapping -> throw
(doseq #^Class iface interfaces
(doseq #^java.lang.reflect.Method meth (. iface (getMethods))
- (gen-method meth
- (fn [gen m]
- (. gen (throwException ex-type (. m (getName)))))))))
+ (when-not (contains? mm [(. meth (getName)) (seq (. meth (getParameterTypes)))])
+ (gen-method meth
+ (fn [gen m]
+ (. gen (throwException ex-type (. m (getName))))))))))
;finish class def
(. cv (visitEnd))