<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:13 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-411] Java Driver 2.6.4 findOne fails when fields are specified but no document is found ( NullPointerException )</title>
                <link>https://jira.mongodb.org/browse/JAVA-411</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;This is caused by the fix for &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-387&quot; title=&quot;DBCollection#findOne(DBObject o, DBObject fields) doesn&amp;#39;t markAsPartialObject&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-387&quot;&gt;&lt;del&gt;JAVA-387&lt;/del&gt;&lt;/a&gt; ( &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/3aee72f1cf814bcbc786a2e04dbce12a81f4cc14&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/3aee72f1cf814bcbc786a2e04dbce12a81f4cc14&lt;/a&gt; ).&lt;/p&gt;

&lt;p&gt;The ternary operator explicitly declares &quot;DBObject obj&quot; 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.&lt;/p&gt;</description>
                <environment></environment>
        <key id="20764">JAVA-411</key>
            <summary>Java Driver 2.6.4 findOne fails when fields are specified but no document is found ( NullPointerException )</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="brendan">Brendan W. McAdams</assignee>
                                    <reporter username="brendan">Brendan W. McAdams</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Aug 2011 18:11:39 +0000</created>
                <updated>Wed, 10 Aug 2011 05:32:13 +0000</updated>
                            <resolved>Tue, 9 Aug 2011 18:24:43 +0000</resolved>
                                    <version>2.6.4</version>
                                    <fixVersion>2.6.5</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="47472" author="brendan" created="Tue, 9 Aug 2011 18:24:44 +0000"  >&lt;p&gt;Built regression test to reproduce bug, introduced fix.&lt;/p&gt;</comment>
                            <comment id="47471" author="auto" created="Tue, 9 Aug 2011 18:24:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;bwmcadams&apos;, u&apos;name&apos;: u&apos;Brendan W. McAdams&apos;, u&apos;email&apos;: u&apos;brendan@10gen.com&apos;}
&lt;p&gt;Message: Fixes &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-411&quot; title=&quot;Java Driver 2.6.4 findOne fails when fields are specified but no document is found ( NullPointerException )&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-411&quot;&gt;&lt;del&gt;JAVA-411&lt;/del&gt;&lt;/a&gt;, findOne fails when fields are specified but no document is found ( NullPointerException )&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Test for nullness on DBObject prior to setting PartialObject when fields are set&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/2894ab4fc761d7324d364132615bf695d8c4b009&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/2894ab4fc761d7324d364132615bf695d8c4b009&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="47470" author="auto" created="Tue, 9 Aug 2011 18:23:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;bwmcadams&apos;, u&apos;name&apos;: u&apos;Brendan W. McAdams&apos;, u&apos;email&apos;: u&apos;brendan@10gen.com&apos;}
&lt;p&gt;Message: Refs &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-411&quot; title=&quot;Java Driver 2.6.4 findOne fails when fields are specified but no document is found ( NullPointerException )&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-411&quot;&gt;&lt;del&gt;JAVA-411&lt;/del&gt;&lt;/a&gt;, findOne fails when fields are specified but no document is found ( NullPointerException )&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Regression test for this case that tests for a null findOne w/ fields specified&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/f25ef2b8a96f5124ab3b13ac63fd42522a60ec75&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/f25ef2b8a96f5124ab3b13ac63fd42522a60ec75&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="47463" author="brendan" created="Tue, 9 Aug 2011 18:14:52 +0000"  >&lt;p&gt;It appears to be specifically when the fields argument is passed.&lt;/p&gt;

&lt;p&gt;Working on a fix &amp;amp; test now.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhbtb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14714</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>