Commit 5fa34ec
Work around ObjectSpace::WeakMap#values missing on older JRuby
JRuby before 9.3.0.0 does not define ObjectSpace::WeakMap#values
natively (jruby/jruby#6267). Patch it using JRuby's field_reader to
access the underlying Java map. Skip the patch when #values is already
defined (JRuby 9.3.0.0 or higher via jruby/jruby#6683).
Based on the approaches explored in rsim#2360 and
rsim#2413, but guards with method_defined?(:values)
instead of a version check so the workaround is skipped automatically
once JRuby provides the method natively.
Co-Authored-By: Ryudo Awaru <ryudoawaru@gmail.com>
Co-Authored-By: Thomas Steinhausen <27787+iaddict@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent eade869 commit 5fa34ec
1 file changed
Lines changed: 2 additions & 1 deletion
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
855 | | - | |
| 855 | + | |
| 856 | + | |
856 | 857 | | |
857 | 858 | | |
858 | 859 | | |
| |||
0 commit comments