title: ArrayIndexOutOfBoundsException while converting linkedList to array list
body: <p>Im trying to convert a linkedList into an ArrayList as shown below.</p>
  
  <pre><code>private LinkedList&lt;myData&gt; myLinkedList= new LinkedList&lt;myData&gt;();  
  public Collection&lt;myData&gt; getData()  
   {
    return new ArrayList&lt;myData&gt;(myLinkedList);  
   }
  </code></pre>
  
  <p>The linkedList might be updated by multiple threads. While testing in production I get the below error. The error is not consistant. So i get it may be once in a week, month or so. </p>
  
  <pre><code>java.lang.ArrayIndexOutOfBoundsException: 15   
  at java.util.LinkedList.toArray(LinkedList.java:866)   
  at java.util.ArrayList.&lt;init&gt;(ArrayList.java:131)   
  at org.xxx.yyy.zzz.getData(Data.java:291)  
  </code></pre>
  
  <p>Is there any way it could be related to concurrent modification of the linkedList. Appreciate any help on this. </p>