<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51:41 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-180] NullPointerException when calling Mongo.close() on unpaired server</title>
                <link>https://jira.mongodb.org/browse/JAVA-180</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;A NullPointerException is thrown in DBTCPConnector.close() due to _rsStatus being null when _rsStatus.close() is called.&lt;/p&gt;

&lt;p&gt;If you call the constructor&lt;/p&gt;

&lt;p&gt;    public Mongo( ServerAddress addr , MongoOptions options )&lt;/p&gt;

&lt;p&gt;then, the constructor is called:&lt;/p&gt;

&lt;p&gt;    public DBTCPConnector( Mongo m , ServerAddress addr )&lt;/p&gt;

&lt;p&gt;if the ServerAddress is not paired, then the following code sets _rsStatus to null:&lt;/p&gt;

&lt;p&gt;        if ( addr.isPaired() )&lt;/p&gt;
{
            _allHosts = new ArrayList&amp;lt;ServerAddress&amp;gt;( addr.explode() );
            _rsStatus = new ReplicaSetStatus( m , _allHosts );
            _createLogger.info( &quot;switching to replica set mode : &quot; + _allHosts + &quot; -&amp;gt; &quot; + _curMaster  );
        }
&lt;p&gt;        else &lt;/p&gt;
{
            _set( addr );
            _allHosts = null;
            _rsStatus = null;
        }

&lt;p&gt;when DBTCPConnector.close() is eventually called, _rsStatus.close() throws an NPE.&lt;/p&gt;

&lt;p&gt;Although _portHolder should never be null, I think it is worth checking it before calling close() on it, as well.&lt;/p&gt;

&lt;p&gt;I&apos;ll submit a pull request from my fork at &lt;a href=&quot;http://github.com/RobertStewart/mongo-java-driver&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/RobertStewart/mongo-java-driver&lt;/a&gt;.&lt;/p&gt;</description>
                <environment>OS X 10.6</environment>
        <key id="13300">JAVA-180</key>
            <summary>NullPointerException when calling Mongo.close() on unpaired server</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="eliot">Eliot Horowitz</assignee>
                                    <reporter username="robertstewart">Robert Stewart</reporter>
                        <labels>
                    </labels>
                <created>Sat, 9 Oct 2010 06:22:20 +0000</created>
                <updated>Fri, 29 Oct 2010 02:48:53 +0000</updated>
                            <resolved>Sat, 9 Oct 2010 14:58:53 +0000</resolved>
                                    <version>2.2</version>
                                    <fixVersion>2.3</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="19042" author="auto" created="Sat, 9 Oct 2010 14:58:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;erh&apos;, &apos;name&apos;: &apos;Eliot Horowitz&apos;, &apos;email&apos;: &apos;eliot@10gen.com&apos;}
&lt;p&gt;Message: fix possible NPE &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-180&quot; title=&quot;NullPointerException when calling Mongo.close() on unpaired server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-180&quot;&gt;&lt;del&gt;JAVA-180&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo-java-driver/commit/8aa710c343af52c96f2c225ce32fc601e3c9390c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo-java-driver/commit/8aa710c343af52c96f2c225ce32fc601e3c9390c&lt;/a&gt;&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|hrhcsn:</customfieldvalue>

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