changeset 5388:82e89c2d7095

7199708: FileChooser crashs when opening large folder Reviewed-by: bagiras
author alexsch
date Tue, 23 Oct 2012 11:52:24 +0400
parents 3ba27e5ab1f9
children 03b9d0ba2488
files src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Tue Oct 23 10:02:23 2012 +0800
+++ b/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Tue Oct 23 11:52:24 2012 +0400
@@ -1099,7 +1099,7 @@
                                     ? SwingConstants.CENTER
                                     : SwingConstants.LEADING);
 
-                            column.setComparator(new ColumnComparator(getIShellFolder(), i));
+                            column.setComparator(new ColumnComparator(Win32ShellFolder2.this, i));
 
                             notNullColumns.add(column);
                         }
@@ -1135,7 +1135,7 @@
         // synchronize the whole code of the sort method once
         invoke(new Callable<Void>() {
             public Void call() {
-                Collections.sort(files, new ColumnComparator(getIShellFolder(), 0));
+                Collections.sort(files, new ColumnComparator(Win32ShellFolder2.this, 0));
 
                 return null;
             }
@@ -1143,12 +1143,12 @@
     }
 
     private static class ColumnComparator implements Comparator<File> {
-        private final long parentIShellFolder;
+        private final Win32ShellFolder2 shellFolder;
 
         private final int columnIdx;
 
-        public ColumnComparator(long parentIShellFolder, int columnIdx) {
-            this.parentIShellFolder = parentIShellFolder;
+        public ColumnComparator(Win32ShellFolder2 shellFolder, int columnIdx) {
+            this.shellFolder = shellFolder;
             this.columnIdx = columnIdx;
         }
 
@@ -1159,7 +1159,7 @@
                     if (o instanceof Win32ShellFolder2
                         && o1 instanceof Win32ShellFolder2) {
                         // delegates comparison to native method
-                        return compareIDsByColumn(parentIShellFolder,
+                        return compareIDsByColumn(shellFolder.getIShellFolder(),
                             ((Win32ShellFolder2) o).getRelativePIDL(),
                             ((Win32ShellFolder2) o1).getRelativePIDL(),
                             columnIdx);