Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static JavaProxy#getJavaClass needs to clear $! #1636

Merged
merged 1 commit into from Apr 16, 2014

Conversation

Projects
None yet
2 participants
@dmarcotte
Copy link
Contributor

commented Apr 15, 2014

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)

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.

@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

Merge pull request #1636 from dmarcotte/test-clear-last-err
Static JavaProxy#getJavaClass needs to clear $!

@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

This comment has been minimized.

Copy link
Member

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
You can’t perform that action at this time.