New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getClass on enum classes #28985
Fix getClass on enum classes #28985
Conversation
@bot-gradle test this |
I've triggered the following builds for you. Click here to see all build failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -367,6 +367,6 @@ class IsolatableSerializerRegistryTest extends Specification { | |||
} | |||
|
|||
enum EnumType { | |||
FOO, BAR | |||
FOO {}, BAR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Is that enough to force a subtype? Perhaps adding a toString
override might make the intention clearer
Enum constants may be implemented as subclasses, so getClass may be unreliable, e.g. a subclass returns `false` from `isEnum`. This commit fixes a bunch of places where the invalid class was exposed.
4b02fa0
to
ae3912d
Compare
@bot-gradle merge |
Enum constants may be implemented as subclasses, so getClass may be
unreliable, e.g. a subclass returns
false
fromisEnum
. This commitfixes a bunch of places where the invalid class was exposed.
Reviewing cheatsheet
Before merging the PR, comments starting with