<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51:44 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-205] don&apos;t mark methods final</title>
                <link>https://jira.mongodb.org/browse/JAVA-205</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;We try to write unit tests for all of our application logic. It is very difficult to do this with mongo. Ideally, we could test our application without having a real mongo server running. Unfortunately, many of the methods inside classes like Mongo, DBCollection, and DB are marked final. This means we can&apos;t either stub them out or mock them out.&lt;/p&gt;

&lt;p&gt;Removing the &quot;final&quot; keyword would make this a lot easier for us.&lt;/p&gt;</description>
                <environment></environment>
        <key id="13548">JAVA-205</key>
            <summary>don&apos;t mark methods final</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="permans">Sam Perman</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Oct 2010 20:56:59 +0000</created>
                <updated>Mon, 18 Jun 2012 19:36:08 +0000</updated>
                            <resolved>Thu, 2 Feb 2012 15:39:45 +0000</resolved>
                                    <version>2.2</version>
                                    <fixVersion>2.8.0</fixVersion>
                                    <component>API</component>
                                        <votes>8</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="134042" author="jeff.yemin" created="Mon, 18 Jun 2012 19:36:08 +0000"  >&lt;p&gt;Closing for 2.8.0 release.&lt;/p&gt;</comment>
                            <comment id="84558" author="auto" created="Thu, 2 Feb 2012 15:36:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-205&quot; title=&quot;don&amp;#39;t mark methods final&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-205&quot;&gt;&lt;del&gt;JAVA-205&lt;/del&gt;&lt;/a&gt;: removing final keyword from remaining methods.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/965d1e239aad03f6408ebe7fe33cae8ecf3fb570&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/965d1e239aad03f6408ebe7fe33cae8ecf3fb570&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="84556" author="jeff.yemin" created="Thu, 2 Feb 2012 15:33:52 +0000"  >&lt;p&gt;@Christian: we can&apos;t make them interfaces without breaking binary compatibility, so if we do that it will have to wait until a 3.0 release (see &lt;a href=&quot;http://semver.org/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://semver.org/&lt;/a&gt;, which we are going to start following).&lt;/p&gt;

&lt;p&gt;@Daniel: No need.  I&apos;m doing it now.&lt;/p&gt;</comment>
                            <comment id="84429" author="daspilker" created="Thu, 2 Feb 2012 11:01:32 +0000"  >&lt;p&gt;The final methods keep us from writing unit tests for the database layer because mock frameworks like Mockito cannot mock final methods. As a result the database layer is the component with the worst unit test coverage. Most methods in DB and DBCollection are not final anyway. I can offer to provide a pull request which removes the final modifiers from DB.getCollection, DB.createCollection, DBCollection.find, DBCollection.findOne, DBCollection.createIndex, DBCollection.ensureIndex, DBCollection.apply and DBCollection.save. Any thoughts on this?&lt;/p&gt;</comment>
                            <comment id="64167" author="cpesch" created="Wed, 2 Nov 2011 12:06:36 +0000"  >&lt;p&gt;What is the problem in removing the &quot;final&quot; keyword or (even better &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/wink.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; making DB and DBCollection interfaces? Are there security concerns? Instabilities?&lt;/p&gt;</comment>
                            <comment id="36323" author="fuddi" created="Mon, 6 Jun 2011 11:32:36 +0000"  >&lt;p&gt;Will you removed the &quot;final&quot; keyword from the methods that still are marked final and when can we expect it to be done? &lt;/p&gt;

&lt;p&gt;Thank you &lt;/p&gt;</comment>
                            <comment id="26526" author="rgnitz" created="Tue, 22 Mar 2011 21:12:03 +0000"  >&lt;p&gt;&lt;br/&gt;
My mistake... I see that some of the methods are still marked as final .&lt;/p&gt;</comment>
                            <comment id="26525" author="rgnitz" created="Tue, 22 Mar 2011 21:02:43 +0000"  >&lt;p&gt;As of the 2.5 release, these classes are both abstract:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://api.mongodb.org/java/2.5/com/mongodb/DBCollection.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/java/2.5/com/mongodb/DBCollection.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://api.mongodb.org/java/2.5/com/mongodb/DB.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/java/2.5/com/mongodb/DB.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mongo is also no longer final in 2.5:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://api.mongodb.org/java/2.5/com/mongodb/Mongo.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://api.mongodb.org/java/2.5/com/mongodb/Mongo.html&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="20879" author="daspilker" created="Wed, 1 Dec 2010 10:52:03 +0000"  >&lt;p&gt;I agree with Sam and Remon. Ideally DBCollection and DB should be interfaces, but removing the final qualifiers would do for us.&lt;/p&gt;</comment>
                            <comment id="20400" author="remonvv" created="Wed, 17 Nov 2010 13:05:17 +0000"  >&lt;p&gt;I agree, we&apos;re running into the same problem and there&apos;s no easy way around it. There are very few good reasons to use the final keyword on methods.&lt;/p&gt;</comment>
                            <comment id="19794" author="permans" created="Thu, 28 Oct 2010 21:03:09 +0000"  >&lt;p&gt;Having an interface that these class implement would be even better. This would let us implement tests with whatever simulated behavior we wanted.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|hrgpif:</customfieldvalue>

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