<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51:21 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-21] Longs are not respected and are turned into doubles</title>
                <link>https://jira.mongodb.org/browse/JAVA-21</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;ByteEncoder.putNumber either ouputs ints or doubles.  Small longs could be sent as ints, but Long values should also not be turned into doubles.&lt;/p&gt;</description>
                <environment></environment>
        <key id="10440">JAVA-21</key>
            <summary>Longs are not respected and are turned into doubles</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="kristina">Kristina Chodorow</assignee>
                                    <reporter username="carrino">John Carrino</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 Aug 2009 05:02:00 +0000</created>
                <updated>Fri, 2 Oct 2009 11:38:54 +0000</updated>
                            <resolved>Fri, 14 Aug 2009 11:53:36 +0000</resolved>
                                                    <fixVersion>0.8</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="10426" author="kristina" created="Fri, 14 Aug 2009 11:53:36 +0000"  >&lt;p&gt;There&apos;s a new version of the Java driver (&lt;a href=&quot;http://cloud.github.com/downloads/mongodb/mongo-java-driver/mongo-0.7.jar&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://cloud.github.com/downloads/mongodb/mongo-java-driver/mongo-0.7.jar&lt;/a&gt;) which can save/retrieve longs.&lt;/p&gt;</comment>
                            <comment id="10422" author="carrino" created="Thu, 13 Aug 2009 15:33:07 +0000"  >&lt;p&gt;Ok, cool.  I was just following the getting stared guide which said to pick up the jar from &lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo-java-driver/downloads&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo-java-driver/downloads&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it isn&apos;t too much trouble, could to also post the source up in zip form, it makes it easier to dev against if I have source attached.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                            <comment id="10421" author="kristina" created="Thu, 13 Aug 2009 14:53:33 +0000"  >&lt;p&gt;Never mind, I didn&apos;t realize you were using the .6 driver.  The 0.6 driver doesn&apos;t support longs, I&apos;ll release 0.7 asap.  In the meantime, you could download the latest code from Github, if you wanted, which does support longs.&lt;/p&gt;</comment>
                            <comment id="10420" author="kristina" created="Thu, 13 Aug 2009 14:50:01 +0000"  >&lt;p&gt;Yes.&lt;/p&gt;

&lt;p&gt;Also, I added:&lt;/p&gt;

&lt;p&gt;System.out.println(read.get(&quot;num&quot;).getClass());&lt;/p&gt;

&lt;p&gt;which printed:&lt;/p&gt;

&lt;p&gt;class java.lang.Long&lt;/p&gt;</comment>
                            <comment id="10419" author="carrino" created="Thu, 13 Aug 2009 14:31:57 +0000"  >&lt;p&gt;huh, I try it from the command line and it will accept all numbers up to max_long without converting it to a double.&lt;/p&gt;

&lt;p&gt;the posted unit test passes for you?&lt;/p&gt;</comment>
                            <comment id="10418" author="kristina" created="Thu, 13 Aug 2009 13:51:45 +0000"  >&lt;p&gt;This works fine for me.  Are you sure you&apos;re using a DB version that supports longs?  DB support for longs was only added recently (post-0.9.7), can you try it with the nightly?&lt;/p&gt;</comment>
                            <comment id="10417" author="carrino" created="Thu, 13 Aug 2009 13:27:52 +0000"  >&lt;p&gt;I had downloaded the latest on &lt;a href=&quot;http://github.com/mongodb/mongo-java-driver/downloads&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo-java-driver/downloads&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also to note is that the source version lags the jar.  This is suboptimal when using source attachment for 0.6.&lt;/p&gt;</comment>
                            <comment id="10416" author="eliot" created="Thu, 13 Aug 2009 12:27:25 +0000"  >&lt;p&gt;is this just an old jar?&lt;br/&gt;
kristina: can you build a new jar if so (make sure to do it with java 1.5)&lt;/p&gt;</comment>
                            <comment id="10415" author="carrino" created="Thu, 13 Aug 2009 05:16:49 +0000"  >&lt;p&gt;I am using driver version 0.6.&lt;/p&gt;

&lt;p&gt;Here is a test that exposes the issue&lt;/p&gt;

&lt;p&gt;    public void testObjectLong() &lt;/p&gt;
{
        ByteEncoder encoder = ByteEncoder.get();
        
        DBObject o = new BasicDBObject();
        o.put( &quot;num&quot; , 517L );
        
        encoder.putObject( o );
        
        encoder.flip();
        
        ByteDecoder decoder = new ByteDecoder( encoder._buf );
        DBObject read = decoder.readObject();
        
        assertEquals( 517L , read.get(&quot;num&quot;) );
    }</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|hrhdp3:</customfieldvalue>

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