<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:56:07 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-2019] MongoCollection.aggregate() throws NullPointerException when no batchSize is specified</title>
                <link>https://jira.mongodb.org/browse/JAVA-2019</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;When executing an aggregate pipeline, the Java driver gives me a NullPointerException without further explanation.&lt;/p&gt;

&lt;p&gt;While debugging I found that it&apos;s happening while trying to unbox &lt;tt&gt;AggregateIterableImpl.batchSize&lt;/tt&gt; of type &lt;b&gt;java.lang.Integer&lt;/b&gt; to be written to field &lt;tt&gt;FindIterableImpl.findOptions.batchSize&lt;/tt&gt; of type &lt;b&gt;int&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;When I specify a &lt;tt&gt;batchSize()&lt;/tt&gt; at the &lt;tt&gt;Aggregate&lt;/tt&gt; other than &lt;tt&gt;null&lt;/tt&gt;, e.g. explicitly setting it to &quot;0&quot; (the documented default value), everything is fine.&lt;/p&gt;

&lt;p&gt;So, instead of just using &lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;List&amp;lt;Document&amp;gt; result = collection.aggregate(pipeline).into(new LinkedList&amp;lt;Document&amp;gt;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt; I need to write &lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;List&amp;lt;Document&amp;gt; result = collection.aggregate(pipeline).batchSize(0).into(new LinkedList&amp;lt;Document&amp;gt;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt; which is rather unusual and smells a bit bad &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;.&lt;/p&gt;

&lt;p&gt;I think it would help to change the type of the batchSize attribute of &lt;tt&gt;AggregateIterableImpl&lt;/tt&gt; from &lt;tt&gt;java.lang.Integer&lt;/tt&gt; to &lt;tt&gt;int&lt;/tt&gt;, but I cannot tell whether it has any side-effects...&lt;/p&gt;</description>
                <environment>Java 7&lt;br/&gt;
MongoDB server version 3.0.x</environment>
        <key id="235679">JAVA-2019</key>
            <summary>MongoCollection.aggregate() throws NullPointerException when no batchSize is specified</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="ross@mongodb.com">Ross Lawley</assignee>
                                    <reporter username="rene.zanner@lpsolutions.com">Rene Zanner</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Oct 2015 15:11:46 +0000</created>
                <updated>Thu, 12 Nov 2015 14:11:58 +0000</updated>
                            <resolved>Fri, 23 Oct 2015 15:44:56 +0000</resolved>
                                    <version>3.0.4</version>
                                    <fixVersion>3.1.1</fixVersion>
                    <fixVersion>3.2.0</fixVersion>
                                    <component>Query Operations</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1086585" author="jeff.yemin" created="Thu, 12 Nov 2015 14:11:58 +0000"  >&lt;p&gt;Closing for 3.1.1 release.&lt;/p&gt;</comment>
                            <comment id="1069036" author="xgen-internal-githook" created="Fri, 23 Oct 2015 15:44:27 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rozza&apos;, u&apos;name&apos;: u&apos;Ross Lawley&apos;, u&apos;email&apos;: u&apos;ross.lawley@gmail.com&apos;}
&lt;p&gt;Message: Fix NPE bug in AggregateIterable&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2019&quot; title=&quot;MongoCollection.aggregate() throws NullPointerException when no batchSize is specified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2019&quot;&gt;&lt;del&gt;JAVA-2019&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: 3.1.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/cd8442593b902464dd0e0f69e1fa912acff4cb0d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/cd8442593b902464dd0e0f69e1fa912acff4cb0d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1069031" author="xgen-internal-githook" created="Fri, 23 Oct 2015 15:42:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rozza&apos;, u&apos;name&apos;: u&apos;Ross Lawley&apos;, u&apos;email&apos;: u&apos;ross.lawley@gmail.com&apos;}
&lt;p&gt;Message: Fix NPE bug in AggregateIterable&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-2019&quot; title=&quot;MongoCollection.aggregate() throws NullPointerException when no batchSize is specified&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-2019&quot;&gt;&lt;del&gt;JAVA-2019&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/75fd3659d4b0c2fb743347217c75227ef8738e8e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/75fd3659d4b0c2fb743347217c75227ef8738e8e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1068118" author="jeff.yemin" created="Thu, 22 Oct 2015 17:58:42 +0000"  >&lt;p&gt;OK, that&apos;s what I thought.  The $out stage is the trigger for this bug.  Thanks for the report, and it&apos;s good to know that you have a workaround until we get this fixed.&lt;/p&gt;</comment>
                            <comment id="1067949" author="rene.zanner@lpsolutions.com" created="Thu, 22 Oct 2015 15:42:11 +0000"  >&lt;p&gt;Yes - actually, it&apos;s the &lt;b&gt;only&lt;/b&gt; stage in my pipeline... &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; I use it to clone my collection.&lt;/p&gt;</comment>
                            <comment id="1067941" author="jeff.yemin" created="Thu, 22 Oct 2015 15:36:08 +0000"  >&lt;p&gt;Hi Rene,&lt;/p&gt;

&lt;p&gt;Can you confirm whether the last stage of the pipeline is a $out?  &lt;/p&gt;
</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|hsdvm7:</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>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="749">Java Sprint 27</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>