Skip to content
Browse files

Eliminate all but one warning in clj-time.format

Not sure how to go about type-hiting array of objects
  • Loading branch information...
1 parent 525dd67 commit a03140db3049133f80b386d8f451399da5f64a0e @michaelklishin michaelklishin committed Apr 19, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/clj_time/format.clj
View
12 src/clj_time/format.clj
@@ -30,7 +30,7 @@
(:use clj-time.core)
(:import (java.util Locale)
(org.joda.time Chronology DateTime DateTimeZone)
- (org.joda.time.format DateTimeFormat DateTimeFormatter
+ (org.joda.time.format DateTimeFormat DateTimeFormatter DateTimePrinter
DateTimeFormatterBuilder DateTimeParser
ISODateTimeFormat)))
@@ -44,10 +44,10 @@
([#^String fmts #^DateTimeZone dtz]
(.withZone (DateTimeFormat/forPattern fmts) dtz))
([#^DateTimeZone dtz fmts & more]
- (let [printer (.getPrinter (formatter fmts dtz))
- parsers (map #(.getParser (formatter % dtz)) (cons fmts more))]
+ (let [printer (.getPrinter #^DateTimeFormatter (formatter fmts dtz))
+ parsers (map #(.getParser #^DateTimeFormatter (formatter % dtz)) (cons fmts more))]
(-> (DateTimeFormatterBuilder.)
- (.append printer (into-array DateTimeParser parsers))
+ #^DateTimeFormatterBuilder (.append #^DateTimePrinter printer (into-array DateTimeParser parsers))
(.toFormatter)))))
(defn with-chronology
@@ -144,8 +144,8 @@
([#^String s]
(first
(for [f (vals formatters)
- :let [d (try (parse f s) (catch Exception _ nil))]
- :when d] d))))
+ :let [d (try (parse f s) (catch Exception _ nil))]
+ :when d] d))))
(defn unparse
"Returns a string representing the given DateTime instance in UTC and in the

0 comments on commit a03140d

Please sign in to comment.
Something went wrong with that request. Please try again.