Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DXML-9: Eliminate one instance of reflection via a type hint

Signed-off-by: Ryan Senior <senior.ryan@gmail.com>
  • Loading branch information...
commit bc0386515476f6878602133e25d4abaa68a51a0b 1 parent 2e087ce
@jafingerhut jafingerhut authored senior committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/main/clojure/clojure/data/xml.clj
View
6 src/main/clojure/clojure/data/xml.clj
@@ -291,6 +291,10 @@
and xml-input-factory-props for more information. Defaults coalescing true."
[s & {:as props}]
(let [fac (new-xml-input-factory (merge {:coalescing true} props))
+ ;; Reflection on following line cannot be eliminated via a
+ ;; type hint, because s is advertised by fn parse to be an
+ ;; InputStream or Reader, and there are different
+ ;; createXMLStreamReader signatures for each of those types.
sreader (.createXMLStreamReader fac s)]
(pull-seq sreader)))
@@ -344,7 +348,7 @@
(emit e sw)
(.toString sw)))
-(defn indenting-transformer []
+(defn ^javax.xml.transform.Transformer indenting-transformer []
(doto (-> (javax.xml.transform.TransformerFactory/newInstance) .newTransformer)
(.setOutputProperty (javax.xml.transform.OutputKeys/INDENT) "yes")
(.setOutputProperty (javax.xml.transform.OutputKeys/METHOD) "xml")
Please sign in to comment.
Something went wrong with that request. Please try again.