Is it bad design to pass reference of collections in constructor?
<p>I encounter many times of similar code:</p>

<pre><code>class AClass{
    private Iterable&lt;String&gt; list;
    public AClass(Iterable&lt;String&gt; list){ this.list = list; }
    ...
}
</code></pre>

<p>In this code, a reference of Iterable is passed to AClass directly. The end result is equivalent to directly expose list reference to outside. Even if you make AClass.list final, it still allows code from outside AClass to modify the content of the list, which is bad.</p>

<p>To counter this, we will do a defensive copy in the constructor.</p>

<p>However, this kind of code is very common. Besides performance consideration, what's the intension for people to write this kind of code? </p>
