From 5813f61649d825ed4f1b8fb735af15c7c5517beb Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Sat, 9 Jun 2012 00:33:55 +0400 Subject: [PATCH] Eliminate this reflection warning Unfortunately, because Java driver's return type is so generic (Iterable), we have to do it by type hinting what is really returned as the result set (by inspecting the Java driver code paths). --- src/monger/core.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/monger/core.clj b/src/monger/core.clj index 2bb32c6..ae7cf56 100644 --- a/src/monger/core.clj +++ b/src/monger/core.clj @@ -282,7 +282,9 @@ MapReduceOutput (count [^MapReduceOutput this] - (.count ^Iterable (.results this)))) + ;; MongoDB Java driver could use a lot more specific type than Iterable but + ;; it always uses DBCollection#find to popular result set. MK. + (.count ^DBCursor (.results this)))) (defn ^DBObject get-last-error "Returns the the error (if there is one) from the previous operation on this connection.