JDK-6561831 : ListSelectionModel's getAnchorSelectionIndex()/getLeadSelectionIndex() JavaDoc's are now wrong
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u1
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-05-24
  • Updated: 2022-10-26
  • Resolved: 2022-10-26
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.
Other
tbdResolved
Related Reports
Relates :  
Description
J2SE Version (please include all output from java -version flag):
java version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

Does this problem occur on J2SE 1.4.x or 5.0.x or 6.0?  Yes / No (pick one) 
Yes

Operating System Configuration Information (be specific):
Microsoft Windows XP [Version 5.1.2600]

ListSelectionModel's getAnchorSelectionIndex()/getLeadSelectionIndex() JavaDoc's are now wrong

ListSelectionModel's getAnchorSelectionIndex() says:
Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
It needs to also include setLeadSelectionIndex(int anIndex).

We were relying on the selection and lead selection to always be in sync, however now 
they are no longer in sync 
as setLeadSelectionIndex(int anIndex) is getting called with 
-1 and leaving the selection unchanged. 
Bug 5053379 is possibly related to this as well.

Comments
As explained in JDK-5053379
26-10-2022