Repository navigation
Store MethodGatherer's filtered methods as JDK types - #9895
Merged
Merged
Conversation
It is unchanged, only moved up from the nested class to MethodGatherer, so that the next commit can replace PartitionedMethods without touching it.
FILTERED_DECLARED_METHODS and FILTERED_METHODS are static ClassValues that are also computed for JDK classes, such as java.lang.Object and java.lang.Class. Their PartitionedMethods values are a JRuby class, so the JDK classes kept the class loader that loaded JRuby alive after every runtime in it was torn down. The values are now Method[][], indexed by INSTANCE_METHODS and STATIC_METHODS.
headius
approved these changes
Oct 27, 2026
headius
left a comment
Member
There was a problem hiding this comment.
This is an unfortunate side-effect of ClassValue rooting objects, but can't be helped. The JRuby-specific wrapper class is replaced by the raw Method[][] it contained, which is a system-level class and won't keep JRuby's classloader alive.
7 of 8 tasks
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.
Part of #9781, against
jruby-10.0for the 10.0 LTS line.FILTERED_DECLARED_METHODSandFILTERED_METHODSare staticClassValues, and they're computed for JDK classes too: creating a runtime already computes them forjava.lang.Object,java.lang.Class,java.util.Mapand others. AClassValuestores its value in the class it's computed for. The values werePartitionedMethods, a JRuby class, so the JDK classes, which are never unloaded, kept the class loader that loaded JRuby alive after every runtime in it was torn down.They can't be cleared at teardown, because they're shared by every runtime in the class loader, and they only matter once the whole class loader goes away. Instead, the values are now
Method[][], indexed byINSTANCE_METHODSandSTATIC_METHODS, so what's left on JDK classes only references JDK types.There are two commits:
filterAccessibleout ofPartitionedMethodsintoMethodGatherer, unchanged.git show -wshows only the moved closing brace.PartitionedMethodswithpartitionMethods, which returns theMethod[][].filterAccessibleand its Java 17 handling are untouched.rake spec:jipasses (974 examples, 0 failures, 9 pending).rake spec:ruby:fasthas 1 failure and 4 errors, all IPv6 socket specs that fail the same way on unmodifiedjruby-10.0, because my machine has no IPv6 network.