<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:56:06 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-2013] Make Bson interface Serializable and Clonable</title>
                <link>https://jira.mongodb.org/browse/JAVA-2013</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Currently all the classes which implements &lt;b&gt;org.bson.conversions.Bson&lt;/b&gt; interface are &lt;b&gt;Serializable&lt;/b&gt; and &lt;b&gt;Cloneable&lt;/b&gt;. It would be good if Bson interface itself extends those interfaces. Also when we do programming against interface (Bson), this is necessary.&lt;/p&gt;</description>
                <environment></environment>
        <key id="233899">JAVA-2013</key>
            <summary>Make Bson interface Serializable and Clonable</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="Kamesh">Kamesh</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Oct 2015 11:49:56 +0000</created>
                <updated>Tue, 13 Oct 2015 13:30:43 +0000</updated>
                            <resolved>Tue, 13 Oct 2015 13:30:43 +0000</resolved>
                                    <version>3.0.4</version>
                    <version>3.1.0</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1058923" author="jeff.yemin" created="Tue, 13 Oct 2015 13:30:37 +0000"  >&lt;p&gt;Yes, you&apos;re right about BasicDBObject.  It&apos;s Serializable and Cloneable by virtue of indirectly extending HashMap.  Apologies for missing that earlier.&lt;/p&gt;

&lt;p&gt;As I said earlier, we can&apos;t make Bson extend Serializable without breaking binary compatibility for any existing classes that already implement Bson but are not Serializable.  I think this was the right decision: notice, for example, that in the JDK interfaces like Map and Collection do not extend Serializable (or Cloneable).  Both these interfaces place non-negligible requirements on implementing classes and are therefore too onerous for widely implemented interfaces like these.&lt;/p&gt;

&lt;p&gt;For these reasons, I&apos;m closing this as Won&apos;t Fix.  As a workaround, you can convert any Bson instance to a BsonDocument via the org.bson.conversions.Bson#toBsonDocument method.  BsonDocument, unlike Bson, is both Cloneable and Serializable.&lt;/p&gt;</comment>
                            <comment id="1058877" author="kamesh" created="Tue, 13 Oct 2015 12:26:32 +0000"  >&lt;p&gt;I am referring &lt;a href=&quot;https://api.mongodb.org/java/3.1/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;java doc&lt;/a&gt; and there it mentioned that &lt;tt&gt;BasicDBObject&lt;/tt&gt; is both &lt;tt&gt;Serializable&lt;/tt&gt; and &lt;tt&gt;Cloneable&lt;/tt&gt;. Yes, &lt;tt&gt;Document&lt;/tt&gt; is not &lt;tt&gt;Cloneable&lt;/tt&gt;, however, it is &lt;tt&gt;Serializable&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I feel it would be good to have &lt;tt&gt;Bson&lt;/tt&gt; as at least &lt;tt&gt;Serializable&lt;/tt&gt;. Otherwise, an application requiring a serialized object may not use &lt;tt&gt;Bson&lt;/tt&gt;, rather have to use one of the implementation classes. &lt;/p&gt;

&lt;p&gt;Is there any reason behind not making &lt;tt&gt;Bson&lt;/tt&gt; as &lt;tt&gt;Serializable&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;If you think, it is not a valid ask, please feel free to close this as &lt;b&gt;invalid&lt;/b&gt;.&lt;/p&gt;</comment>
                            <comment id="1057758" author="jeff.yemin" created="Mon, 12 Oct 2015 13:04:56 +0000"  >&lt;p&gt;It&apos;s not the case that all classes which implement Bson are Serializable and Cloneable.   &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;BasicDBObject is neither&lt;/li&gt;
	&lt;li&gt;Document is not Cloneable&lt;/li&gt;
	&lt;li&gt;Numerous anonymous implementations are neither&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Furthermore, making Bson extends Serializable and Cloneable would break binary compatibility for any third parties that are already implementing Bson.  For that reason alone, we can&apos;t make this change.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10012"><![CDATA[Major Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <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|hsdn1b:</customfieldvalue>

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