title: Warning cloning ArrayList in Java
body: <pre><code>public void addProductList(ArrayList&lt;ViewOrderProduct&gt; globalOrderProductList) {
  
      this.productOrderList =  (ArrayList&lt;ViewOrderProduct&gt;)globalOrderProductList.clone();
  }
  </code></pre>
  
  <p>This gives me the warning:</p>
  
  <blockquote>
    <p>Type safety: Unchecked cast from Object to ArrayList</p>
  </blockquote>
  
  <p>I know that I can simply solve the problem adding <code>@SuppressWarnings("unchecked")</code>.</p>
  
  <p>But I want understand the problem. I can be sure that all goes good if I add the suppressWarnings? Is there another solution for this warning?</p>