IO#reopen incorrectly handles self as an argument
-------------------------------------------------
Key: JRUBY-1910
URL: http://jira.codehaus.org/browse/JRUBY-1910
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.1b2
Environment: Latest JRuby 1.1b1
Reporter: Vladimir Sizikov
Consider the following example:
{noformat}
io = File.new("/tmp/test-file", "w+")
p io
io.reopen(io)
p io
{noformat}
MRI prints:
#<File:/tmp/test-file>
#<File:/tmp/test-file>
JRuby prints:
#<File:/tmp/test-file-1>
io-reopen-io-like.rb:24: not open (IOError)
Basically, MRI detects the situation when the argument is equal to self and
returns, while
JRuby closes the original handler and tries to assign the new handler, doing
unnecessary job that leads
to the error.
Fix is coming.
--
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