From e47b0d9587c07880b51bcf2c8fc199fa8e043a0b Mon Sep 17 00:00:00 2001 From: Michael Blume Date: Wed, 12 Jul 2017 13:02:26 -0700 Subject: [PATCH] Remove reflection --- src/carica/core.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/carica/core.clj b/src/carica/core.clj index f2c43a5..1de44d2 100644 --- a/src/carica/core.clj +++ b/src/carica/core.clj @@ -5,7 +5,8 @@ [clojure.tools.logging :as log] [clojure.tools.reader :as clj-reader] [clojure.tools.reader.edn :as edn] - [clojure.walk :as walk])) + [clojure.walk :as walk]) + (:import [java.net URL])) (declare config) @@ -50,7 +51,7 @@ (fn [resource] (->> (if (string? resource) resource - (.getPath resource)) + (.getPath ^URL resource)) (re-find #"\.([^..]*?)$") second (keyword "carica")))) @@ -61,7 +62,7 @@ (defmethod load-config :carica/clj [resource] (load-with resource clj-reader/read)) -(defmethod load-config :carica/json [resource] +(defmethod load-config :carica/json [^URL resource] (with-open [s (.openStream resource)] (-> s io/reader (json-parse-stream true))))