Merged
Conversation
Member
|
I think this should probably check if the enum in question implements Constant before casting, and only use the defined logic in that case. It doesn't look like we use those methods with any non-Constant Enums but since we can't change the public API we should make it work in that case. Otherwise it looks fine. |
Member
|
I realize now that master already did the blind cast to Constant, and I have a different change in mind. This is fine to merge. |
headius
added a commit
that referenced
this pull request
Sep 19, 2020
Previously this was a blind case, followed by silently rejecting non-Constant enums. Better to prevent improper use at the type level. See #6401.
Member
|
I decided to go ahead and fix the constant set logic to enforce the Constants interface at the generic level. Since this method never worked unless the enum in question implemented Constant, I think it's best to just make that restriction explicit. |
headius
added a commit
to headius/jruby
that referenced
this pull request
May 17, 2021
Previously this was a blind case, followed by silently rejecting non-Constant enums. Better to prevent improper use at the type level. See jruby#6401.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.