Martin Boßlet created JRUBY-6634:
------------------------------------
Summary: String.new(string) does not seem to clone the input
Key: JRUBY-6634
URL: https://jira.codehaus.org/browse/JRUBY-6634
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.7
Environment: $ jruby --1.9 -v
jruby 1.7.0.dev (ruby-1.9.3-p6) (2012-01-21 0d0c764) (Java HotSpot(TM) 64-Bit
Server VM 1.7.0_02) [linux-amd64-java]
Reporter: Martin Boßlet
Steps to reproduce:
s = "test"
t = String.new(s)
t.setbyte(0, "r".ord)
p s #=> rest
p t #=> rest
puts s == "rest" #=> true
puts s == "test" #=> false
I was under the impression that s should still be equal to "test", that is t
should be a copy of the contents of s. That's at least what I get in
CRuby(1.9.3)?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.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