Skip to content

Commit 4ba9107

Browse files
[test] Fix linter errors
1 parent 6db9025 commit 4ba9107

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cider/nrepl/middleware/slurp.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[nrepl.transport :as transport])
1313
(:import
1414
(java.io ByteArrayOutputStream FileNotFoundException InputStream)
15-
(java.net MalformedURLException URL URLConnection)
15+
(java.net MalformedURLException URI URL URLConnection)
1616
(java.nio.file Files Path Paths)
1717
(java.util Base64)))
1818

@@ -82,7 +82,7 @@
8282
(defn slurp-url-to-content+body
8383
"Attempts to parse and then to slurp a URL, producing a content-typed response."
8484
[url-str]
85-
(when-let [^URL url (try (URL. url-str)
85+
(when-let [^URL url (try (.toURL (URI. url-str))
8686
(catch MalformedURLException _e nil))]
8787
(if (= (.getProtocol url) "file") ;; expected common case
8888
(let [^Path p (Paths/get (.toURI url))

test/clj/cider/nrepl/middleware/classpath_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424

2525
(deftest file-url?-test
2626
(is (file-url? (.toURL (.toURI (java.io.File. "")))))
27-
(is (not (file-url? (java.net.URL. "jar:file:/tmp/test.jar!/BOOT-INF/classes")))))
27+
(is (not (file-url? (.toURL (java.net.URI. "jar:file:/tmp/test.jar!/BOOT-INF/classes"))))))

0 commit comments

Comments
 (0)