--- a/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java Tue Aug 26 12:16:23 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/tree/FixedHeightLayoutCache.java Tue Aug 26 15:12:54 2008 +0400
@@ -64,21 +64,21 @@
/**
* Maps from TreePath to a FHTreeStateNode.
*/
- private Hashtable treePathMapping;
+ private Hashtable<TreePath, FHTreeStateNode> treePathMapping;
/**
* Used for getting path/row information.
*/
private SearchInfo info;
- private Stack tempStacks;
+ private Stack<Stack<TreePath>> tempStacks;
public FixedHeightLayoutCache() {
super();
- tempStacks = new Stack();
+ tempStacks = new Stack<Stack<TreePath>>();
boundsBuffer = new Rectangle();
- treePathMapping = new Hashtable();
+ treePathMapping = new Hashtable<TreePath, FHTreeStateNode>();
info = new SearchInfo();
setRowHeight(1);
}
@@ -592,7 +592,7 @@
* return null, if you to create a node use getNodeForPath.
*/
private FHTreeStateNode getMapping(TreePath path) {
- return (FHTreeStateNode)treePathMapping.get(path);
+ return treePathMapping.get(path);
}
/**
@@ -695,13 +695,13 @@
return null;
// 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 {
@@ -714,7 +714,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 = node.createChildFor(path.
getLastPathComponent());
}