< prev index next >

src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -23,42 +23,27 @@
  * questions.
  */
 
 package sun.awt.shell;
 
-import java.awt.Image;
-import java.awt.Toolkit;
+import java.awt.*;
 import java.awt.image.BufferedImage;
+import java.awt.image.BaseMultiResolutionImage;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.*;
 import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
+import java.util.concurrent.*;
 import java.util.stream.Stream;
 
+import static sun.awt.shell.Win32ShellFolder2.*;
 import sun.awt.OSInfo;
 import sun.awt.util.ThreadGroupUtils;
-import sun.util.logging.PlatformLogger;
-
-import static sun.awt.shell.Win32ShellFolder2.DESKTOP;
-import static sun.awt.shell.Win32ShellFolder2.DRIVES;
-import static sun.awt.shell.Win32ShellFolder2.Invoker;
-import static sun.awt.shell.Win32ShellFolder2.MultiResolutionIconImage;
-import static sun.awt.shell.Win32ShellFolder2.NETWORK;
-import static sun.awt.shell.Win32ShellFolder2.PERSONAL;
-import static sun.awt.shell.Win32ShellFolder2.RECENT;
 // NOTE: This class supersedes Win32ShellFolderManager, which was removed
 //       from distribution after version 1.4.2.
 
 /**
  * @author Michael Martak

@@ -67,13 +52,10 @@
  * @since 1.4
  */
 
 final class Win32ShellFolderManager2 extends ShellFolderManager {
 
-    private static final PlatformLogger
-            log = PlatformLogger.getLogger("sun.awt.shell.Win32ShellFolderManager2");
-
     static {
         // Load library here
         sun.awt.windows.WToolkit.loadLibraries();
     }
 

@@ -161,33 +143,31 @@
 
     static Win32ShellFolder2 getDesktop() {
         if (desktop == null) {
             try {
                 desktop = new Win32ShellFolder2(DESKTOP);
-            } catch (final SecurityException ignored) {
-                // Ignore, the message may have sensitive information, not
-                // accessible other ways
-            } catch (IOException | InterruptedException e) {
-                if (log.isLoggable(PlatformLogger.Level.WARNING)) {
-                    log.warning("Cannot access 'Desktop'", e);
-                }
+            } catch (SecurityException e) {
+                // Ignore error
+            } catch (IOException e) {
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
             }
         }
         return desktop;
     }
 
     static Win32ShellFolder2 getDrives() {
         if (drives == null) {
             try {
                 drives = new Win32ShellFolder2(DRIVES);
-            } catch (final SecurityException ignored) {
-                // Ignore, the message may have sensitive information, not
-                // accessible other ways
-            } catch (IOException | InterruptedException e) {
-                if (log.isLoggable(PlatformLogger.Level.WARNING)) {
-                    log.warning("Cannot access 'Drives'", e);
-                }
+            } catch (SecurityException e) {
+                // Ignore error
+            } catch (IOException e) {
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
             }
         }
         return drives;
     }
 

@@ -196,33 +176,31 @@
             try {
                 String path = Win32ShellFolder2.getFileSystemPath(RECENT);
                 if (path != null) {
                     recent = createShellFolder(getDesktop(), new File(path));
                 }
-            } catch (final SecurityException ignored) {
-                // Ignore, the message may have sensitive information, not
-                // accessible other ways
-            } catch (InterruptedException | IOException e) {
-                if (log.isLoggable(PlatformLogger.Level.WARNING)) {
-                    log.warning("Cannot access 'Recent'", e);
-                }
+            } catch (SecurityException e) {
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
+            } catch (IOException e) {
+                // Ignore error
             }
         }
         return recent;
     }
 
     static Win32ShellFolder2 getNetwork() {
         if (network == null) {
             try {
                 network = new Win32ShellFolder2(NETWORK);
-            } catch (final SecurityException ignored) {
-                // Ignore, the message may have sensitive information, not
-                // accessible other ways
-            } catch (IOException | InterruptedException e) {
-                if (log.isLoggable(PlatformLogger.Level.WARNING)) {
-                    log.warning("Cannot access 'Network'", e);
-                }
+            } catch (SecurityException e) {
+                // Ignore error
+            } catch (IOException e) {
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
             }
         }
         return network;
     }
 

@@ -238,17 +216,16 @@
                     }
                     if (personal != null) {
                         personal.setIsPersonal();
                     }
                 }
-            } catch (final SecurityException ignored) {
-                // Ignore, the message may have sensitive information, not
-                // accessible other ways
-            } catch (InterruptedException | IOException e) {
-                if (log.isLoggable(PlatformLogger.Level.WARNING)) {
-                    log.warning("Cannot access 'Personal'", e);
-                }
+            } catch (SecurityException e) {
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
+            } catch (IOException e) {
+                // Ignore error
             }
         }
         return personal;
     }
 

@@ -345,18 +322,12 @@
                     } else if (value instanceof String) {
                         // A path
                         folders.add(createShellFolder(new File((String)value)));
                     }
                 } catch (IOException e) {
-                    if (log.isLoggable(PlatformLogger.Level.WARNING)) {
-                        log.warning("Cannot read value = " + value, e);
-                    }
                     // Skip this value
                 } catch (InterruptedException e) {
-                    if (log.isLoggable(PlatformLogger.Level.WARNING)) {
-                        log.warning("Cannot read value = " + value, e);
-                    }
                     // Return empty result
                     return new File[0];
                 }
             } while (value != null);
 
< prev index next >