while (expanded.hasMoreElements()) {
final TreePath treePath = expanded.nextElement();
final DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent();
String expandedNode;
if (node.getUserObject() instanceof Descriptor) {
<BUG>expandedNode = ((Descriptor)node.getUserObject()).getText();
</BUG>
}
else {
expandedNode = (String)node.getUserObject();

while (expanded.hasMoreElements()) {
final TreePath treePath = expanded.nextElement();
final DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent();
String expandedNode;
if (node.getUserObject() instanceof Descriptor) {
expandedNode = ((Descriptor)node.getUserObject()).getKey().toString();
}
else {
expandedNode = (String)node.getUserObject();
