Skip to content

Static JavaProxy#getJavaClass needs to clear $!#1636

Merged
enebo merged 1 commit intojruby:jruby-1_7from
dmarcotte:test-clear-last-err
Apr 16, 2014
Merged

Static JavaProxy#getJavaClass needs to clear $!#1636
enebo merged 1 commit intojruby:jruby-1_7from
dmarcotte:test-clear-last-err

Conversation

@dmarcotte
Copy link
Contributor

Calls from Ruby which go through the static JavaProxy.getJavaClass (ie. field_writer, field_reader, and field_accessor) can result in $! incorrectly containing a NoMethodError from its attempt to invoke java_class. Ensure we clear it in the catch block.

(I stumbled on this because Minitest was loading all tests up but then executing none of them because '$! wasn't clear)

Calls from Ruby which go through JavaProxy.getJavaClass (ie.
field_writer, field_reader, and field_accessor) can result in $!
incorrectly containing a NoMethodError from its attempt to invoke
"java_class".  Ensure we clear it in the catch block.
@enebo enebo added this to the JRuby 1.7.13 milestone Apr 16, 2014
enebo added a commit that referenced this pull request Apr 16, 2014
Static JavaProxy#getJavaClass needs to clear $!
@enebo enebo merged commit 32ddb15 into jruby:jruby-1_7 Apr 16, 2014
@enebo
Copy link
Member

enebo commented Apr 16, 2014

Seems very reasonable to me and this is beginning of dev cycle. If someone is hoping to look at $! even though there was no raise in this scenario then that is some really weird Ruby JI code...

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.

2 participants