Skip to content

[fix] RubyException#toJava(Object) shouldn't return null#5488

Merged
kares merged 1 commit intomasterfrom
to-java-exception
Dec 3, 2018
Merged

[fix] RubyException#toJava(Object) shouldn't return null#5488
kares merged 1 commit intomasterfrom
to-java-exception

Conversation

@kares
Copy link
Member

@kares kares commented Dec 2, 2018

... a regression since the exception hierarchy rewrite in 9.2
spotted at: sparklemotion/nokogiri#1818

for compat rubyException.toJava(Object.class) shall return self

... a regression since the exception hierarchy rewrite in 9.2
spotted at: sparklemotion/nokogiri#1818

for compat `rubyException.toJava(Object.class)` shall return self
@kares kares added this to the JRuby 9.2.5.0 milestone Dec 2, 2018
Copy link
Member

@headius headius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find!

@kares kares merged commit ddabc04 into master Dec 3, 2018
@kares
Copy link
Member Author

kares commented Dec 3, 2018

NOTE: no strong opinions against changing the behaviour of RubyException#toJava(Object.class) to return a RaiseException ... Nokogiri was able to work-around - to a proper array.entry(i).

this PR simply restores pre 9.2 ... with the new exception hierarchy it might make sense to convert by default. most Java convertable types do the coercion e.g. RubyString#toJava() - java.lang.String

@headius
Copy link
Member

headius commented Dec 3, 2018

I agree with making Object on down all return the throwable. 9.3? @enebo

@enebo
Copy link
Member

enebo commented Dec 3, 2018

@headius @kares yeah I think 9.3 too.

@kares
Copy link
Member Author

kares commented Dec 4, 2018

okay - opened #5498 targeting 9.3 so its not forgotten

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.

3 participants