Permalink
Browse files

this seems to fix the *warn-on-reflection* error

  • Loading branch information...
1 parent a42f701 commit 066ddca49b5c539276a2360b6602d075d3f751b7 @ztellman ztellman committed with Dec 21, 2009
Showing with 12 additions and 11 deletions.
  1. +12 −11 src/swank/util/io.clj
View
@@ -1,7 +1,7 @@
(ns swank.util.io
(:use [swank util]
[swank.util.concurrent thread])
- (:import [java.io StringWriter Reader]))
+ (:import [java.io StringWriter Reader PrintWriter]))
(defn read-chars
([rdr n] (read-chars rdr n false))
@@ -19,20 +19,21 @@
"Creates a stream that will call a given function when flushed."
([flushf]
(let [closed? (atom false)
- #^StringWriter stream
- (proxy [StringWriter] []
- (close [] (reset! closed? true))
- (flush []
- (let [#^StringWriter me this
- len (.. me getBuffer length)]
- (when (> len 0)
- (flushf (.. me getBuffer (substring 0 len)))
- (.. me getBuffer (delete 0 len))))))]
+ #^PrintWriter stream
+ (PrintWriter.
+ (proxy [StringWriter] []
+ (close [] (reset! closed? true))
+ (flush []
+ (let [#^StringWriter me this
+ len (.. me getBuffer length)]
+ (when (> len 0)
+ (flushf (.. me getBuffer (substring 0 len)))
+ (.. me getBuffer (delete 0 len)))))))]
(dothread
(thread-set-name "Call-on-write Stream")
(continuously
(Thread/sleep 200)
(when-not @closed?
(.flush stream))))
stream))
- {:tag StringWriter})
+ {:tag PrintWriter})

0 comments on commit 066ddca

Please sign in to comment.