[JAVA-1970] Deferred collection creation throws NPE Created: 18/Sep/15 Updated: 12/Nov/15 Resolved: 03/Nov/15 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Command Operations |
| Affects Version/s: | 3.0.3, 3.0.4 |
| Fix Version/s: | 3.1.1, 3.2.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Gordon Syme | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
com.mongodb.DB.createCollection is documented as deferring the collection creation if the options parameter is null. This was the behaviour in 2.x 3.0.x fail with a NullPointerException because the options parameter is accessed in com.mongodb.DB.getCreateCollectionOperation without a null-check. |
| Comments |
| Comment by Jeffrey Yemin [ 12/Nov/15 ] |
|
Closing for 3.1.1 release. |
| Comment by Githook User [ 07/Nov/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |
| Comment by Githook User [ 03/Nov/15 ] |
|
Author: {u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}Message: |
| Comment by Gordon Syme [ 18/Sep/15 ] |
|
Thanks for the info Jeff, I'd already implemented your second suggestion but the first is nicer. I'll go with that instead. |
| Comment by Jeffrey Yemin [ 18/Sep/15 ] |
|
Hi Gordon, Thanks for the report. This is indeed a regression. Until it's fixed, I can offer two workarounds:
|