[fix] avoid Class#subclasses deprecation with class.rb ext#8080
Merged
kares merged 1 commit intojruby:masterfrom Feb 3, 2024
Merged
[fix] avoid Class#subclasses deprecation with class.rb ext#8080kares merged 1 commit intojruby:masterfrom
kares merged 1 commit intojruby:masterfrom
Conversation
Member
|
Seems good to me. Should also get a PR in place to simply remove it in 9.5. For that matter, we should consider putting together a PR for 9.5 that removes a whole bunch more deprecated stuff, since most of it has been there for years and years. cc @enebo |
Member
Member
Author
|
Will mérge and open a follow up PR for 9.5. |
d80966d to
15fcd33
Compare
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.
When doing a
require 'jruby/core_ext/class.rb'theClass#subclassesmethod gets re-defined and cause a deprecation warning. Rails 7.x relies on (the Ruby 3.1 feature)Class#subclassescausing a lot of warning under JRuby 9.4.The javadoc should provide an explanation (history of
Class#subclasses), here's the demonstration of the issue:🟢 no warning
🔴
AFTER applying this patch:
The only down-side is that
String.subclasses(one_arg)will now be available even without doing arequire 'jruby/core_ext/class'but than doing that "properly" seemed like a lot of extra work, lmkwyt.