changeset 4391:d17cd240b384

7012783: JFileChooser fails to resolve DFS links on Windows Vista SP2 Summary: Changes to code to handle DFS links Reviewed-by: rupashka
author vikram
date Wed, 14 Sep 2011 03:26:54 -0700
parents c3014c0a9c48
children 48eafb721da1 9cf150d76cfa
files src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Wed Sep 07 08:56:55 2011 +0800
+++ b/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java	Wed Sep 14 03:26:54 2011 -0700
@@ -1153,10 +1153,15 @@
                 if (shellFolder.isLink()) {
                     File linkedTo = shellFolder.getLinkLocation();
 
-                    if (linkedTo != null && fc.isTraversable(linkedTo)) {
-                        dir = linkedTo;
+                    // If linkedTo is null we try to use dir
+                    if (linkedTo != null) {
+                        if (fc.isTraversable(linkedTo)) {
+                            dir = linkedTo;
+                        } else {
+                            return;
+                        }
                     } else {
-                        return;
+                        dir = shellFolder;
                     }
                 }
             } catch (FileNotFoundException ex) {