Skip to content

[ji] align Java array (with post 1.8 conventions)#5700

Merged
enebo merged 3 commits intojruby:masterfrom
kares:ji-array-alignment
Aug 22, 2019
Merged

[ji] align Java array (with post 1.8 conventions)#5700
enebo merged 3 commits intojruby:masterfrom
kares:ji-array-alignment

Conversation

@kares
Copy link
Member

@kares kares commented Apr 17, 2019

  • j_ary = [ 1 ].to_java; j_ary[2] shall raise IndexError (instead of ArgumentError)
  • handle edge cases e.g. [ "a", "b", "c" ].to_java[-10..2] similar to a Ruby Array (nil)

the first one might be considered a bug as well as a breaking change -> maybe target 9.3?

kares added 3 commits April 17, 2019 14:17
a relict from 1.8 times -> Ruby 2.X uses IndexError on Array
wasn't spec-ed and has been erroring when index started before 0
@headius
Copy link
Member

headius commented Aug 19, 2019

This change seems ok to me even for a shorter-term merge. Someone might rely on it raising an error, but I think it would have to be a pretty weird case.

@kares
Copy link
Member Author

kares commented Aug 19, 2019

okay, its fine by me wherever it ends up.
@enebo any objections to have it next 9.2?

@enebo enebo added this to the JRuby 9.2.9.0 milestone Aug 22, 2019
@enebo enebo merged commit 69061d1 into jruby:master Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants