Skip to content

Commit 405da15

Browse files
committed
Fix reflection warnings by adding type hints
1 parent e02a0a9 commit 405da15

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/clojure/clojure/tools/trace.clj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ such as clojure.core/+"
228228
(try
229229
(let [ctor (.getConstructor java.lang.AssertionError (into-array [java.lang.Object]))
230230
arg (first args)]
231-
(doto (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace)))
231+
(doto ^AssertionError (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace)))
232232
(catch Exception e# this))))
233233

234234
(extend-type java.nio.charset.CoderMalfunctionError
@@ -239,9 +239,9 @@ such as clojure.core/+"
239239
arg (first args)]
240240
(cond
241241
(instance? java.lang.Exception arg)
242-
(doto (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace))
242+
(doto ^java.nio.charset.CoderMalfunctionError (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace))
243243
(string? arg)
244-
(doto (.newInstance ctor (into-array [(Exception. arg)])) (.setStackTrace stack-trace))
244+
(doto ^java.nio.charset.CoderMalfunctionError (.newInstance ctor (into-array [(Exception. ^String arg)])) (.setStackTrace stack-trace))
245245
:else this))
246246
(catch Exception e# this))))
247247

@@ -253,10 +253,10 @@ such as clojure.core/+"
253253
arg (first args)]
254254
(cond
255255
(instance? java.lang.Throwable (first arg))
256-
(doto (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace))
256+
(doto ^java.io.IOError (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace))
257257

258258
(string? arg)
259-
(doto (.newInstance ctor (into-array [(Throwable. arg)])) (.setStackTrace stack-trace))
259+
(doto ^java.io.IOError (.newInstance ctor (into-array [(Throwable. ^String arg)])) (.setStackTrace stack-trace))
260260
:else this))
261261
(catch Exception e# this))))
262262

@@ -272,8 +272,8 @@ such as clojure.core/+"
272272
arg (first args)]
273273
(cond
274274
(string? arg)
275-
(doto (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace))
276-
:else (doto (.newInstance ctor (into-array [(str arg)])) (.setStackTrace stack-trace))))
275+
(doto ^java.lang.Throwable (.newInstance ctor (into-array [arg])) (.setStackTrace stack-trace))
276+
:else (doto ^java.lang.Throwable (.newInstance ctor (into-array [(str arg)])) (.setStackTrace stack-trace))))
277277
(catch Exception e# this))))
278278

279279
(extend-type java.lang.Object

0 commit comments

Comments
 (0)