> The issue is observed on mouse right click on the table header to open a 
> pupup menu and then, do a mouse left click on the menu entry in which case we 
> get AIOOBE
> This is because the columnIndex for popup menu is returned by 
> `viewIndexForColumn `as -1 seen here 
> https://github.com/openjdk/jdk/blob/941a7ac7dab243c6033a78880fd31faa803e62ab/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java#L745-L753
> which is then passed to DefaultTableColumnModel.getColumn(columnIndex) 
> causing it to throw AIOOBE as per the [DefaultTableColumnModel.getColumn 
> spec](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/table/DefaultTableColumnModel.java#L293)
> 
> So, inline with check done for `viewIndexForColumn `
> https://github.com/openjdk/jdk/blob/941a7ac7dab243c6033a78880fd31faa803e62ab/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java#L310-L312
> a similar check is added when `viewIndexForColumn `is called

Prasanta Sadhukhan has updated the pull request incrementally with one 
additional commit since the last revision:

  Review comment

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/13172/files
  - new: https://git.openjdk.org/jdk/pull/13172/files/2fff1178..a8d1338a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=13172&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13172&range=00-01

  Stats: 15 lines in 3 files changed: 6 ins; 3 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/13172.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13172/head:pull/13172

PR: https://git.openjdk.org/jdk/pull/13172

Reply via email to