<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:01:46 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-4319] &quot;match may not be exhaustive&quot; with Case Class Macros</title>
                <link>https://jira.mongodb.org/browse/JAVA-4319</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The following code&lt;/p&gt;

&lt;p&gt;`Macros.createCodecProviderIgnoreNone&lt;span class=&quot;error&quot;&gt;&amp;#91;Account&amp;#93;&lt;/span&gt;()`&lt;br/&gt;
 &#160;&lt;/p&gt;

&lt;p&gt;generates the following error&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;```&lt;br/&gt;
 match may not be exhaustive.&lt;br/&gt;
 It would fail on the following input: (x: String forSome x not in &quot;Account&quot;)&lt;br/&gt;
&#160; &#160; Macros.createCodecProviderIgnoreNone&lt;span class=&quot;error&quot;&gt;&amp;#91;Account&amp;#93;&lt;/span&gt;()&lt;br/&gt;
 ```&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;We have the scala compiler flags to catch missing cases, but I dont see where in the the expanded code there would be a missing case issue.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks!&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1836560">JAVA-4319</key>
            <summary>&quot;match may not be exhaustive&quot; with Case Class Macros</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="13201">Fixed</resolution>
                                        <assignee username="ross@mongodb.com">Ross Lawley</assignee>
                                    <reporter username="jakeschwartz@zignallabs.com">Jake Schwartz</reporter>
                        <labels>
                            <label>external-user</label>
                    </labels>
                <created>Fri, 30 Jul 2021 15:14:07 +0000</created>
                <updated>Sat, 28 Oct 2023 11:21:01 +0000</updated>
                            <resolved>Tue, 8 Feb 2022 11:17:19 +0000</resolved>
                                                    <fixVersion>4.5.0</fixVersion>
                                    <component>Scala</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4341585" author="ross@10gen.com" created="Tue, 8 Feb 2022 11:17:19 +0000"  >&lt;p&gt;Added the default case class match fix from the &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/pull/847&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;PR #847&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4341579" author="xgen-internal-githook" created="Tue, 8 Feb 2022 11:15:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jake Schwartz&apos;, &apos;email&apos;: &apos;jakehschwartz@gmail.com&apos;, &apos;username&apos;: &apos;jakehschwartz&apos;}
&lt;p&gt;Message: Include default match statement to CaseClassCodec macro&lt;/p&gt;

&lt;p&gt;Also add compile warnings to the build.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-4319&quot; title=&quot;&amp;quot;match may not be exhaustive&amp;quot; with Case Class Macros&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-4319&quot;&gt;&lt;del&gt;JAVA-4319&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/178a0d4cb5d8b8600dd2ae78716d2cf992c1345d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/178a0d4cb5d8b8600dd2ae78716d2cf992c1345d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4270198" author="jakeschwartz@zignallabs.com" created="Wed, 29 Dec 2021 18:57:52 +0000"  >&lt;p&gt;I opened a PR for this:&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/pull/847&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/pull/847&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4089080" author="ross@10gen.com" created="Tue, 28 Sep 2021 13:51:49 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jakeschwartz%40zignallabs.com&quot; class=&quot;user-hover&quot; rel=&quot;jakeschwartz@zignallabs.com&quot;&gt;jakeschwartz@zignallabs.com&lt;/a&gt; for the follow up.&lt;/p&gt;

&lt;p&gt;I&apos;m moving this to open for a future fix.&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                            <comment id="3973132" author="jakeschwartz@zignallabs.com" created="Fri, 30 Jul 2021 16:19:44 +0000"  >&lt;p&gt;Hey, sorry I cant edit the original ticket.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Dug a little deeper, looks like its caused by the `-Xlint:-strict-unsealed-patmat` compiler option, which was introduced in 2.13.4. Removing it makes the code compile&lt;/p&gt;

&lt;p&gt;I am using 2.13.6 in my code.&lt;/p&gt;

&lt;p&gt;I was able to reproduce with the Case Class Primer Quick Start code:&lt;/p&gt;



&lt;p&gt;object Person &lt;/p&gt;
{
&#160; def apply(firstName: String, lastName: String): Person = Person(new ObjectId(), firstName, lastName)
}
&lt;p&gt;final case class Person(_id: ObjectId, firstName: String, lastName: String)&lt;/p&gt;

&lt;p&gt;class MongoTest &lt;/p&gt;
{
&#160; val codecRegistry = fromRegistries(fromProviders(classOf[Person]), DEFAULT_CODEC_REGISTRY )
&#160; val mongoClient: MongoClient = MongoClient()
&#160; val database: MongoDatabase = mongoClient.getDatabase(&quot;mydb&quot;).withCodecRegistry(codecRegistry)
&#160; val collection: MongoCollection[Person] = database.getCollection(&quot;test&quot;)
}</comment>
                            <comment id="3972971" author="ross@10gen.com" created="Fri, 30 Jul 2021 15:24:01 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jakeschwartz%40zignallabs.com&quot; class=&quot;user-hover&quot; rel=&quot;jakeschwartz@zignallabs.com&quot;&gt;jakeschwartz@zignallabs.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the ticket,  could you provide a full example so I can replicate the issue?  Also please let me know what Scala version you are using as well.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Ross&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|hr3n8v:</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>