6520574: JFileChooser - create new folder - not editable
authorrupashka
Wed, 18 Nov 2009 12:58:02 +0300
changeset 4282 ac32f2a927e0
parent 4281 b4474a4716dd
child 4283 06d5378aaff3
6520574: JFileChooser - create new folder - not editable Reviewed-by: malenkov
jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Tue Nov 17 16:01:09 2009 +0300
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Wed Nov 18 12:58:02 2009 +0300
@@ -486,7 +486,7 @@
                 }
                 if (remSize > 0 && addSize == 0) {
                     fireIntervalRemoved(BasicDirectoryModel.this, remStart, remStart + remSize - 1);
-                } else if (addSize > 0 && remSize == 0 && fileCache.size() > addSize) {
+                } else if (addSize > 0 && remSize == 0 && addStart + addSize <= fileCache.size()) {
                     fireIntervalAdded(BasicDirectoryModel.this, addStart, addStart + addSize - 1);
                 } else {
                     fireContentsChanged();