summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/javax
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax')
-rw-r--r--libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java51
-rw-r--r--libjava/classpath/javax/security/auth/kerberos/KeyImpl.java9
-rw-r--r--libjava/classpath/javax/swing/text/html/HTMLEditorKit.java2
-rw-r--r--libjava/classpath/javax/swing/text/html/HTMLWriter.java38
-rw-r--r--libjava/classpath/javax/swing/text/html/ImageView.java3
-rw-r--r--libjava/classpath/javax/swing/text/html/MinimalHTMLWriter.java17
-rw-r--r--libjava/classpath/javax/swing/text/html/MultiAttributeSet.java8
-rw-r--r--libjava/classpath/javax/swing/text/html/MultiStyle.java4
-rw-r--r--libjava/classpath/javax/swing/text/html/ObjectView.java2
-rw-r--r--libjava/classpath/javax/swing/text/html/StyleSheet.java31
-rw-r--r--libjava/classpath/javax/swing/text/html/TableView.java1
-rw-r--r--libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java14
-rw-r--r--libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java4
-rw-r--r--libjava/classpath/javax/swing/tree/TreeNode.java1
-rw-r--r--libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java8
-rw-r--r--libjava/classpath/javax/swing/undo/StateEdit.java2
-rw-r--r--libjava/classpath/javax/swing/undo/UndoableEditSupport.java6
-rw-r--r--libjava/classpath/javax/xml/stream/XMLEventFactory.java10
-rw-r--r--libjava/classpath/javax/xml/stream/XMLInputFactory.java7
-rw-r--r--libjava/classpath/javax/xml/stream/XMLOutputFactory.java46
-rw-r--r--libjava/classpath/javax/xml/stream/events/Namespace.java2
-rw-r--r--libjava/classpath/javax/xml/stream/util/StreamReaderDelegate.java (renamed from libjava/classpath/javax/xml/stream/util/ReaderDelegate.java)10
22 files changed, 171 insertions, 105 deletions
diff --git a/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java b/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java
index 85e25374987..ff70b9f4e37 100644
--- a/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java
+++ b/libjava/classpath/javax/security/auth/kerberos/KerberosTicket.java
@@ -54,7 +54,7 @@ import javax.security.auth.Refreshable;
* This class represents a Kerberos ticket. See the Kerberos
* authentication RFC for more information:
* <a href="http://www.ietf.org/rfc/rfc1510.txt">RFC 1510</a>.
- *
+ *
* @since 1.4
*/
public class KerberosTicket
@@ -86,16 +86,16 @@ public class KerberosTicket
/**
* Create a new ticket given all the facts about it.
- *
+ *
* Note that flags may be null or "short"; any flags not specified
* will be taken to be false.
- *
+ *
* If the key is not renewable, then renewTill may be null.
- *
+ *
* If authTime is null, then it is taken to be the same as startTime.
- *
+ *
* If clientAddresses is null, then the ticket can be used anywhere.
- *
+ *
* @param asn1Encoding the contents of the ticket, as ASN1
* @param client the client principal
* @param server the server principal
@@ -279,7 +279,7 @@ public class KerberosTicket
{
return (Date) startTime.clone();
}
-
+
/**
* Return the end time for this ticket.
*/
@@ -287,7 +287,7 @@ public class KerberosTicket
{
return (Date) endTime.clone();
}
-
+
/**
* Return the renewal time for this ticket. For a non-renewable
* ticket, this will return null.
@@ -334,6 +334,39 @@ public class KerberosTicket
public String toString()
{
- return "FIXME bob";
+ return getClass().getName() +
+ "[client=" + client +
+ ",server=" + server +
+ ",sessionKey=" + sessionKey +
+ ",flags=" + flags +
+ ",authTime=" + authTime +
+ ",startTime= " + startTime +
+ ",endTime=" + endTime +
+ ",renewTill=" + renewTill +
+ ",clientAddresses=" + clientAddresses +
+ "]";
+ }
+
+ /**
+ * <p>
+ * Returns the type of the session key in accordance with
+ * RFC1510. This usually corresponds to the encryption
+ * algorithm used by the key, though more than one algorithm
+ * may use the same key type (e.g. DES with different checksum
+ * mechanisms and chaining modes). Negative values are reserved
+ * for local use. Non-negative values are for officially assigned
+ * type fields. The RFC defines:
+ * </p>
+ * <ul>
+ * <li>0 &mdash; null</li>
+ * <li>1 &mdash; DES (in CBC mode with either MD4 or MD5 checksums)</li>
+ * </ul>
+ *
+ * @return the type of session key used by this ticket.
+ */
+ public final int getSessionKeyType()
+ {
+ return sessionKey.type;
}
+
}
diff --git a/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java b/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java
index 6773dfa3e87..a7cf3d212c9 100644
--- a/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java
+++ b/libjava/classpath/javax/security/auth/kerberos/KeyImpl.java
@@ -90,4 +90,13 @@ final class KeyImpl implements Serializable, SecretKey
// FIXME.
return null;
}
+
+ public String toString()
+ {
+ return getClass().getName() +
+ "[type=" + type +
+ ",algorithm=" + algorithm +
+ "]";
+ }
+
}
diff --git a/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java b/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
index cc61889d76f..45381d60e87 100644
--- a/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
+++ b/libjava/classpath/javax/swing/text/html/HTMLEditorKit.java
@@ -1454,7 +1454,7 @@ public class HTMLEditorKit
try
{
styleSheet = new StyleSheet();
- Class c = HTMLEditorKit.class;
+ Class<?> c = HTMLEditorKit.class;
InputStream in = c.getResourceAsStream(DEFAULT_CSS);
InputStreamReader r = new InputStreamReader(in);
styleSheet.loadRules(r, null);
diff --git a/libjava/classpath/javax/swing/text/html/HTMLWriter.java b/libjava/classpath/javax/swing/text/html/HTMLWriter.java
index 6cc23df9aab..6a5e6ed58fe 100644
--- a/libjava/classpath/javax/swing/text/html/HTMLWriter.java
+++ b/libjava/classpath/javax/swing/text/html/HTMLWriter.java
@@ -79,9 +79,9 @@ public class HTMLWriter
private HTMLDocument htmlDoc = null;
/**
- * Used to keep track of which embeded has been written out.
+ * Used to keep track of which embedded has been written out.
*/
- private HashSet openEmbededTagHashSet = null;
+ private HashSet<HTML.Tag> openEmbeddedTagHashSet = null;
private String new_line_str = "" + NEWLINE;
@@ -95,7 +95,7 @@ public class HTMLWriter
private int doc_len = -1;
private int doc_offset_remaining = -1;
private int doc_len_remaining = -1;
- private HashSet htmlFragmentParentHashSet = null;
+ private HashSet<Element> htmlFragmentParentHashSet = null;
private Element startElem = null;
private Element endElem = null;
private boolean fg_pass_start_elem = false;
@@ -112,7 +112,7 @@ public class HTMLWriter
super(writer, doc);
outWriter = writer;
htmlDoc = doc;
- openEmbededTagHashSet = new HashSet();
+ openEmbeddedTagHashSet = new HashSet<HTML.Tag>();
} // public HTMLWriter(Writer writer, HTMLDocument doc)
/**
@@ -129,13 +129,13 @@ public class HTMLWriter
super(writer, doc, pos, len);
outWriter = writer;
htmlDoc = doc;
- openEmbededTagHashSet = new HashSet();
+ openEmbeddedTagHashSet = new HashSet<HTML.Tag>();
doc_pos = pos;
doc_offset_remaining = pos;
doc_len = len;
doc_len_remaining = len;
- htmlFragmentParentHashSet = new HashSet();
+ htmlFragmentParentHashSet = new HashSet<Element>();
} // public HTMLWriter(Writer writer, HTMLDocument doc, int pos, int len)
/**
@@ -197,7 +197,8 @@ public class HTMLWriter
} // else
// NOTE: close out remaining open embeded tags.
- Object[] tag_arr = openEmbededTagHashSet.toArray();
+ HTML.Tag[] tag_arr =
+ openEmbeddedTagHashSet.toArray(new HTML.Tag[openEmbeddedTagHashSet.size()]);
for (int i = 0; i < tag_arr.length; i++)
{
@@ -219,8 +220,8 @@ public class HTMLWriter
protected void writeAttributes(AttributeSet attrSet)
throws IOException
{
- Enumeration attrNameEnum = attrSet.getAttributeNames();
-
+ Enumeration<?> attrNameEnum = attrSet.getAttributeNames();
+
while (attrNameEnum.hasMoreElements())
{
Object key = attrNameEnum.nextElement();
@@ -502,7 +503,7 @@ public class HTMLWriter
protected void writeEmbeddedTags(AttributeSet attrSet)
throws IOException
{
- Enumeration attrNameEnum = attrSet.getAttributeNames();
+ Enumeration<?> attrNameEnum = attrSet.getAttributeNames();
while (attrNameEnum.hasMoreElements())
{
@@ -511,12 +512,12 @@ public class HTMLWriter
if (key instanceof HTML.Tag)
{
- if (!openEmbededTagHashSet.contains(key))
+ if (!openEmbeddedTagHashSet.contains(key))
{
writeRaw("<" + key);
writeAttributes((AttributeSet) value);
writeRaw(">");
- openEmbededTagHashSet.add(key);
+ openEmbeddedTagHashSet.add((HTML.Tag) key);
} // if(!openEmbededTagHashSet.contains(key))
} // if(key instanceof HTML.Tag)
} // while(attrNameEnum.hasMoreElements())
@@ -535,16 +536,17 @@ public class HTMLWriter
protected void closeOutUnwantedEmbeddedTags(AttributeSet attrSet)
throws IOException
{
- Object[] tag_arr = openEmbededTagHashSet.toArray();
+ HTML.Tag[] tag_arr =
+ openEmbeddedTagHashSet.toArray(new HTML.Tag[openEmbeddedTagHashSet.size()]);
for (int i = 0; i < tag_arr.length; i++)
{
- HTML.Tag key = (HTML.Tag) tag_arr[i];
+ HTML.Tag key = tag_arr[i];
if (!attrSet.isDefined(key))
{
writeRaw("</" + key.toString() + ">");
- openEmbededTagHashSet.remove(key);
+ openEmbeddedTagHashSet.remove(key);
} // if(!attrSet.isDefined(key))
} // for(int i = 0; i < tag_arr.length; i++)
@@ -645,7 +647,7 @@ public class HTMLWriter
if (matchNameAttribute(attrSet, HTML.Tag.TITLE))
{
boolean fg_is_end_tag = false;
- Enumeration attrNameEnum = attrSet.getAttributeNames();
+ Enumeration<?> attrNameEnum = attrSet.getAttributeNames();
while (attrNameEnum.hasMoreElements())
{
@@ -860,7 +862,7 @@ public class HTMLWriter
if (matchNameAttribute(attrSet, HTML.Tag.TITLE))
{
boolean fg_is_end_tag = false;
- Enumeration attrNameEnum = attrSet.getAttributeNames();
+ Enumeration<?> attrNameEnum = attrSet.getAttributeNames();
while (attrNameEnum.hasMoreElements())
{
@@ -996,7 +998,7 @@ public class HTMLWriter
private void writeAllAttributes(AttributeSet attrSet)
throws IOException
{
- Enumeration attrNameEnum = attrSet.getAttributeNames();
+ Enumeration<?> attrNameEnum = attrSet.getAttributeNames();
while (attrNameEnum.hasMoreElements())
{
diff --git a/libjava/classpath/javax/swing/text/html/ImageView.java b/libjava/classpath/javax/swing/text/html/ImageView.java
index bf906e4500e..bb6af4f451f 100644
--- a/libjava/classpath/javax/swing/text/html/ImageView.java
+++ b/libjava/classpath/javax/swing/text/html/ImageView.java
@@ -323,8 +323,6 @@ public class ImageView extends View
*/
public float getPreferredSpan(int axis)
{
- AttributeSet attrs = getAttributes();
-
Image image = getImage();
if (axis == View.X_AXIS)
@@ -522,7 +520,6 @@ public class ImageView extends View
Image newIm = getImage();
if (newIm != null)
{
- AttributeSet atts = getAttributes();
// Fetch width.
Length l = spans[X_AXIS];
if (l != null)
diff --git a/libjava/classpath/javax/swing/text/html/MinimalHTMLWriter.java b/libjava/classpath/javax/swing/text/html/MinimalHTMLWriter.java
index acb2c04acc2..9f5f019fa37 100644
--- a/libjava/classpath/javax/swing/text/html/MinimalHTMLWriter.java
+++ b/libjava/classpath/javax/swing/text/html/MinimalHTMLWriter.java
@@ -48,8 +48,9 @@ import javax.swing.text.Style;
import javax.swing.text.StyledDocument;
import java.io.Writer;
import java.io.IOException;
+import java.util.ArrayDeque;
+import java.util.Deque;
import java.util.Enumeration;
-import java.util.Stack;
import java.awt.Color;
/**
@@ -61,7 +62,7 @@ import java.awt.Color;
public class MinimalHTMLWriter extends AbstractWriter
{
private StyledDocument doc;
- private Stack tagStack;
+ private Deque<String> tagStack;
private boolean inFontTag = false;
/**
@@ -73,7 +74,7 @@ public class MinimalHTMLWriter extends AbstractWriter
{
super(w, doc);
this.doc = doc;
- tagStack = new Stack();
+ tagStack = new ArrayDeque<String>();
}
/**
@@ -87,7 +88,7 @@ public class MinimalHTMLWriter extends AbstractWriter
{
super(w, doc, pos, len);
this.doc = doc;
- tagStack = new Stack();
+ tagStack = new ArrayDeque<String>();
}
/**
@@ -315,7 +316,7 @@ public class MinimalHTMLWriter extends AbstractWriter
{
if(doc instanceof DefaultStyledDocument)
{
- Enumeration styles = ((DefaultStyledDocument)doc).getStyleNames();
+ Enumeration<?> styles = ((DefaultStyledDocument)doc).getStyleNames();
while(styles.hasMoreElements())
writeStyle(doc.getStyle((String)styles.nextElement()));
}
@@ -332,7 +333,7 @@ public class MinimalHTMLWriter extends AbstractWriter
*/
protected void writeAttributes(AttributeSet attr) throws IOException
{
- Enumeration attribs = attr.getAttributeNames();
+ Enumeration<?> attribs = attr.getAttributeNames();
while(attribs.hasMoreElements())
{
Object attribName = attribs.nextElement();
@@ -422,8 +423,8 @@ public class MinimalHTMLWriter extends AbstractWriter
*/
private void endOpenTags() throws IOException
{
- while(!tagStack.empty())
- write((String)tagStack.pop());
+ while(tagStack.size() > 0)
+ write(tagStack.pop());
if( inFontTag() )
{
diff --git a/libjava/classpath/javax/swing/text/html/MultiAttributeSet.java b/libjava/classpath/javax/swing/text/html/MultiAttributeSet.java
index 0f1145084e1..296144460ac 100644
--- a/libjava/classpath/javax/swing/text/html/MultiAttributeSet.java
+++ b/libjava/classpath/javax/swing/text/html/MultiAttributeSet.java
@@ -57,7 +57,7 @@ class MultiAttributeSet
* The Enumeration for the multiplexed names.
*/
private class MultiNameEnumeration
- implements Enumeration
+ implements Enumeration<Object>
{
/**
* The index of the current AttributeSet.
@@ -67,7 +67,7 @@ class MultiAttributeSet
/**
* The names Enumeration of the current AttributeSet.
*/
- private Enumeration current;
+ private Enumeration<?> current;
/**
* Creates a new instance.
@@ -147,7 +147,7 @@ class MultiAttributeSet
public boolean containsAttributes(AttributeSet attributes)
{
boolean ret = true;
- Enumeration e = attributes.getAttributeNames();
+ Enumeration<?> e = attributes.getAttributeNames();
while (ret && e.hasMoreElements())
{
Object key = e.nextElement();
@@ -186,7 +186,7 @@ class MultiAttributeSet
return n;
}
- public Enumeration getAttributeNames()
+ public Enumeration<?> getAttributeNames()
{
return new MultiNameEnumeration();
}
diff --git a/libjava/classpath/javax/swing/text/html/MultiStyle.java b/libjava/classpath/javax/swing/text/html/MultiStyle.java
index 3937bff75a9..2f43a19c282 100644
--- a/libjava/classpath/javax/swing/text/html/MultiStyle.java
+++ b/libjava/classpath/javax/swing/text/html/MultiStyle.java
@@ -51,7 +51,7 @@ import javax.swing.text.Style;
*
* @author Roman Kennke (kennke@aicas.com)
*/
-public class MultiStyle
+class MultiStyle
extends MultiAttributeSet
implements Style
{
@@ -118,7 +118,7 @@ public class MultiStyle
attributes.removeAttribute(name);
}
- public void removeAttributes(Enumeration names)
+ public void removeAttributes(Enumeration<?> names)
{
attributes.removeAttribute(names);
}
diff --git a/libjava/classpath/javax/swing/text/html/ObjectView.java b/libjava/classpath/javax/swing/text/html/ObjectView.java
index d6a77c06aad..9d900441bb1 100644
--- a/libjava/classpath/javax/swing/text/html/ObjectView.java
+++ b/libjava/classpath/javax/swing/text/html/ObjectView.java
@@ -88,7 +88,7 @@ public class ObjectView extends ComponentView
String classId = (String) atts.getAttribute("classid");
try
{
- Class objectClass = Class.forName(classId);
+ Class<?> objectClass = Class.forName(classId);
Object instance = objectClass.newInstance();
comp = (Component) instance;
}
diff --git a/libjava/classpath/javax/swing/text/html/StyleSheet.java b/libjava/classpath/javax/swing/text/html/StyleSheet.java
index 08578c80fad..c4ddddb7395 100644
--- a/libjava/classpath/javax/swing/text/html/StyleSheet.java
+++ b/libjava/classpath/javax/swing/text/html/StyleSheet.java
@@ -369,7 +369,7 @@ public class StyleSheet extends StyleContext
*
* @return the resolved style
*/
- private Style getResolvedStyle(String selector, List path, HTML.Tag tag)
+ private Style getResolvedStyle(String selector, List<Element> path, HTML.Tag tag)
{
Style style = resolvedStyles.get(selector);
if (style == null)
@@ -380,7 +380,7 @@ public class StyleSheet extends StyleContext
/**
* Resolves a style. This creates arrays that hold the tag names,
* class and id attributes and delegates the work to
- * {@link #resolveStyle(String, String[], Map[])}.
+ * {@link #resolveStyle(String, String[], List<Map<String,String>>)}.
*
* @param selector the selector
* @param path the Element path
@@ -388,14 +388,15 @@ public class StyleSheet extends StyleContext
*
* @return the resolved style
*/
- private Style resolveStyle(String selector, List path, HTML.Tag tag)
+ private Style resolveStyle(String selector, List<Element> path, HTML.Tag tag)
{
int count = path.size();
String[] tags = new String[count];
- Map[] attributes = new Map[count];
+ List<Map<String,String>> attributes =
+ new ArrayList<Map<String,String>>(count);
for (int i = 0; i < count; i++)
{
- Element el = (Element) path.get(i);
+ Element el = path.get(i);
AttributeSet atts = el.getAttributes();
if (i == 0 && el.isLeaf())
{
@@ -413,12 +414,11 @@ public class StyleSheet extends StyleContext
tags[i] = t.toString();
else
tags[i] = null;
- attributes[i] = attributeSetToMap(atts);
+ attributes.set(i, attributeSetToMap(atts));
}
else
{
tags[i] = null;
- attributes[i] = null;
}
}
tags[0] = tag.toString();
@@ -434,7 +434,8 @@ public class StyleSheet extends StyleContext
*
* @return the resolved style
*/
- private Style resolveStyle(String selector, String[] tags, Map[] attributes)
+ private Style resolveStyle(String selector, String[] tags,
+ List<Map<String,String>> attributes)
{
// FIXME: This style resolver is not correct. But it works good enough for
// the default.css.
@@ -462,10 +463,8 @@ public class StyleSheet extends StyleContext
// Sort selectors.
Collections.sort(styles);
- Style[] styleArray = new Style[styles.size()];
- styleArray = (Style[]) styles.toArray(styleArray);
- Style resolved = new MultiStyle(selector,
- (Style[]) styles.toArray(styleArray));
+ Style[] styleArray = styles.toArray(new Style[styles.size()]);
+ Style resolved = new MultiStyle(selector, styleArray);
resolvedStyles.put(selector, resolved);
return resolved;
}
@@ -481,9 +480,9 @@ public class StyleSheet extends StyleContext
public Style getRule(String selector)
{
CSSStyle best = null;
- for (Iterator i = css.iterator(); i.hasNext();)
+ for (Iterator<CSSStyle> i = css.iterator(); i.hasNext();)
{
- CSSStyle style = (CSSStyle) i.next();
+ CSSStyle style = i.next();
if (style.compareTo(best) < 0)
best = style;
}
@@ -584,7 +583,7 @@ public class StyleSheet extends StyleContext
public void addStyleSheet(StyleSheet ss)
{
if (linked == null)
- linked = new ArrayList();
+ linked = new ArrayList<StyleSheet>();
linked.add(ss);
}
@@ -1441,7 +1440,7 @@ public class StyleSheet extends StyleContext
*
* @return the converted map
*/
- private Map attributeSetToMap(AttributeSet atts)
+ private Map<String,String> attributeSetToMap(AttributeSet atts)
{
HashMap<String,String> map = new HashMap<String,String>();
Enumeration<?> keys = atts.getAttributeNames();
diff --git a/libjava/classpath/javax/swing/text/html/TableView.java b/libjava/classpath/javax/swing/text/html/TableView.java
index f87d7b35fc5..912240c28c4 100644
--- a/libjava/classpath/javax/swing/text/html/TableView.java
+++ b/libjava/classpath/javax/swing/text/html/TableView.java
@@ -181,7 +181,6 @@ class TableView
int spans[])
{
updateGrid();
- int numCols = offsets.length;
int realColumn = 0;
int colCount = getViewCount();
for (int i = 0; i < numColumns;)
diff --git a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
index 34a70c19b59..e4cc97838a9 100644
--- a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
+++ b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java
@@ -293,6 +293,7 @@ public class DefaultMutableTreeNode
*
* @return an enumeration of tree nodes
*/
+ @SuppressWarnings("unchecked") // Required for API compatibility
public Enumeration children()
{
if (children.size() == 0)
@@ -320,7 +321,7 @@ public class DefaultMutableTreeNode
*/
public TreeNode getChildAt(int index)
{
- return (TreeNode) children.elementAt(index);
+ return children.elementAt(index);
}
/**
@@ -717,6 +718,7 @@ public class DefaultMutableTreeNode
*
* @return Enumeration
*/
+ @SuppressWarnings("unchecked") // Required for API compatibility
public Enumeration preorderEnumeration()
{
return new PreorderEnumeration(this);
@@ -727,6 +729,7 @@ public class DefaultMutableTreeNode
*
* @return Enumeration
*/
+ @SuppressWarnings("unchecked") // Required for API compatibility
public Enumeration postorderEnumeration()
{
return new PostorderEnumeration(this);
@@ -737,6 +740,7 @@ public class DefaultMutableTreeNode
*
* @return Enumeration
*/
+ @SuppressWarnings("unchecked") // Required for API compatibility
public Enumeration breadthFirstEnumeration()
{
return new BreadthFirstEnumeration(this);
@@ -747,6 +751,7 @@ public class DefaultMutableTreeNode
*
* @return Enumeration
*/
+ @SuppressWarnings("unchecked") // Required for API compatibility
public Enumeration depthFirstEnumeration()
{
return postorderEnumeration();
@@ -759,6 +764,7 @@ public class DefaultMutableTreeNode
*
* @return Enumeration
*/
+ @SuppressWarnings("unchecked") // Required for API compatibility
public Enumeration pathFromAncestorEnumeration(TreeNode node)
{
if (node == null)
@@ -806,7 +812,7 @@ public class DefaultMutableTreeNode
*/
public TreeNode getFirstChild()
{
- return (TreeNode) children.firstElement();
+ return children.firstElement();
}
/**
@@ -818,7 +824,7 @@ public class DefaultMutableTreeNode
*/
public TreeNode getLastChild()
{
- return (TreeNode) children.lastElement();
+ return children.lastElement();
}
/**
@@ -1036,7 +1042,7 @@ public class DefaultMutableTreeNode
public int getLeafCount()
{
int count = 0;
- Enumeration e = depthFirstEnumeration();
+ Enumeration<?> e = depthFirstEnumeration();
while (e.hasMoreElements())
{
diff --git a/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java b/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
index 488809e0232..89f05d31c01 100644
--- a/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/FixedHeightLayoutCache.java
@@ -484,7 +484,7 @@ public class FixedHeightLayoutCache
{
if (dirty)
update();
- Vector p = new Vector(parentPath.getPathCount());
+ Vector<TreePath> p = new Vector<TreePath>(parentPath.getPathCount());
Object node;
NodeRecord nr;
@@ -493,7 +493,7 @@ public class FixedHeightLayoutCache
node = parentPath.getPathComponent(i);
nr = nodes.get(node);
if (nr.row >= 0)
- p.add(node);
+ p.add((TreePath) node);
}
return p.elements();
}
diff --git a/libjava/classpath/javax/swing/tree/TreeNode.java b/libjava/classpath/javax/swing/tree/TreeNode.java
index ae7380c703b..53d52f0a7cb 100644
--- a/libjava/classpath/javax/swing/tree/TreeNode.java
+++ b/libjava/classpath/javax/swing/tree/TreeNode.java
@@ -107,6 +107,7 @@ public interface TreeNode
*
* @return An enumeration of the children of this node.
*/
+ @SuppressWarnings("unchecked") // Required for API compatibility
Enumeration children();
}
diff --git a/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java b/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
index 50e8e5ce92e..aac68692edc 100644
--- a/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
+++ b/libjava/classpath/javax/swing/tree/VariableHeightLayoutCache.java
@@ -381,10 +381,10 @@ public class VariableHeightLayoutCache
TreePath path = null;
// Search row in the nodes map. TODO: This is inefficient, optimize this.
- Enumeration nodesEnum = nodes.elements();
+ Enumeration<NodeRecord> nodesEnum = nodes.elements();
while (nodesEnum.hasMoreElements() && path == null)
{
- NodeRecord record = (NodeRecord) nodesEnum.nextElement();
+ NodeRecord record = nodesEnum.nextElement();
if (record.row == row)
path = record.getPath();
}
@@ -498,7 +498,7 @@ public class VariableHeightLayoutCache
{
if (dirty)
update();
- Vector p = new Vector(parentPath.getPathCount());
+ Vector<TreePath> p = new Vector<TreePath>(parentPath.getPathCount());
Object node;
NodeRecord nr;
@@ -507,7 +507,7 @@ public class VariableHeightLayoutCache
node = parentPath.getPathComponent(i);
nr = nodes.get(node);
if (nr != null && nr.row >= 0)
- p.add(node);
+ p.add((TreePath) node);
}
return p.elements();
}
diff --git a/libjava/classpath/javax/swing/undo/StateEdit.java b/libjava/classpath/javax/swing/undo/StateEdit.java
index 55282ab37c8..a032d02cdb8 100644
--- a/libjava/classpath/javax/swing/undo/StateEdit.java
+++ b/libjava/classpath/javax/swing/undo/StateEdit.java
@@ -248,7 +248,7 @@ public class StateEdit
*/
protected void removeRedundantState()
{
- Iterator i = preState.keySet().iterator();
+ Iterator<Object> i = preState.keySet().iterator();
while (i.hasNext())
{
Object key = i.next();
diff --git a/libjava/classpath/javax/swing/undo/UndoableEditSupport.java b/libjava/classpath/javax/swing/undo/UndoableEditSupport.java
index b5a93341954..2e5d909543a 100644
--- a/libjava/classpath/javax/swing/undo/UndoableEditSupport.java
+++ b/libjava/classpath/javax/swing/undo/UndoableEditSupport.java
@@ -167,7 +167,7 @@ public class UndoableEditSupport
protected void _postEdit(UndoableEdit edit)
{
UndoableEditEvent event;
- Iterator iter;
+ Iterator<UndoableEditListener> iter;
// Do nothing if we have no listeners.
if (listeners.isEmpty())
@@ -181,9 +181,9 @@ public class UndoableEditSupport
// Iterator, a java.util.ConcurrentModificationException; in the
// case of a direct loop over the Vector elements, some
// index-out-of-bounds exception).
- iter = ((Vector) listeners.clone()).iterator();
+ iter = new Vector<UndoableEditListener>(listeners).iterator();
while (iter.hasNext())
- ((UndoableEditListener) iter.next()).undoableEditHappened(event);
+ iter.next().undoableEditHappened(event);
}
diff --git a/libjava/classpath/javax/xml/stream/XMLEventFactory.java b/libjava/classpath/javax/xml/stream/XMLEventFactory.java
index 30e160793b9..7e7a98140a7 100644
--- a/libjava/classpath/javax/xml/stream/XMLEventFactory.java
+++ b/libjava/classpath/javax/xml/stream/XMLEventFactory.java
@@ -1,5 +1,5 @@
/* XMLEventFactory.java --
- Copyright (C) 2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 2005,2006,2009 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -94,8 +94,14 @@ public abstract class XMLEventFactory
* system resource</li>
* <li>the default factory class</li>
* </ol>
+ * @param factoryId name of the factory to find, same as a property name
+ * @param classLoader the class loader to use
+ * @return the factory implementation
+ * @exception FactoryConfigurationError if an instance of this factory
+ * cannot be loaded
*/
- static XMLEventFactory newInstance(String factoryId, ClassLoader classLoader)
+ public static XMLEventFactory newInstance(String factoryId,
+ ClassLoader classLoader)
throws FactoryConfigurationError
{
ClassLoader loader = classLoader;
diff --git a/libjava/classpath/javax/xml/stream/XMLInputFactory.java b/libjava/classpath/javax/xml/stream/XMLInputFactory.java
index 437bf83b5ec..e57449d7716 100644
--- a/libjava/classpath/javax/xml/stream/XMLInputFactory.java
+++ b/libjava/classpath/javax/xml/stream/XMLInputFactory.java
@@ -1,5 +1,5 @@
/* XMLInputFactory.java --
- Copyright (C) 2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 2005,2006,2009 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -206,6 +206,11 @@ public abstract class XMLInputFactory
* system resource</li>
* <li>the default factory class</li>
* </ol>
+ * @param factoryId name of the factory, same as a property name
+ * @param classLoader the class loader to use
+ * @return the factory implementation
+ * @exception FactoryConfigurationError if an instance of this factory
+ * cannot be loaded
*/
public static XMLInputFactory newInstance(String factoryId,
ClassLoader classLoader)
diff --git a/libjava/classpath/javax/xml/stream/XMLOutputFactory.java b/libjava/classpath/javax/xml/stream/XMLOutputFactory.java
index 908f84f262a..ef89b6497bd 100644
--- a/libjava/classpath/javax/xml/stream/XMLOutputFactory.java
+++ b/libjava/classpath/javax/xml/stream/XMLOutputFactory.java
@@ -1,5 +1,5 @@
/* XMLOutputFactory.java --
- Copyright (C) 2005,2006 Free Software Foundation, Inc.
+ Copyright (C) 2005,2006,2009 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -86,6 +86,16 @@ public abstract class XMLOutputFactory
/**
* Creates a new <b>output</b> factory.
+ * @see #newInstance(String,ClassLoader)
+ */
+ public static XMLOutputFactory newInstance()
+ throws FactoryConfigurationError
+ {
+ return newInstance(null, null);
+ }
+
+ /**
+ * Creates a new <b>output</b> factory.
* The implementation class to load is the first found in the following
* locations:
* <ol>
@@ -98,25 +108,35 @@ public abstract class XMLOutputFactory
* system resource</li>
* <li>the default factory class</li>
* </ol>
+ * @param factoryId the name of the factory, same as the property
+ * @param classLoader the class loader to use
+ * @return a new factory instance
+ * @exception FactoryConfigurationError if an instance of this factory
+ * could not be loaded
*/
- public static XMLOutputFactory newInstance()
+ public static XMLOutputFactory newInstance(String factoryId,
+ ClassLoader classLoader)
throws FactoryConfigurationError
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
+ if (classLoader == null)
{
- loader = XMLOutputFactory.class.getClassLoader();
+ classLoader = Thread.currentThread().getContextClassLoader();
+ }
+ if (classLoader == null)
+ {
+ classLoader = XMLOutputFactory.class.getClassLoader();
}
String className = null;
int count = 0;
do
{
- className = getFactoryClassName(loader, count++);
+ className = getFactoryClassName(classLoader, count++);
if (className != null)
{
try
{
- Class<?> t = (loader != null) ? loader.loadClass(className) :
+ Class<?> t = (classLoader != null) ?
+ classLoader.loadClass(className) :
Class.forName(className);
return (XMLOutputFactory) t.newInstance();
}
@@ -184,18 +204,6 @@ public abstract class XMLOutputFactory
}
/**
- * Creates a new <b>input</b> factory.
- * This appears to be an API design bug.
- * @see javax.xml.stream.XMLInputFactory.newInstance(String,ClassLoader)
- */
- public static XMLInputFactory newInstance(String factoryId,
- ClassLoader classLoader)
- throws FactoryConfigurationError
- {
- return XMLInputFactory.newInstance(factoryId, classLoader);
- }
-
- /**
* Creates a new stream writer.
*/
public abstract XMLStreamWriter createXMLStreamWriter(Writer stream)
diff --git a/libjava/classpath/javax/xml/stream/events/Namespace.java b/libjava/classpath/javax/xml/stream/events/Namespace.java
index 2275432159a..13dd92fdaf7 100644
--- a/libjava/classpath/javax/xml/stream/events/Namespace.java
+++ b/libjava/classpath/javax/xml/stream/events/Namespace.java
@@ -41,7 +41,7 @@ package javax.xml.stream.events;
* A namespace declaration event.
*/
public interface Namespace
- extends XMLEvent
+ extends Attribute
{
/**
diff --git a/libjava/classpath/javax/xml/stream/util/ReaderDelegate.java b/libjava/classpath/javax/xml/stream/util/StreamReaderDelegate.java
index d502866fbcc..1c407a2454b 100644
--- a/libjava/classpath/javax/xml/stream/util/ReaderDelegate.java
+++ b/libjava/classpath/javax/xml/stream/util/StreamReaderDelegate.java
@@ -1,5 +1,5 @@
-/* ReaderDelegate.java --
- Copyright (C) 2005,2006 Free Software Foundation, Inc.
+/* StreamReaderDelegate.java --
+ Copyright (C) 2005,2006,2009 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,7 +47,7 @@ import javax.xml.stream.XMLStreamReader;
/**
* Base class for XML stream reader filters.
*/
-public class ReaderDelegate
+public class StreamReaderDelegate
implements XMLStreamReader, XMLStreamConstants
{
@@ -56,14 +56,14 @@ public class ReaderDelegate
/**
* Constructs an empty filter with no parent set.
*/
- public ReaderDelegate()
+ public StreamReaderDelegate()
{
}
/**
* Constructs an empty filter with the specfied parent.
*/
- public ReaderDelegate(XMLStreamReader reader)
+ public StreamReaderDelegate(XMLStreamReader reader)
{
parent = reader;
}
OpenPOWER on IntegriCloud