< prev index next >
src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -91,11 +91,11 @@
protected boolean parsed = true;
/**
* Vector of MimeBodyPart objects.
*/
- protected FinalArrayList parts = new FinalArrayList(); // Holds BodyParts
+ protected FinalArrayList<MimeBodyPart> parts = new FinalArrayList<MimeBodyPart>(); // Holds BodyParts
/**
* This field specifies the content-type of this multipart
* object. It defaults to "multipart/mixed".
*/
@@ -210,11 +210,11 @@
throws MessagingException {
parse();
if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart");
- return (MimeBodyPart)parts.get(index);
+ return parts.get(index);
}
/**
* Get the MimeBodyPart referred to by the given ContentID (CID).
* Returns null if the part is not found.
@@ -257,11 +257,11 @@
* might itself want to track whether its internal state actually
* did change, and do the header updating only if necessary.
*/
protected void updateHeaders() throws MessagingException {
for (int i = 0; i < parts.size(); i++)
- ((MimeBodyPart)parts.get(i)).updateHeaders();
+ parts.get(i).updateHeaders();
}
/**
* Iterates through all the parts and outputs each Mime part
* separated by a boundary.
@@ -594,11 +594,11 @@
*/
public void removeBodyPart(int index) {
if (parts == null)
throw new IndexOutOfBoundsException("No such BodyPart");
- MimeBodyPart part = (MimeBodyPart)parts.get(index);
+ MimeBodyPart part = parts.get(index);
parts.remove(index);
part.setParent(null);
}
/**
@@ -607,11 +607,11 @@
*
* @param part The MimeBodyPart to be appended
*/
public synchronized void addBodyPart(MimeBodyPart part) {
if (parts == null)
- parts = new FinalArrayList();
+ parts = new FinalArrayList<MimeBodyPart>();
parts.add(part);
part.setParent(this);
}
@@ -625,11 +625,11 @@
* @param part The MimeBodyPart to be inserted
* @param index Location where to insert the part
*/
public synchronized void addBodyPart(MimeBodyPart part, int index) {
if (parts == null)
- parts = new FinalArrayList();
+ parts = new FinalArrayList<MimeBodyPart>();
parts.add(index,part);
part.setParent(this);
}
< prev index next >