Uploaded image for project: 'Clojure'
  1. CLJ-828

clojure.core/bases returns a cons when passed a class and a Java array when passed an interface

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: Release 1.2
    • Fix versions: Release 1.5
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      Description

      clojure.core/bases returns a clojure.lang.Cons when called with a class as parameter, but a Java array ( [Ljava.lang.Class; ) when called with an interface. Both should return values of the same type, which I guess should be a seq.

      Showing the problem at the REPL:
      user=> (bases java.util.List)
      #<Class[] [Ljava.lang.Class;@315b0333>
      user=> (bases java.util.ArrayList)
      (java.util.AbstractList java.util.List java.util.RandomAccess
      java.lang.Cloneable java.io.Serializable)

      I have attached a patch which calls the seq function on the else part of clojure.core/bases. Also updated the clojure.test-clojure.java-interop/test-bases test. However these test do not currently seem to run as part of the maven build. I have however run the test manually and verified that it works.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stoyle Alf Kristian Støyle
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: