[JAVA-2019] MongoCollection.aggregate() throws NullPointerException when no batchSize is specified Created: 22/Oct/15 Updated: 12/Nov/15 Resolved: 23/Oct/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Query Operations |
| Affects Version/s: | 3.0.4 |
| Fix Version/s: | 3.1.1, 3.2.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Rene Zanner | Assignee: | Ross Lawley |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java 7 |
||
| Description |
|
When executing an aggregate pipeline, the Java driver gives me a NullPointerException without further explanation. While debugging I found that it's happening while trying to unbox AggregateIterableImpl.batchSize of type java.lang.Integer to be written to field FindIterableImpl.findOptions.batchSize of type int. When I specify a batchSize() at the Aggregate other than null, e.g. explicitly setting it to "0" (the documented default value), everything is fine. So, instead of just using
I think it would help to change the type of the batchSize attribute of AggregateIterableImpl from java.lang.Integer to int, but I cannot tell whether it has any side-effects... |
| Comments |
| Comment by Jeffrey Yemin [ 12/Nov/15 ] |
|
Closing for 3.1.1 release. |
| Comment by Githook User [ 23/Oct/15 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Fix NPE bug in AggregateIterable
|
| Comment by Githook User [ 23/Oct/15 ] |
|
Author: {u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}Message: Fix NPE bug in AggregateIterable
|
| Comment by Jeffrey Yemin [ 22/Oct/15 ] |
|
OK, that's what I thought. The $out stage is the trigger for this bug. Thanks for the report, and it's good to know that you have a workaround until we get this fixed. |
| Comment by Rene Zanner [ 22/Oct/15 ] |
|
Yes - actually, it's the only stage in my pipeline... |
| Comment by Jeffrey Yemin [ 22/Oct/15 ] |
|
Hi Rene, Can you confirm whether the last stage of the pipeline is a $out? |