Skip to content

Commit

Permalink
TRDR-72 Added type hint to suppress reflection warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrodCTaylor authored and Bronsa committed Mar 12, 2024
1 parent 2930acf commit 2af4505
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/clojure/clojure/tools/reader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
java.util.regex.Pattern
(java.util List LinkedList)))

(set! *warn-on-reflection* true)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; helpers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -1022,12 +1024,12 @@
([] (read+string (source-logging-push-back-reader *in*)))
([stream] (read+string stream true nil))
([^SourceLoggingPushbackReader stream eof-error? eof-value]
(let [^StringBuilder buf (doto (:buffer @(.source-log-frames stream)) (.setLength 0))
(let [^StringBuilder buf (doto ^StringBuilder (:buffer @(.source-log-frames stream)) (.setLength 0))
o (log-source stream (read stream eof-error? eof-value))
s (.trim (str buf))]
[o s]))
([opts ^SourceLoggingPushbackReader stream]
(let [^StringBuilder buf (doto (:buffer @(.source-log-frames stream)) (.setLength 0))
(let [^StringBuilder buf (doto ^StringBuilder (:buffer @(.source-log-frames stream)) (.setLength 0))
o (log-source stream (read opts stream))
s (.trim (str buf))]
[o s])))

0 comments on commit 2af4505

Please sign in to comment.