Many "not implemented" methods should respond_to? => false in 1.9 mode
----------------------------------------------------------------------
Key: JRUBY-5747
URL: http://jira.codehaus.org/browse/JRUBY-5747
Project: JRuby
Issue Type: Bug
Components: Ruby 1.9.2
Affects Versions: JRuby 1.6.1
Reporter: Charles Oliver Nutter
Assignee: Charles Oliver Nutter
Fix For: JRuby 1.6.2
In Ruby 1.9, methods that simply raise NotImplementedError now will also
produce "false" for respond_to? checks. The canonical example is "fork", but
there are many others.
Search for rb_f_notimplement in MRI produces the following methods which are
conditionally set to that function pointer. When binding methods, then, the
pointers are compared and used to set a flag on the method's struct.
In JRUBY-5729 I fixed the fork case by adding such a flag on the struct, bound
by AnnotationBinder/TypePopulator, accessible through
isNotImplemented/setNotImplemented. I also added a notImplemented attribute on
the JRubyMethod annotation.
We should try to make all methods that are "not implemented" on JRuby behave
the same way in 1.9 mode as MRI 1.9. Ideally, we could also make all those
methods share a common code body as well. I am exploring possibilities for
doing that, such as defining the methods as native (so they have no body).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email