Skip to content

[ji] fix java_import when constant exists in Object#8099

Merged
kares merged 1 commit intojruby:masterfrom
kares:fix-java_import-parent
Feb 14, 2024
Merged

[ji] fix java_import when constant exists in Object#8099
kares merged 1 commit intojruby:masterfrom
kares:fix-java_import-parent

Conversation

@kares
Copy link
Member

@kares kares commented Feb 10, 2024

there's a bug with java_import in the sense that it does not set the imported class constant on the target module/class if the Java type has been imported on Object already e.g.

java_import 'java.util.ArrayList'
module Foo
  java_import 'java.util.ArrayList' # :ArrayList constant not set
end
Object.send(:remove_const, :ArrayList)
Foo::ArrayList # should still work but does raise...

@kares kares added this to the JRuby 9.4.6.0 milestone Feb 10, 2024
@kares kares changed the title [ji] fix java_import when constant exists in parent (Object) [ji] fix java_import when constant exists in Object Feb 10, 2024
@kares kares merged commit 48b20fa into jruby:master Feb 14, 2024
@kares kares deleted the fix-java_import-parent branch February 14, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants