Skip to content

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

Open
stefanlew-tractive wants to merge 1 commit into
mongodb:masterfrom
stefanlew-tractive:RUBY-3947-fixnum-factory
Open

stefanlew-tractive wants to merge 1 commit into
mongodb:masterfrom
stefanlew-tractive:RUBY-3947-fixnum-factory

Conversation

@stefanlew-tractive

Copy link
Copy Markdown

Summary

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

This branch has not been deployed

No deployments
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.

1 participant