Skip to content

Expand Data initialize empty kwargs fix to Struct#9225

Merged
headius merged 2 commits intojruby:masterfrom
headius:struct_empty_kwargs
Feb 10, 2026
Merged

Expand Data initialize empty kwargs fix to Struct#9225
headius merged 2 commits intojruby:masterfrom
headius:struct_empty_kwargs

Conversation

@headius
Copy link
Member

@headius headius commented Feb 10, 2026

This expands the fix from #9215 to Struct and adds specs.

This expands the fix from jruby#9215 to Struct and creats a
new utility method for checking that keywords were passed AND were
non-empty.

Fixes jruby#9224.
@headius headius added this to the JRuby 10.0.4.0 milestone Feb 10, 2026
@headius headius linked an issue Feb 10, 2026 that may be closed by this pull request
@headius headius merged commit 09e9ecb into jruby:master Feb 10, 2026
79 checks passed
@headius headius self-assigned this Feb 10, 2026
@headius headius deleted the struct_empty_kwargs branch February 11, 2026 00:01
rossroberts-toast added a commit to rossroberts-toast/elasticgraph that referenced this pull request Mar 24, 2026
Upgrades JRuby CI builds from 10.0 to 10.0.4.0 and setup-ruby from
v1.288.0 to v1.295.0 across all workflow files.

JRuby patches updated for 10.0.4.0 compatibility:

- Remove the `< 10.0.4.0` version gate so patches remain active.
- Remove Bug 1 (Data.new splat forwarding) — fixed upstream in
  10.0.4.0 (jruby/jruby#9215, jruby/jruby#9225).
- Keep Bug 2 (Data#to_h/deconstruct on subclasses) — still needed,
  now applied via a Data.define hook since JRuby 10.0.4.0 defines
  to_h directly on each Data.define subclass.
- Work around a new JRuby 10.0.4.0 bug where `include`-ing a module
  in a Data.define block causes subclass instances to have nil fields
  in certain call patterns. Fix by defining instance methods directly
  in the Data.define block instead of using `include InstanceMethods`.
myronmarston pushed a commit to block/elasticgraph that referenced this pull request Mar 25, 2026
* Upgrade to JRuby 10.0.4.0 and setup-ruby v1.295.0

Upgrades JRuby CI builds from 10.0 to 10.0.4.0 and setup-ruby from
v1.288.0 to v1.295.0 across all workflow files.

JRuby patches updated for 10.0.4.0 compatibility:

- Remove the `< 10.0.4.0` version gate so patches remain active.
- Remove Bug 1 (Data.new splat forwarding) — fixed upstream in
  10.0.4.0 (jruby/jruby#9215, jruby/jruby#9225).
- Keep Bug 2 (Data#to_h/deconstruct on subclasses) — still needed,
  now applied via a Data.define hook since JRuby 10.0.4.0 defines
  to_h directly on each Data.define subclass.
- Work around a new JRuby 10.0.4.0 bug where `include`-ing a module
  in a Data.define block causes subclass instances to have nil fields
  in certain call patterns. Fix by defining instance methods directly
  in the Data.define block instead of using `include InstanceMethods`.

* remove specific version pin

* add jruby issue number

* remove unneeded jruby_patches file and unused module InstanceMethods

* remove require deleted jruby patch file
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.

ClassCastException handling kwargs in Struct

1 participant