Clean up and modernize the JRuby extension#3478
Merged
flavorjones merged 2 commits intosparklemotion:mainfrom Mar 23, 2025
Merged
Clean up and modernize the JRuby extension#3478flavorjones merged 2 commits intosparklemotion:mainfrom
flavorjones merged 2 commits intosparklemotion:mainfrom
Conversation
* Recommended changes from IntelliJ, including generic type cleanups, inner classes to lambdas, unused methods deprecated, redundant code eliminated, loops simplified, imports cleaned up, and more. * Added TODOs to calls to JRuby methods deprecated in 10. These have replacements in 10 that will be backported after release. These calls should not be updated to the new versions for at least a year after they are available in JRuby 9.4 releases. This commit should not contain any behavioral changes. All changes here should be simple cleanup and Java style updates.
flavorjones
reviewed
Mar 23, 2025
This is the compilation error I'm trying to fix:
```
ext/java/nokogiri/internals/NokogiriHelpers.java:744: error: cannot find symbol
if (str.isEmpty()) { return str; } // no need to convert
^
symbol: method isEmpty()
location: variable str of type CharSequence
```
Contributor
Author
|
I don't think I'll get back to this for the additional style and form changes for a while (got to get JRuby 10 finished!), so you can merge this when it goes green. |
Member
|
@headius Thanks so much for spending some time cleaning this up! |
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.
This PR will do some cleanup of the JRuby extension.
The first pass will be improvements recommended by IntelliJ plus some TODO comments for deprecated methods in JRuby 10.
Deprecated JRuby calls have replacements in 10 that will soon be backported to JRuby 9.4. These calls should not be updated to use the new API until it has been in the wild in a 9.4 release for at least a year.
Additional passes will update style to match modern JRuby and Java recommendations and include some minor performance improvements.