Skip to content

Make refine method of Module private#9213

Merged
headius merged 1 commit into
jruby:masterfrom
katafrakt:refine-method-visibility
Feb 4, 2026
Merged

Make refine method of Module private#9213
headius merged 1 commit into
jruby:masterfrom
katafrakt:refine-method-visibility

Conversation

@katafrakt

Copy link
Copy Markdown
Contributor

In MRI refine method is defined as private. But in JRuby it is public leading to inconsistency between the implementations.

irb(main):001> [RUBY_ENGINE, RUBY_VERSION]
=> ["jruby", "3.4.2"]
irb(main):002> Module.instance_methods.include?(:refine)
=> true
irb(main):001> [RUBY_ENGINE, RUBY_VERSION]
=> ["ruby", "3.4.1"]
irb(main):002> Module.instance_methods.include?(:refine)
=> false

@headius

headius commented Feb 4, 2026

Copy link
Copy Markdown
Member

Yup, good catch. We probably should rework "module" visibility to do this by default, since it's almost always the expected behavior.

@headius

headius commented Feb 4, 2026

Copy link
Copy Markdown
Member

Related issue where we made the default visibility for some methods "private" if unspecified: #8210

@headius

headius commented Feb 4, 2026

Copy link
Copy Markdown
Member

The sequel and concurrent-ruby jobs seem to be hanging while bundling... I'm not sure what's up with that but it's unlikely to be related to your change.

@headius headius merged commit 8834b2f into jruby:master Feb 4, 2026
151 of 155 checks passed
@katafrakt katafrakt deleted the refine-method-visibility branch February 4, 2026 20:06
@headius headius added this to the JRuby 10.0.4.0 milestone Feb 4, 2026
@headius

headius commented Feb 4, 2026

Copy link
Copy Markdown
Member

Nevermind what I said about module methods; this is just a normal method that should have had PRIVATE visibility.

@headius

headius commented Feb 5, 2026

Copy link
Copy Markdown
Member

The sequel and concurrent-ruby job fails were due to a bug in #9198 that caused the build to generate broken binstubs. Fixed in f21870a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants