Skip to content

RUBY-3947 Use RubyFixnum.newFixnum instead of the constructor - #377

Merged
comandeo-mongo merged 2 commits into
mongodb:masterfrom
stefanlew-tractive:RUBY-3947-fixnum-factory
Oct 15, 2026
Merged

comandeo-mongo merged 2 commits into
mongodb:masterfrom
stefanlew-tractive:RUBY-3947-fixnum-factory

Conversation

@stefanlew-tractive

@stefanlew-tractive stefanlew-tractive commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Replace all seven direct RubyFixnum constructor calls in ByteBuf.java
with RubyFixnum.newFixnum(...).

JRuby 10.1 made RubyFixnum abstract as part of its
LongFixnum/ShortFixnum implementation. Direct construction now raises
Java::JavaLang::InstantiationError. The existing factory returns the
appropriate concrete implementation and is also available on older JRuby
versions.

Testing

BSON’s test suite passes on JRuby 10.0.5.0 and 10.1.2.0 with JDK 21.

References

@comandeo-mongo
comandeo-mongo merged commit df6c74a into mongodb:master Oct 15, 2026
52 checks passed
@comandeo-mongo comandeo-mongo added the bug Fixes a bug, with no new features or broken compatibility label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Fixes a bug, with no new features or broken compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants