diff options
Diffstat (limited to 'libjava/classpath/javax/swing/tree')
4 files changed, 17 insertions, 10 deletions
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(); } |