Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make sure the clojure.core/bases function always returns a seq.

Previously the function returned a clojure.lang.Cons when passed a class and a Java array when passed an interface. Expanded existing test to show that the changed code is correct.

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
commit 73f94cb8c7f60a131759b4488a3fefd6599d0328 1 parent 9252893
Alf Kristian Støyle authored August 15, 2011 stuarthalloway committed August 18, 2012
2  src/clj/clojure/core.clj
@@ -4918,7 +4918,7 @@
4918 4918
     (let [i (.getInterfaces c)
4919 4919
           s (.getSuperclass c)]
4920 4920
       (not-empty
4921  
-       (if s (cons s i) i)))))
  4921
+       (if s (cons s i) (seq i))))))
4922 4922
 
4923 4923
 (defn supers
4924 4924
   "Returns the immediate and indirect superclasses and interfaces of c, if any"
4  test/clojure/test_clojure/java_interop.clj
@@ -154,7 +154,9 @@
154 154
       (bases java.lang.Math)
155 155
         (list java.lang.Object)
156 156
       (bases java.lang.Integer)
157  
-        (list java.lang.Number java.lang.Comparable) ))
  157
+        (list java.lang.Number java.lang.Comparable)
  158
+      (bases java.util.List)
  159
+        (list java.util.Collection) ))
158 160
 
159 161
 (deftest test-supers
160 162
   (are [x y] (= x y)

1 note on commit 73f94cb

Steve Miner

I think you took the wrong patch. stoyle said he did not have a CA. I wrote an independent patch also attached to CLJ-828.

Please sign in to comment.
Something went wrong with that request. Please try again.