[JAVA-411] Java Driver 2.6.4 findOne fails when fields are specified but no document is found ( NullPointerException ) Created: 09/Aug/11 Updated: 10/Aug/11 Resolved: 09/Aug/11 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | 2.6.4 |
| Fix Version/s: | 2.6.5 |
| Type: | Bug | Priority: | Blocker - P1 |
| Reporter: | Brendan W. McAdams | Assignee: | Brendan W. McAdams |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
This is caused by the fix for The ternary operator explicitly declares "DBObject obj" as null if no matching document is found, but then with no test attempts to markAsPartialObject which will always throw a NullPointerException in the event findOne() found no matching document. |
| Comments |
| Comment by Brendan W. McAdams [ 09/Aug/11 ] |
|
Built regression test to reproduce bug, introduced fix. |
| Comment by auto [ 09/Aug/11 ] |
|
Author: {u'login': u'bwmcadams', u'name': u'Brendan W. McAdams', u'email': u'brendan@10gen.com'}Message: Fixes
|
| Comment by auto [ 09/Aug/11 ] |
|
Author: {u'login': u'bwmcadams', u'name': u'Brendan W. McAdams', u'email': u'brendan@10gen.com'}Message: Refs
|
| Comment by Brendan W. McAdams [ 09/Aug/11 ] |
|
It appears to be specifically when the fields argument is passed. Working on a fix & test now. |