Permalink
Browse files

Remove reflection warnings in def, log, and stat.

  • Loading branch information...
technomancy committed Feb 2, 2012
1 parent 5f10ca0 commit 486f9845257d4ae1e4f31f99c5871a76b18d50d8
Showing with 11 additions and 6 deletions.
  1. +2 −0 .gitignore
  2. +1 −0 project.clj
  3. +2 −1 src/pulse/def.clj
  4. +1 −1 src/pulse/log.clj
  5. +5 −4 src/pulse/stat.clj
View
@@ -3,3 +3,5 @@
lib
*.xml
*.jar
+classes
+.lein-deps-sum
View
@@ -4,6 +4,7 @@
[clj-redis "0.0.8"]
[clj-json "0.3.1"]
[hiccup "0.3.6"]
+ ;; TODO: update ring
[ring-basic-auth "0.1.0"]
[ring/ring-devel "0.3.10"]
[ring/ring-jetty-adapter "0.3.10"]])
View
@@ -242,7 +242,8 @@
(contains? evt k))
(defn cont? [evt k v]
- (.contains (or (k evt) "") v))
+ (let [^String s (or (k evt) "")]
+ (.contains s v)))
(defn >? [evt k v]
(> (k evt) v))
View
@@ -21,7 +21,7 @@
(cond
(re-match? #"^[a-zA-Z0-9\:\.\-\_]+$" v)
v
- (neg? (.indexOf v "\""))
+ (neg? (.indexOf ^String v "\""))
(str "\"" v "\"")
:else
(str "'" v "'"))
View
@@ -11,25 +11,26 @@
(defn receive-init [{init-fn :receive-init}]
(AtomicReference. (init-fn)))
-(defn receive-apply [{apply-fn :receive-apply} stat-state event]
+(defn receive-apply [{apply-fn :receive-apply} ^AtomicReference stat-state event]
(locking stat-state
(let [current (.get stat-state)
applied (apply-fn current event)]
(.compareAndSet stat-state current applied))))
-(defn receive-emit [{init-fn :receive-init emit-fn :receive-emit} stat-state]
+(defn receive-emit [{init-fn :receive-init emit-fn :receive-emit}
+ ^AtomicReference stat-state]
(emit-fn (.getAndSet stat-state (init-fn))))
(defn merge-init [{init-fn :merge-init}]
(AtomicReference. (init-fn)))
-(defn merge-apply [{apply-fn :merge-apply} stat-state pub]
+(defn merge-apply [{apply-fn :merge-apply} ^AtomicReference stat-state pub]
(locking stat-state
(let [current (.get stat-state)
applied (apply-fn current pub)]
(.compareAndSet stat-state current applied))))
-(defn merge-emit [{emit-fn :merge-emit} stat-state]
+(defn merge-emit [{emit-fn :merge-emit} ^AtomicReference stat-state]
(locking stat-state
(let [current (.get stat-state)
[applied pub] (emit-fn current)]

0 comments on commit 486f984

Please sign in to comment.