Static JavaProxy#getJavaClass needs to clear $! #1636

Merged
merged 1 commit into from Apr 16, 2014

Projects

None yet

2 participants

@dmarcotte
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)

@dmarcotte dmarcotte Static JavaProxy#getJavaClass needs to 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.
fc62c34
@enebo enebo added this to the JRuby 1.7.13 milestone Apr 16, 2014
@enebo enebo merged commit 32ddb15 into jruby:jruby-1_7 Apr 16, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@enebo
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