title: FindBugs raises a bug called EI_EXPOSE_REP caused by Array
body: <p>FindBugs raises a bug called EI_EXPOSE_REP with the following description :</p>
  
  <p>EI: May expose internal representation by returning reference to mutable object</p>
  
  <p>Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object. If instances are accessed by untrusted code, and unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. Returning a new copy of the object is a better approach in many situations.</p>
  
  <pre><code>class Person {
      private String[] hobbies;
      String[] getHobbies(){ return hobbies;}
      void setHobbies(String[] hobbies){ this.hobbies = hobbies;}
  }
  </code></pre>
  
  <p>I know some solutions：</p>
  
  <ol>
  <li>getHobbies(){return hobbies.clone();}</li>
  <li>use List instead of Array;</li>
  </ol>
  
  <p>What I want to know is why just array raises this bug, a list doesn't have this problem? Why array is so different from other collections？</p>