I've often seen the idiom a_dup = [*a] to duplicate arrays. JRuby seems to optimize [*a] to a, which results in a and a_dup pointing to the same array object. Awkward!
a = [1, 2, 3]
a_dup = [*a]
a << 4 # => [1, 2, 3, 4]
a_dup # => [1, 2, 3, 4] ### a_dup should not have been mutated!
This bug appears in at least JRuby 1.7.4 to present. It does not appear in MRI.