diff options
Diffstat (limited to 'libjava/classpath/javax/swing/tree')
-rw-r--r-- | libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java | 38 | ||||
-rw-r--r-- | libjava/classpath/javax/swing/tree/TreeNode.java | 2 |
2 files changed, 23 insertions, 17 deletions
diff --git a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java index 260c385aa3e..1e53961964e 100644 --- a/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java +++ b/libjava/classpath/javax/swing/tree/DefaultMutableTreeNode.java @@ -293,7 +293,7 @@ public class DefaultMutableTreeNode * * @return an enumeration of tree nodes */ - @SuppressWarnings("unchecked") // Required for API compatibility + @SuppressWarnings("rawtypes") // Required for API compatibility public Enumeration children() { if (children.size() == 0) @@ -718,7 +718,7 @@ public class DefaultMutableTreeNode * * @return Enumeration */ - @SuppressWarnings("unchecked") // Required for API compatibility + @SuppressWarnings("rawtypes") // Required for API compatibility public Enumeration preorderEnumeration() { return new PreorderEnumeration(this); @@ -729,7 +729,7 @@ public class DefaultMutableTreeNode * * @return Enumeration */ - @SuppressWarnings("unchecked") // Required for API compatibility + @SuppressWarnings("rawtypes") // Required for API compatibility public Enumeration postorderEnumeration() { return new PostorderEnumeration(this); @@ -740,7 +740,7 @@ public class DefaultMutableTreeNode * * @return Enumeration */ - @SuppressWarnings("unchecked") // Required for API compatibility + @SuppressWarnings("rawtypes") // Required for API compatibility public Enumeration breadthFirstEnumeration() { return new BreadthFirstEnumeration(this); @@ -751,7 +751,7 @@ public class DefaultMutableTreeNode * * @return Enumeration */ - @SuppressWarnings("unchecked") // Required for API compatibility + @SuppressWarnings("rawtypes") // Required for API compatibility public Enumeration depthFirstEnumeration() { return postorderEnumeration(); @@ -764,7 +764,7 @@ public class DefaultMutableTreeNode * * @return Enumeration */ - @SuppressWarnings("unchecked") // Required for API compatibility + @SuppressWarnings("rawtypes") // Required for API compatibility public Enumeration pathFromAncestorEnumeration(TreeNode node) { if (node == null) @@ -1073,7 +1073,6 @@ public class DefaultMutableTreeNode return !queue.isEmpty(); } - @SuppressWarnings("unchecked") public TreeNode nextElement() { if (queue.isEmpty()) @@ -1081,6 +1080,7 @@ public class DefaultMutableTreeNode TreeNode node = queue.removeFirst(); + @SuppressWarnings("unchecked") Enumeration<TreeNode> children = (Enumeration<TreeNode>) node.children(); while (children.hasMoreElements()) @@ -1100,11 +1100,13 @@ public class DefaultMutableTreeNode Stack<Enumeration<TreeNode>> childrenEnums = new Stack<Enumeration<TreeNode>>(); - @SuppressWarnings("unchecked") PreorderEnumeration(TreeNode node) { next = node; - childrenEnums.push((Enumeration<TreeNode>) node.children()); + @SuppressWarnings("unchecked") + Enumeration<TreeNode> children = + (Enumeration<TreeNode>) node.children(); + childrenEnums.push(children); } public boolean hasMoreElements() @@ -1127,14 +1129,16 @@ public class DefaultMutableTreeNode return current; } - @SuppressWarnings("unchecked") private TreeNode traverse(Enumeration<TreeNode> children) { // If more children are available step down. if (children.hasMoreElements()) { TreeNode child = children.nextElement(); - childrenEnums.push((Enumeration<TreeNode>) child.children()); + @SuppressWarnings("unchecked") + Enumeration<TreeNode> grandchildren = + (Enumeration<TreeNode>) child.children(); + childrenEnums.push(grandchildren); return child; } @@ -1163,11 +1167,13 @@ public class DefaultMutableTreeNode Stack<Enumeration<TreeNode>> childrenEnums = new Stack<Enumeration<TreeNode>>(); - @SuppressWarnings("unchecked") PostorderEnumeration(TreeNode node) { nodes.push(node); - childrenEnums.push((Enumeration<TreeNode>) node.children()); + @SuppressWarnings("unchecked") + Enumeration<TreeNode> children = + (Enumeration<TreeNode>) node.children(); + childrenEnums.push(children); } public boolean hasMoreElements() @@ -1185,7 +1191,6 @@ public class DefaultMutableTreeNode return traverse(children); } - @SuppressWarnings("unchecked") private TreeNode traverse(Enumeration<TreeNode> children) { if (children.hasMoreElements()) @@ -1193,8 +1198,9 @@ public class DefaultMutableTreeNode TreeNode node = children.nextElement(); nodes.push(node); - Enumeration<TreeNode> newChildren = - (Enumeration<TreeNode>) node.children(); + @SuppressWarnings("unchecked") + Enumeration<TreeNode> newChildren = + (Enumeration<TreeNode>) node.children(); childrenEnums.push(newChildren); return traverse(newChildren); diff --git a/libjava/classpath/javax/swing/tree/TreeNode.java b/libjava/classpath/javax/swing/tree/TreeNode.java index b68b498a7b3..f146741f49e 100644 --- a/libjava/classpath/javax/swing/tree/TreeNode.java +++ b/libjava/classpath/javax/swing/tree/TreeNode.java @@ -107,7 +107,7 @@ public interface TreeNode * * @return An enumeration of the children of this node. */ - @SuppressWarnings("unchecked") // Required for API compatibility + @SuppressWarnings("rawtypes") // Required for API compatibility Enumeration children(); } |