FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Remove deprecated ObjectSpace#_id2ref by headius · Pull Request #9533 · jruby/jruby · GitHub

/ jruby Public

Remove deprecated ObjectSpace#_id2ref - #9533

Merged
headius merged 5 commits into
jruby:ruby-4.1from
headius:remote_id2ref
Jul 20, 2026
Merged

Remove deprecated ObjectSpace#_id2ref#9533
headius merged 5 commits into
jruby:ruby-4.1from
headius:remote_id2ref

Conversation

headius commented Jul 17, 2026

Copy link
Copy Markdown
Member

Officially removed for Ruby 4.1.

See https://bugs.ruby-lang.org/issues/22135

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

This PR removes JRuby’s implementation of the deprecated ObjectSpace._id2ref API to align with Ruby 4.1 behavior (per ruby-lang bug #22135), and simplifies the internal object-id bookkeeping that existed to support _id2ref.

Changes:

  • Removed ObjectSpace._id2ref method definitions from RubyObjectSpace.
  • Simplified org.jruby.runtime.ObjectSpace by dropping per-object id caching (identitiesByObject) and related id creation helpers.
  • Updated object id initialization to always use the global id generator (ObjectSpace.calculateObjectId()), and removed the corresponding Java test for id2ref.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
core/src/test/java/org/jruby/test/TestObjectSpace.java Removes the Java-level identity/id2ref test that depended on _id2ref-style behavior.
core/src/main/java/org/jruby/runtime/ObjectSpace.java Simplifies id registration and id generation by removing object→id caching.
core/src/main/java/org/jruby/runtime/ivars/VariableTableManager.java Switches object id initialization to always use ObjectSpace.calculateObjectId().
core/src/main/java/org/jruby/RubyObjectSpace.java Removes the Ruby-visible _id2ref entry point.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

headius force-pushed the remote_id2ref branch 3 times, most recently from 6f2613c to aa21ef6 Compare July 17, 2026 21:42
headius requested a review from Copilot July 17, 2026 21:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread test/jruby/test_objectspace.rb Outdated
headius merged commit bfe1e44 into jruby:ruby-4.1 Jul 20, 2026
113 of 134 checks passed
headius deleted the remote_id2ref branch July 20, 2026 13:40

headius commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

Remaining failures are due to Ruby 4.1 functionality that has not yet been implemented.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL