8159587: IOOBE in javax/swing/JFileChooser/7199708/bug7199708.java
authorssadetsky
Mon, 18 Jul 2016 09:44:13 +0300
changeset 39867 889e919f632e
parent 39866 ad2a71a4f495
child 39868 79bc8722ebb0
8159587: IOOBE in javax/swing/JFileChooser/7199708/bug7199708.java Reviewed-by: alexsch
jdk/src/java.desktop/share/classes/sun/swing/FilePane.java
jdk/test/javax/swing/JFileChooser/7199708/bug7199708.java
--- a/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java	Fri Jul 01 15:50:03 2016 +0200
+++ b/jdk/src/java.desktop/share/classes/sun/swing/FilePane.java	Mon Jul 18 09:44:13 2016 +0300
@@ -1748,8 +1748,8 @@
         if (listSelectionModel != null) {
             listSelectionModel.clearSelection();
             if (listSelectionModel instanceof DefaultListSelectionModel) {
-                ((DefaultListSelectionModel)listSelectionModel).moveLeadSelectionIndex(0);
-                listSelectionModel.setAnchorSelectionIndex(0);
+                ((DefaultListSelectionModel)listSelectionModel).moveLeadSelectionIndex(-1);
+                listSelectionModel.setAnchorSelectionIndex(-1);
             }
         }
     }
--- a/jdk/test/javax/swing/JFileChooser/7199708/bug7199708.java	Fri Jul 01 15:50:03 2016 +0200
+++ b/jdk/test/javax/swing/JFileChooser/7199708/bug7199708.java	Mon Jul 18 09:44:13 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,7 @@
 
 /**
  * @test
- * @bug 7199708
+ * @bug 7199708 8159587
  * @author Alexander Scherbatiy
  * @summary FileChooser crashs when opening large folder
  * @run main bug7199708