clone()
returns Object
by default, the correct way to clone an ArrayList
is to use the appropriate constructor:
this.productOrderList = new ArrayList<ViewOrderProduct>(globalOrderProductList);
Edit: The preferred way is to use the appropriate constructor, and both methods only return a shallow copy anyways.
Edit: And there's no other way I'm aware of, to remove the warning using clone()
without a SuppressWarning
.