Skip to content

Commit 4049ad2

Browse files
committed
Fix reflection warnings in manifold.executor
1 parent 7cd82a5 commit 4049ad2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/manifold/executor.clj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
ThreadFactory
1919
TimeUnit]))
2020

21+
(set! *warn-on-reflection* true)
22+
2123
;;;
2224

2325
(def ^ThreadLocal executor-thread-local (ThreadLocal.))
@@ -58,7 +60,7 @@
5860
(.set current-executor-thread-local executor)
5961
(.run ^Runnable runnable)))
6062

61-
(defn- wrap-thread-factory [tf executor-promise]
63+
(defn- wrap-thread-factory [^ThreadFactory tf executor-promise]
6264
(reify ThreadFactory
6365
(newThread [_ runnable]
6466
(.newThread tf (wrap-thread-runnable runnable executor-promise)))))
@@ -75,15 +77,15 @@
7577
| `onto?` | if true, all streams and deferred generated in the scope of this executor will also be 'on' this executor. |"
7678
([executor]
7779
(wrap-executor executor {}))
78-
([executor
80+
([^java.util.concurrent.Executor executor
7981
{:keys [thread-factory
8082
onto?]
8183
:or {onto? true}}]
8284
(if (instance? IExecutorTracking executor)
8385
executor
8486
(let [executor-promise (promise)
8587
wrapped-executor (if thread-factory
86-
(let [executor (executor (wrap-thread-factory thread-factory executor-promise))]
88+
(let [^java.util.concurrent.Executor executor (executor (wrap-thread-factory thread-factory executor-promise))]
8789
(reify java.util.concurrent.Executor
8890
(execute [_ runnable]
8991
(.execute executor runnable))

0 commit comments

Comments
 (0)