News for hackers. Stuff that matters.
Re:Java 11 released by ofrzeta on Wednesday September 26, 2018 @10:18AM (#18076153)
This is also a gem: "Because list is already immutable there's no practical need to actually create a copy of the list-instance, therefore list and copy are the same instance. However if you copy a mutable list, copy is indeed a new instance so it's garanteed there's no side-effects when mutating the original list"

So you can get a "reference" to the same data where one reference gives you the data immutably while the other one lets you change it. Sounds like a recipe for subtle bugs.

Re:Java 11 released by chinhodado on Wednesday September 26, 2018 @01:01PM (#18077969)
> where one reference gives you the data immutably while the other one lets you change it

What do you mean, it's not like that at all. You only get back the same object (same reference) if it detects the object was immutable to begin with.

Re:Java 11 released by ofrzeta on Wednesday September 26, 2018 @01:28PM (#18078257)
Ok, fine. That's just what I got from the quoted text. But I see that was wrong.