Skip to content

Commit

Permalink
bases should return a seq, not a Java array
Browse files Browse the repository at this point in the history
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information
miner authored and stuarthalloway committed Aug 18, 2012
1 parent cc223bb commit 49f63b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/clj/clojure/core.clj
Expand Up @@ -4915,10 +4915,9 @@
:static true}
[^Class c]
(when c
(let [i (.getInterfaces c)
(let [i (seq (.getInterfaces c))
s (.getSuperclass c)]
(not-empty
(if s (cons s i) i)))))
(if s (cons s i) i))))

(defn supers
"Returns the immediate and indirect superclasses and interfaces of c, if any"
Expand Down
6 changes: 6 additions & 0 deletions test/clojure/test_clojure/java_interop.clj
Expand Up @@ -153,6 +153,12 @@
(are [x y] (= x y)
(bases java.lang.Math)
(list java.lang.Object)
(bases java.util.Collection)
(list java.lang.Iterable)
(bases java.lang.Object)
nil
(bases java.lang.Comparable)
nil
(bases java.lang.Integer)
(list java.lang.Number java.lang.Comparable) ))

Expand Down

0 comments on commit 49f63b2

Please sign in to comment.