Skip to content

Commit

Permalink
Allow all @default annotation values for unions (#152)
Browse files Browse the repository at this point in the history
* Refs #21313: Allow all @default annotation values for unions

Signed-off-by: eduponz <eduardoponz@eprosima.com>

* Refs #21313: Apply Miguel's suggestions

Signed-off-by: eduponz <eduardoponz@eprosima.com>

---------

Signed-off-by: eduponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz authored Jul 24, 2024
1 parent 03fbf21 commit 40c8daa
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,12 @@ public int addMember(
* @default annotation. If no one then return \b null.
* @return The union's member that passes the conditions or \b null value.
*/
public Member getDefaultAnnotatedMember() throws RuntimeGenerationException
public Member getDefaultAnnotatedMember()
{
if (m_defaultannotated_index != -1)
{
return getMembers().get(m_defaultannotated_index);
}
else if (discriminator_.isAnnotationDefault())
{
throw new RuntimeGenerationException("UnionTypeCode::getDefaultAnnotatedMember(): Discriminator has a default value but that value was not found in label cases");
}

return null;
}
Expand Down

0 comments on commit 40c8daa

Please sign in to comment.