Permalink
Browse files

Fixed bug where static methods were not being allowed.

  • Loading branch information...
1 parent 6c1e5dd commit 3b3c17c1c11e8cddbb57137b6c3f546225743078 @Raynes Raynes committed May 5, 2010
Showing with 4 additions and 1 deletion.
  1. +3 −1 src/net/licenser/sandbox.clj
  2. +1 −0 src/net/licenser/sandbox/tester.clj
@@ -26,7 +26,9 @@
(defn dot-maker [obj-tester]
(fn dot [object method & args]
(if (obj-tester object method)
- (clojure.lang.Reflector/invokeInstanceMethod object method (to-array args))
+ (try
+ (clojure.lang.Reflector/invokeInstanceMethod object method (to-array args))
+ (catch Exception _ (clojure.lang.Reflector/invokeStaticMethod 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.
@@ -94,6 +94,7 @@
(run-list not-any? bl c)
(run-list not-any? bl method)
(or
+ (run-list some wl object)
(run-list some wl c)
(run-list some wl method)
false)))))))

0 comments on commit 3b3c17c

Please sign in to comment.