You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to utilize the hasAnyOf() method within a Query, if the Iterable passed in points to an empty Collection, the following exception is thrown. I would have expected a more graceful handling of this such that asList() just returns an empty List.
Morphia: 1.0.1
JDK: 1.7.0_67
MongoDB: 2.13.3
Stacktrace:
com.mongodb.MongoException: Can't canonicalize query: BadValue $in needs an array
at com.mongodb.QueryResultIterator.throwOnQueryFailure(QueryResultIterator.java:246)
at com.mongodb.QueryResultIterator.init(QueryResultIterator.java:224)
at com.mongodb.QueryResultIterator.initFromQueryResponse(QueryResultIterator.java:184)
at com.mongodb.QueryResultIterator.<init>(QueryResultIterator.java:62)
at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:86)
at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:66)
at com.mongodb.DBCursor._check(DBCursor.java:498)
at com.mongodb.DBCursor._hasNext(DBCursor.java:621)
at com.mongodb.DBCursor.hasNext(DBCursor.java:657)
at org.mongodb.morphia.query.MorphiaIterator.hasNext(MorphiaIterator.java:57)
at org.mongodb.morphia.query.QueryImpl.asList(QueryImpl.java:323)
at com.fs.core.test.dao.SampleTest.testAddEmpty(SampleTest.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:105)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86)
at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:98)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:61)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:54)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
When trying to utilize the
hasAnyOf()
method within a Query, if the Iterable passed in points to an empty Collection, the following exception is thrown. I would have expected a more graceful handling of this such thatasList()
just returns an empty List.Morphia: 1.0.1
JDK: 1.7.0_67
MongoDB: 2.13.3
Stacktrace:
Sample code:
The text was updated successfully, but these errors were encountered: