Skip to content

Commit

Permalink
fix to issue #8 - java lambda is now taking java.util.Map as a parame…
Browse files Browse the repository at this point in the history
…ter, not clojure.lang.PersistentArrayMap
  • Loading branch information
mikub committed Jul 18, 2020
1 parent 2c21bf7 commit 5d55e40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/clj/titanoboa/exp.clj
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
*properties* properties] ;;TODO bind *job* and *properties* based on some test data
(try (if (= "java" type)
(-> java-lambda-factory
(.createLambdaUnchecked s (DynamicTypeReference. "Function< clojure.lang.PersistentArrayMap, java.util.Map>"))
(.createLambdaUnchecked s (DynamicTypeReference. "Function< java.util.Map, java.util.Map>"))
(.apply (eval-properties properties {})))
(load-string s))
(catch Exception e
Expand All @@ -119,7 +119,7 @@
([expr arg1]
(cond (java-expression? expr) (do (when-not (string? (:value expr)) (throw (java.lang.IllegalStateException. "Value of java lambda expression must be String!")))
(-> java-lambda-factory
(.createLambdaUnchecked (:value expr) (DynamicTypeReference. "Function< clojure.lang.PersistentArrayMap, java.util.Map>"))
(.createLambdaUnchecked (:value expr) (DynamicTypeReference. "Function< java.util.Map, java.util.Map>"))
(.apply arg1)))
:else (-> expr
eval-exfn
Expand All @@ -128,7 +128,7 @@
([expr arg1 arg2]
(cond (java-expression? expr) (do (when-not (string? (:value expr)) (throw (java.lang.IllegalStateException. "Value of java lambda expression must be String!")))
(-> java-lambda-factory
(.createLambdaUnchecked (:value expr) (DynamicTypeReference. "Function< clojure.lang.PersistentArrayMap, java.util.Map>"))
(.createLambdaUnchecked (:value expr) (DynamicTypeReference. "Function< java.util.Map, java.util.Map>"))
(.apply arg1 arg2)))
:else (-> expr
eval-exfn
Expand Down

0 comments on commit 5d55e40

Please sign in to comment.