added the new switch expression usage for jdk equal or greater than 13#4065
added the new switch expression usage for jdk equal or greater than 13#4065bydrim wants to merge 1 commit into
Conversation
|
It seems that the code is not compliant with the formatting rules. Working on it. |
6e20680 to
ca10fcc
Compare
|
I realized that Reformat Code on save was not active on my Intellij. I used git squash to keep the git logs clean, so these are the formatting changes:
|
|
The fail seems to be related to codecov migrating their keybase accounts. Their advice is to use v7, and currently v5 is used in this project. |
|
@bydrim yes the JDK 21 pipline failed because of the issue you referenced. We upgraded the plugin to v7.
|
| <#list valueMappings as valueMapping> | ||
| case <@writeSource source=valueMapping.source/> -> <#if valueMapping.targetAsException > throw new <@includeModel object=unexpectedValueMappingException />( "Unexpected enum constant: " + ${sourceParameter.name} );<#else><@writeTarget target=valueMapping.target/>;</#if> | ||
| </#list> | ||
| default -> <#if defaultTarget.targetAsException >throw new <@includeModel object=unexpectedValueMappingException />( "Unexpected enum constant: " + ${sourceParameter.name} )<#else><@writeTarget target=defaultTarget.target/></#if>; |
There was a problem hiding this comment.
The default branch is only necessary when not all values are explicitly covered by a case.
As described in the issue #4062 for jdk equal or greater than 13 the usage of new switch expression added. Related fixtures are updated. Also as discussed with Filip, for switch expressions with only default case, defaultTarget is directly assigned without switch expression, such as