You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a bit of a stretch, usually not something that happens in production but still Ruby class removing is not that uncommon.
classSubList < java.util.ArrayListdefinitialize(arg1,arg2)puts"initialize #{self}"super(arg1 + arg2)endendclassSubSubList < SubListendpSubSubList.new(1,2)Object.send(:remove_const,:SubSubList)# ... while parent SubList stays around (if it's removed as well it's not an issue)classSubSubList < SubListendpSubSubList.new(1,2)
Environment Information
Provide at least:
JRuby 9.3.0.0 - 9.4.6.0
Expected Behavior
Script works, reification is able to deal with the removed sub-class while parent was kept
Actual Behavior
Second SubSubList.new will fail:
initialize
#<SubSubList: []>
ArgumentError: wrong number of arguments for constructor
<main> at repro_java_sub_class.rb:26
due (-XreifylogErrors):
2024-03-05T15:10:02.637+01:00 [main] ERROR RubyClass : failed to reify class SubSubList due to:
java.lang.LinkageError: loader org.jruby.util.OneShotClassLoader @1f172892 attempted duplicate class definition for rubyobj.SubSubList. (rubyobj.SubSubList is in unnamed module of loader org.jruby.util.OneShotClassLoader @1f172892, parent loader org.jruby.java.codegen.MultiClassLoader @6ba6557e)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at org.jruby.dist/org.jruby.util.OneShotClassLoader.defineClass(OneShotClassLoader.java:20)
at org.jruby.dist/org.jruby.RubyClass.reify(RubyClass.java:1447)
The text was updated successfully, but these errors were encountered:
This is a bit of a stretch, usually not something that happens in production but still Ruby class removing is not that uncommon.
Environment Information
Provide at least:
Expected Behavior
Actual Behavior
SubSubList.new
will fail:due (
-XreifylogErrors
):The text was updated successfully, but these errors were encountered: