Permalink
Browse files

Changed static method detection.

  • Loading branch information...
1 parent c096e9c commit 61b8bf417682c65a918ec91f4c6b28a582043b36 @Licenser committed May 5, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/net/licenser/sandbox.clj
@@ -26,9 +26,9 @@
(defn dot-maker [obj-tester]
(fn dot [object method & args]
(if (obj-tester object method)
- (try
- (clojure.lang.Reflector/invokeInstanceMethod object method (to-array args))
- (catch Exception _ (clojure.lang.Reflector/invokeStaticMethod object method (to-array args))))
+ (if (= java.lang.Class (class object))
+ (clojure.lang.Reflector/invokeStaticMethod object method (to-array args))
+ (clojure.lang.Reflector/invokeInstanceMethod object method (to-array args)))
(throw (SecurityException. (str "Tried to call: " method " on " object " which is not allowed."))))))
;;;;;;;; Thanks to hiredman's and Chousuke as I get it right for this piece of code.

0 comments on commit 61b8bf4

Please sign in to comment.