<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:55:31 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-1796] JSON.parse method doesn&apos;t support $type in $binary where type is a hexadecimal string</title>
                <link>https://jira.mongodb.org/browse/JAVA-1796</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;as discussed on &lt;a href=&quot;https://groups.google.com/d/msg/mongodb-user/ihCV6zWzWlg/u7Q-AKxBEQEJ&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://groups.google.com/d/msg/mongodb-user/ihCV6zWzWlg/u7Q-AKxBEQEJ&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The old &quot;Json&quot; package doesn&apos;t support the Extended JSON :&lt;/p&gt;

&lt;p&gt;$type is not a String but an Integer&lt;/p&gt;

&lt;p&gt;You can reproduce the problem with :&lt;/p&gt;

&lt;p&gt;final Document document = new Document(&quot;test&quot;, new BsonBinary(&quot;test&quot;.getBytes()));&lt;br/&gt;
final String json = document.toJson();&lt;br/&gt;
System.out.println(json);&lt;br/&gt;
JSON.parse(json);&lt;/p&gt;

&lt;p&gt;and you got :&lt;br/&gt;
{ &quot;test&quot; : &lt;/p&gt;
{ &quot;$binary&quot; : &quot;dGVzdA==&quot;, &quot;$type&quot; : &quot;0&quot; }
&lt;p&gt; }&lt;/p&gt;

&lt;p&gt;java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer&lt;br/&gt;
    at com.mongodb.util.JSONCallback.objectDone(JSONCallback.java:127)&lt;br/&gt;
    at com.mongodb.util.JSONParser.parseObject(JSON.java:274)&lt;br/&gt;
    at com.mongodb.util.JSONParser.parse(JSON.java:227)&lt;br/&gt;
    at com.mongodb.util.JSONParser.parseObject(JSON.java:263)&lt;br/&gt;
    at com.mongodb.util.JSONParser.parse(JSON.java:227)&lt;br/&gt;
    at com.mongodb.util.JSONParser.parse(JSON.java:155)&lt;br/&gt;
    at com.mongodb.util.JSON.parse(JSON.java:92)&lt;br/&gt;
    at com.mongodb.util.JSON.parse(JSON.java:73)&lt;/p&gt;

&lt;p&gt;($type, as I understand, must be an Integer but Extended JSon ask for a String)&lt;/p&gt;</description>
                <environment></environment>
        <key id="201946">JAVA-1796</key>
            <summary>JSON.parse method doesn&apos;t support $type in $binary where type is a hexadecimal string</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="9">Done</resolution>
                                        <assignee username="ross@mongodb.com">Ross Lawley</assignee>
                                    <reporter username="twillouer">William Delanoue</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 May 2015 22:31:26 +0000</created>
                <updated>Wed, 6 Feb 2019 15:45:17 +0000</updated>
                            <resolved>Tue, 6 Dec 2016 18:01:21 +0000</resolved>
                                    <version>3.0.0</version>
                                    <fixVersion>3.5.0</fixVersion>
                                    <component>JSON</component>
                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1450410" author="xgen-internal-githook" created="Tue, 6 Dec 2016 18:00:15 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;tomdcsmith&apos;, u&apos;name&apos;: u&apos;tomdcsmith&apos;, u&apos;email&apos;: u&apos;tomdcsmith@users.noreply.github.com&apos;}
&lt;p&gt;Message: Fix for JSONCallback to fully support extended binary&lt;/p&gt;

&lt;p&gt;Added support for hexadecimal string values for the `$type` field in binary data.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1796&quot; title=&quot;JSON.parse method doesn&amp;#39;t support $type in $binary where type is a hexadecimal string&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-1796&quot;&gt;&lt;del&gt;JAVA-1796&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/600a37703ed6b4ad41bfab969a8efcbd51a00c6e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/600a37703ed6b4ad41bfab969a8efcbd51a00c6e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1443198" author="jeff.yemin" created="Mon, 28 Nov 2016 13:44:15 +0000"  >&lt;p&gt;Pull request: &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/pull/380&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/pull/380&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000dEHCIQA4]]]></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|hs90p3:</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>