[ji] support re-reifying class hierarchy#8147
Closed
kares wants to merge 6 commits intojruby:masterfrom
Closed
Conversation
kares
commented
Mar 10, 2024
| final CharSequence name = StringSupport.replaceAll(getName(), "::", "."); | ||
| // we need to include a Class identifier in the Java class name, since a Ruby class might be dropped | ||
| // (using remove_const) and re-created in which case using the same name would cause a conflict... | ||
| return basePackagePrefix + identityHash + '.' + name; // TheFoo::Bar -> rubyobj.320efdf5.TheFoo.Bar |
Member
Author
There was a problem hiding this comment.
and while this works "better" (except for 'breaking' the rubyobj. naming convention) it might still be better to version the name. given patching of a reified class should re-generate the Java class which means there needs to be more classloader-fu or we simply add a v2 suffix and keep the existing loader (previous class is no longer used so should GC away, eventually)
but starting with a simple name that is backwards compatible
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 is an alternative to #8140
the difference is no class-loader magic on re-created reified classes but it changes the Java class naming:
when reified this class would be named:
rubyobj.Bar.Foorubyobj.23e5fef5.Bar.Footo support the case of potential dropping and re-creating a named Ruby class