<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51: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-103] ByteEncoder assumes all arrays are Object[]</title>
                <link>https://jira.mongodb.org/browse/JAVA-103</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The ByteEncoder class assumes that if a value isArray(), the array type is Object. This throws a ClassCastException if you attempt to pass a primitive array:&lt;/p&gt;

&lt;p&gt;        else if ( val.getClass().isArray() )&lt;br/&gt;
            putList( name , Arrays.asList( (Object[])val ) );&lt;/p&gt;

&lt;p&gt;It would be more flexible to use Array.get() to reflectively read the array:&lt;/p&gt;

&lt;p&gt;    private void putArray( String name , Object array )&lt;/p&gt;
{
        _put( ARRAY , name );
        final int sizePos = _buf.position();
        _buf.putInt( 0 );
        
        int size = Array.getLength(array);
        for ( int i=0; i&amp;lt;size; i++ )
            _putObjectField( String.valueOf( i ) , Array.get( array, i ) );

        _buf.put( EOO );
        _buf.putInt( sizePos , _buf.position() - sizePos );        
    }

&lt;p&gt;I can provide a patch, if needed.&lt;/p&gt;</description>
                <environment>Java</environment>
        <key id="11759">JAVA-103</key>
            <summary>ByteEncoder assumes all arrays are Object[]</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="mmastrac">Matt Mastracci</reporter>
                        <labels>
                    </labels>
                <created>Mon, 12 Apr 2010 14:24:59 +0000</created>
                <updated>Fri, 29 Oct 2010 02:49:57 +0000</updated>
                            <resolved>Wed, 29 Sep 2010 08:20:12 +0000</resolved>
                                    <version>1.4</version>
                                    <fixVersion>2.2</fixVersion>
                                                        <votes>3</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="18676" author="auto" created="Wed, 29 Sep 2010 20:17:14 +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: additional test for &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-103&quot; title=&quot;ByteEncoder assumes all arrays are Object[]&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-103&quot;&gt;&lt;del&gt;JAVA-103&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo-java-driver/commit/6141925e28ce3a843c4e11d0d632eb440650f1fa&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo-java-driver/commit/6141925e28ce3a843c4e11d0d632eb440650f1fa&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="18675" author="auto" created="Wed, 29 Sep 2010 20:13:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;&apos;, &apos;name&apos;: &apos;hmeiser&apos;, &apos;email&apos;: &apos;hmeiser@example.com&apos;}
&lt;p&gt;Message: BSONEncoder now can handle primitive arrays &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-103&quot; title=&quot;ByteEncoder assumes all arrays are Object[]&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-103&quot;&gt;&lt;del&gt;JAVA-103&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo-java-driver/commit/a72081d4f6ffaa187c8a6f0e1882f943ac29e863&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo-java-driver/commit/a72081d4f6ffaa187c8a6f0e1882f943ac29e863&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="18655" author="hmeiser" created="Wed, 29 Sep 2010 08:20:12 +0000"  >&lt;p&gt;&lt;a href=&quot;http://github.com/theunique/mongo-java-driver/commit/e6e164c6fcadfcf9a50b4b4723ba516afeb49c85&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/theunique/mongo-java-driver/commit/e6e164c6fcadfcf9a50b4b4723ba516afeb49c85&lt;/a&gt;&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|hrhd7j:</customfieldvalue>

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