Permalink
Browse files

bases should return a seq, not a Java array

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
1 parent cc223bb commit 49f63b28eb3ae0fd4494093742f1b7164cd321f4 @miner miner committed with stuarthalloway May 18, 2012
Showing with 8 additions and 3 deletions.
  1. +2 −3 src/clj/clojure/core.clj
  2. +6 −0 test/clojure/test_clojure/java_interop.clj
View
@@ -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"
@@ -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) ))

0 comments on commit 49f63b2

Please sign in to comment.