Skip to content

#135 Enum to same enum conversions#136

Open
robert-bor wants to merge 1 commit into
masterfrom
bug-135-enum-to-same-enum-conversions
Open

#135 Enum to same enum conversions#136
robert-bor wants to merge 1 commit into
masterfrom
bug-135-enum-to-same-enum-conversions

Conversation

@robert-bor

Copy link
Copy Markdown
Member

When performing a conversion from an enum to the same enum, the
AnyToEnumConverter is triggered, which performs a full cycle conversion,
using the toString() method of source and the valueOf() of the target
enum.

When the source enum is the same as the target enum and the source enum
has an overridden toString() method, this fails because the value can
not be mapped to the enum.

Instead, the AnyToEnumConverter now checks whether the source is of the
same enum class as the target. If this is the case, the conversion task
is skipped and the source is returned literally.

When performing a conversion from an enum to the same enum, the
AnyToEnumConverter is triggered, which performs a full cycle conversion,
using the toString() method of source and the valueOf() of the target
enum.

When the source enum is the same as the target enum and the source enum
has an overridden toString() method, this fails because the value can
not be mapped to the enum.

Instead, the AnyToEnumConverter now checks whether the source is of the
same enum class as the target. If this is the case, the conversion task
is skipped and the source is returned literally.
@robert-bor
robert-bor requested a review from jeroenvs July 17, 2021 15:06
@codecov

codecov Bot commented Jul 17, 2021

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants