summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Halloway <stu@thinkrelevance.com>2011-03-02 09:15:08 -0500
committerStuart Halloway <stu@thinkrelevance.com>2011-03-11 11:16:27 -0500
commit9146b490dacb321a852c975af6ba11e794c737b8 (patch)
tree96308ed3f42586f9d3f902a8201b6d62425c5f59
parent9368fd7602304e236fa5713fa4d81ad2979b4b14 (diff)
fix regression from #737
Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
-rw-r--r--src/clj/clojure/genclass.clj9
-rw-r--r--test/clojure/test_clojure/genclass.clj14
-rw-r--r--test/clojure/test_clojure/genclass/examples.clj15
3 files changed, 17 insertions, 21 deletions
diff --git a/src/clj/clojure/genclass.clj b/src/clj/clojure/genclass.clj
index 08c0ee94..93fa438e 100644
--- a/src/clj/clojure/genclass.clj
+++ b/src/clj/clojure/genclass.clj
@@ -631,7 +631,14 @@
fully-qualified class name given as a string or symbol
(such as 'java.lang.String)"
[c]
- (Type/getType (the-class c)))
+ (if (or (instance? Class c) (prim->class c))
+ (Type/getType (the-class c))
+ (let [strx (str c)]
+ (Type/getObjectType
+ (.replace (if (some #{\. \[} strx)
+ strx
+ (str "java.lang." strx))
+ "." "/")))))
(defn- generate-interface
[{:keys [name extends methods]}]
diff --git a/test/clojure/test_clojure/genclass.clj b/test/clojure/test_clojure/genclass.clj
index 42b6a0b3..2d95c179 100644
--- a/test/clojure/test_clojure/genclass.clj
+++ b/test/clojure/test_clojure/genclass.clj
@@ -107,12 +107,7 @@
"returnsLongArray" :longs
"returnsFloatArray" :floats
"returnsDoubleArray" :doubles
- "returnsBooleanArray" :booleans))
- (testing "object array types"
- (is (= (:maps array-types)
- (parameter-type (method-with-name "takesMapArray"))))
- (is (= (:maps-2d array-types)
- (return-type (method-with-name "returnsMap2dArray")))))))
+ "returnsBooleanArray" :booleans))))
(testing "gen-interface"
(let [method-with-name #(method-with-name % (.getMethods ArrayGenInterface))]
(testing "sugar primitive array hints"
@@ -136,9 +131,4 @@
"returnsLongArray" :longs
"returnsFloatArray" :floats
"returnsDoubleArray" :doubles
- "returnsBooleanArray" :booleans))
- (testing "object array types"
- (is (= (:maps array-types)
- (parameter-type (method-with-name "takesMapArray"))))
- (is (= (:maps-2d array-types)
- (return-type (method-with-name "returnsMap2dArray")))))))))
+ "returnsBooleanArray" :booleans))))))
diff --git a/test/clojure/test_clojure/genclass/examples.clj b/test/clojure/test_clojure/genclass/examples.clj
index 3f94fa41..158622fb 100644
--- a/test/clojure/test_clojure/genclass/examples.clj
+++ b/test/clojure/test_clojure/genclass/examples.clj
@@ -59,10 +59,12 @@
(^"[J" returnsLongArray [])
(^"[F" returnsFloatArray [])
(^"[D" returnsDoubleArray [])
- (^"[Z" returnsBooleanArray [])
- ; Object arrays
- (^void takesMapArray [^"[Ljava.util.Map;" a])
- (^"[[Ljava.util.Map;" returnsMap2dArray []))
+ (^"[Z" returnsBooleanArray []))
+
+(definterface UsesPreviousInterfaceFromThisFile
+ (^clojure.test-clojure.genclass.examples.ArrayDefInterface
+ identity
+ [^clojure.test-clojure.genclass.examples.ArrayDefInterface a]))
(gen-interface
:name clojure.test_clojure.genclass.examples.ArrayGenInterface
@@ -83,7 +85,4 @@
[returnsLongArray [] "[J"]
[returnsFloatArray [] "[F"]
[returnsDoubleArray [] "[D"]
- [returnsBooleanArray [] "[Z"]
- ; object arrays
- [takesMapArray ["[Ljava.util.Map;"] void]
- [returnsMap2dArray [] "[[Ljava.util.Map;"]])
+ [returnsBooleanArray [] "[Z"]])