提交 08450a44 编写于 作者: R rupashka

7080203: JTree.getSelectionPaths() now returns empty array instead of null

Reviewed-by: malenkov
上级 0a56c3ef
......@@ -1838,7 +1838,9 @@ public class JTree extends JComponent implements Scrollable, Accessible
* nodes, or <code>null</code> if nothing is currently selected
*/
public TreePath[] getSelectionPaths() {
return getSelectionModel().getSelectionPaths();
TreePath[] selectionPaths = getSelectionModel().getSelectionPaths();
return (selectionPaths != null && selectionPaths.length > 0) ? selectionPaths : null;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册