org.apache.cxf.jaxrs.ext.multipart.Attachment attachments=null;
List<Attachment> clone = new ArrayList<Attachment>(attachments.size());
for(Object item: attachments)
clone.add((Attachment)item.clone());//The method clone() from the type Object is not visible
Run Code Online (Sandbox Code Playgroud)
我想克隆该List<Attachment> clone对象,但它说来自Object类型的方法clone()是不可见的