--- a/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java Tue Aug 26 12:16:23 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/tree/VariableHeightLayoutCache.java Tue Aug 26 15:12:54 2008 +0400
@@ -56,7 +56,7 @@
* The array of nodes that are currently visible, in the order they
* are displayed.
*/
- private Vector visibleNodes;
+ private Vector<Object> visibleNodes;
/**
* This is set to true if one of the entries has an invalid size.
@@ -79,20 +79,20 @@
/**
* Maps from <code>TreePath</code> to a <code>TreeStateNode</code>.
*/
- private Hashtable treePathMapping;
+ private Hashtable<TreePath, TreeStateNode> treePathMapping;
/**
* A stack of stacks.
*/
- private Stack tempStacks;
+ private Stack<Stack<TreePath>> tempStacks;
public VariableHeightLayoutCache() {
super();
- tempStacks = new Stack();
- visibleNodes = new Vector();
+ tempStacks = new Stack<Stack<TreePath>>();
+ visibleNodes = new Vector<Object>();
boundsBuffer = new Rectangle();
- treePathMapping = new Hashtable();
+ treePathMapping = new Hashtable<TreePath, TreeStateNode>();
}
/**
@@ -704,7 +704,7 @@
* return null, if you to create a node use getNodeForPath.
*/
private TreeStateNode getMapping(TreePath path) {
- return (TreeStateNode)treePathMapping.get(path);
+ return treePathMapping.get(path);
}
/**
@@ -824,13 +824,13 @@
}
// Check all the parent paths, until a match is found.
- Stack paths;
+ Stack<TreePath> paths;
if(tempStacks.size() == 0) {
- paths = new Stack();
+ paths = new Stack<TreePath>();
}
else {
- paths = (Stack)tempStacks.pop();
+ paths = tempStacks.pop();
}
try {
@@ -843,7 +843,7 @@
// Found a match, create entries for all paths in
// paths.
while(node != null && paths.size() > 0) {
- path = (TreePath)paths.pop();
+ path = paths.pop();
node.getLoadedChildren(shouldCreate);
int childIndex = treeModel.