Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed static method detection.

  • Loading branch information...
commit 61b8bf417682c65a918ec91f4c6b28a582043b36 1 parent c096e9c
@Licenser authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/net/licenser/sandbox.clj
View
6 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.
Something went wrong with that request. Please try again.