title: Deep copy of an object array
body: <p>I want to make a deep copy of an object array using a constructor.</p>
  
  <pre><code>public class PositionList {
      private Position[] data = new Position[0];
  
  public PositionList(PositionList other, boolean deepCopy) {
          if (deepCopy){
              size=other.getSize();
              data=new Position[other.data.length];
              for (int i=0;i&lt;data.length;i++){
              data[i]=other.data[i];
              }
  </code></pre>
  
  <p>However, what I have above for some reason is not working. I have automated tests that I run, and its failing those tests. So theres an error an here that Im not sure what it is.</p>