diff --git a/build.xml b/build.xml index 84aab9f505..482e9724cd 100644 --- a/build.xml +++ b/build.xml @@ -88,6 +88,7 @@ classpath="${build}:${cljsrc}" failonerror="true"> + diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index b87286eb4b..8e716cf475 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -357,12 +357,14 @@ (defn symbol "Returns a Symbol with the given namespace and name." + {:tag clojure.lang.Symbol} ([name] (if (symbol? name) name (clojure.lang.Symbol/intern name))) ([ns name] (clojure.lang.Symbol/intern ns name))) (defn keyword "Returns a Keyword with the given namespace and name. Do not use : in the keyword strings, it will be added automatically." + {:tag clojure.lang.Keyword} ([name] (if (keyword? name) name (clojure.lang.Keyword/intern name))) ([ns name] (clojure.lang.Keyword/intern ns name))) @@ -2976,7 +2978,7 @@ (conj (pop groups) (conj (peek groups) [k v])) (conj groups [k v]))) [] (partition 2 seq-exprs))) - err (fn [& msg] (throw (IllegalArgumentException. (apply str msg)))) + err (fn [& msg] (throw (IllegalArgumentException. #^String (apply str msg)))) emit-bind (fn emit-bind [[[bind expr & mod-pairs] & [[_ next-expr] :as next-groups]]] (let [giter (gensym "iter__") @@ -3768,7 +3770,7 @@ (defmacro with-loading-context [& body] `((fn loading# [] (. clojure.lang.Var (pushThreadBindings {clojure.lang.Compiler/LOADER - (-> loading# .getClass .getClassLoader)})) + (.getClassLoader (.getClass #^Object loading#))})) (try ~@body (finally @@ -4443,9 +4445,9 @@ "clojure/version.properties") properties (doto (new java.util.Properties) (.load version-stream)) prop (fn [k] (.getProperty properties (str "clojure.version." k))) - clojure-version {:major (Integer/valueOf (prop "major")) - :minor (Integer/valueOf (prop "minor")) - :incremental (Integer/valueOf (prop "incremental")) + clojure-version {:major (Integer/valueOf #^String (prop "major")) + :minor (Integer/valueOf #^String (prop "minor")) + :incremental (Integer/valueOf #^String (prop "incremental")) :qualifier (prop "qualifier")}] (def *clojure-version* (if (not (= (prop "interim") "false")) diff --git a/src/clj/clojure/core_proxy.clj b/src/clj/clojure/core_proxy.clj index 7653deabbb..c24b69d579 100644 --- a/src/clj/clojure/core_proxy.clj +++ b/src/clj/clojure/core_proxy.clj @@ -258,7 +258,7 @@ pname (proxy-name super interfaces)] (or (RT/loadClassForName pname) (let [[cname bytecode] (generate-proxy super interfaces)] - (. (deref clojure.lang.Compiler/LOADER) (defineClass pname bytecode)))))) + (. #^DynamicClassLoader (deref clojure.lang.Compiler/LOADER) (defineClass pname bytecode)))))) (defn construct-proxy "Takes a proxy class and any arguments for its superclass ctor and diff --git a/src/clj/clojure/main.clj b/src/clj/clojure/main.clj index 58fa0a3f08..633c21e93f 100644 --- a/src/clj/clojure/main.clj +++ b/src/clj/clojure/main.clj @@ -93,7 +93,7 @@ (defn- root-cause "Returns the initial cause of an exception or error by peeling off all of its wrappers" - [throwable] + [#^Throwable throwable] (loop [cause throwable] (if-let [cause (.getCause cause)] (recur cause) @@ -161,7 +161,7 @@ (let [{:keys [init need-prompt prompt flush read eval print caught] :or {init #() need-prompt (if (instance? LineNumberingPushbackReader *in*) - #(.atLineStart *in*) + #(.atLineStart #^LineNumberingPushbackReader *in*) #(identity true)) prompt repl-prompt flush flush @@ -203,7 +203,7 @@ (defn load-script "Loads Clojure source from a file or resource given its path. Paths beginning with @ or @/ are considered relative to classpath." - [path] + [#^String path] (if (.startsWith path "@") (RT/loadResourceScript (.substring path (if (.startsWith path "@/") 2 1))) diff --git a/src/clj/clojure/test.clj b/src/clj/clojure/test.clj index 7195034b29..0d7c4600d1 100644 --- a/src/clj/clojure/test.clj +++ b/src/clj/clojure/test.clj @@ -505,7 +505,7 @@ Chas Emerick, Allen Rohner, and Stuart Halloway", "Returns a vector [filename line-number] for the nth call up the stack." [n] - (let [s (nth (.getStackTrace (new java.lang.Throwable)) n)] + (let [#^StackTraceElement s (nth (.getStackTrace (new java.lang.Throwable)) n)] [(.getFileName s) (.getLineNumber s)])) (defn testing-vars-str diff --git a/src/clj/clojure/test/tap.clj b/src/clj/clojure/test/tap.clj index 6f4b57a6d8..11550db06b 100644 --- a/src/clj/clojure/test/tap.clj +++ b/src/clj/clojure/test/tap.clj @@ -51,7 +51,7 @@ "Prints a TAP diagnostic line. data is a (possibly multi-line) string." [data] - (doseq [line (.split data "\n")] + (doseq [line (.split #^String data "\n")] (println "#" line))) (defn print-tap-pass diff --git a/src/clj/clojure/xml.clj b/src/clj/clojure/xml.clj index 251f16c5e0..caac770ac6 100644 --- a/src/clj/clojure/xml.clj +++ b/src/clj/clojure/xml.clj @@ -26,7 +26,7 @@ (assoc e :content (conj (or (:content e) []) c))) push-chars (fn [] (when (and (= *state* :chars) - (some (complement #(. Character (isWhitespace %))) (str *sb*))) + (some (complement #(Character/isWhitespace (char %))) (str *sb*))) (set! *current* (push-content *current* (str *sb*)))))] (new clojure.lang.XMLHandler (proxy [ContentHandler] [] @@ -34,14 +34,14 @@ (let [attrs (fn [ret i] (if (neg? i) ret - (recur (assoc ret - (. clojure.lang.Keyword (intern (symbol (. atts (getQName i))))) - (. atts (getValue i))) + (recur (assoc ret + (clojure.lang.Keyword/intern (symbol (.getQName atts i))) + (.getValue atts (int i))) (dec i)))) - e (struct element + e (struct element (. clojure.lang.Keyword (intern (symbol q-name))) - (when (pos? (. atts (getLength))) - (attrs {} (dec (. atts (getLength))))))] + (when (pos? (.getLength atts)) + (attrs {} (dec (.getLength atts)))))] (push-chars) (set! *stack* (conj *stack* *current*)) (set! *current* e) @@ -53,11 +53,11 @@ (set! *stack* (pop *stack*)) (set! *state* :between) nil) - (characters [ch start length] + (characters [#^chars ch start length] (when-not (= *state* :chars) (set! *sb* (new StringBuilder))) (let [#^StringBuilder sb *sb*] - (. sb (append ch start length)) + (.append sb ch (int start) (int length)) (set! *state* :chars)) nil) (setDocumentLocator [locator])