JDK-7104607 : Java7 Jtree.getSelectionPaths() returned value
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2011-10-25
  • Updated: 2012-03-20
  • Resolved: 2011-10-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8-poolResolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]


A DESCRIPTION OF THE PROBLEM :
By documentation of Java 7 returned value of JTree.getSelectionPaths() should be null if nothing selected. See

http://download.oracle.com/javase/7/docs/api/javax/swing/JTree.html#getSelectionPaths()

" Returns:
an array of TreePath objects indicating the selected nodes, or null if nothing is currently selected."

getSelectionPaths() of the default JTree selection model return empty array of TreePath

In the oldest versions of the Java it was return null. Previous versions of our product dont working with Java 7.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create JTree.
2. In the code call getSelectionPaths() when nothing selected in the tree.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
getSelectionPath should return null
ACTUAL -
gSelectionPath return empty array of TreePath

REPRODUCIBILITY :
This bug can be reproduced always.