You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JRuby: jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.71-b00 on 1.8.0-internal-jenkins_2017_07_04_16_04-b00 [linux-x86_64]
Kernel: Linux maruhime 4.13.0-45-generic #50-Ubuntu SMP Wed May 30 08:23:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Distro: Ubuntu 17.10
Expected Behavior
On MRI when getting the to_s of a class or module, the resulting string is a copy and so is safe to be mutated at will, and changing it will have no impact on the to_s of the class/module.
Due to a bug in JRuby 9.2.0.0, mutating the result of `Module#to_s`
actually changes the result of other `Module#to_s` calls to the same
module or class, rather than returning a new `String`.
This broke `AbstractStruct#pr_underscore` which is used when rendering
`#inspect` for structures.
This was already fixed upstream, but as a workaround, let's dup the
String before we mutate it, so as to not trip anyone using this JRuby
version (and to restore Travis to beautiful green).
Issue jruby/jruby#5229
Hello there!
I've found this one while adding JRuby 9.2 to
concurrent-ruby
's travis CI config, see ħere and ruby-concurrency/concurrent-ruby#733 .Environment
jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.71-b00 on 1.8.0-internal-jenkins_2017_07_04_16_04-b00 [linux-x86_64]
Linux maruhime 4.13.0-45-generic #50-Ubuntu SMP Wed May 30 08:23:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 17.10
Expected Behavior
On MRI when getting the
to_s
of a class or module, the resulting string is a copy and so is safe to be mutated at will, and changing it will have no impact on theto_s
of the class/module.Testcase:
MRI output:
Actual Behavior
On JRuby 9.2, mutating the result of
to_s
wrongly changes the actualto_s
of the class/module.JRuby output:
The text was updated successfully, but these errors were encountered: