--- old/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java 2015-05-25 17:34:31.432106200 +0300 +++ new/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java 2015-05-25 17:34:30.915157900 +0300 @@ -29,6 +29,7 @@ import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.util.*; import java.util.concurrent.*; @@ -1129,6 +1130,8 @@ private static final int LVCFMT_CENTER = 2; public ShellFolderColumnInfo[] getFolderColumns() { + ShellFolder library = resolveLibrary(this); + if (library != null) return library.getFolderColumns(); return invoke(new Callable() { public ShellFolderColumnInfo[] call() { ShellFolderColumnInfo[] columns = doGetColumnInfo(getIShellFolder()); @@ -1159,6 +1162,10 @@ } public Object getFolderColumnValue(final int column) { + if(isFileSystem()) { + ShellFolder library = resolveLibrary(this); + if (library != null) return library.getFolderColumnValue(column); + } return invoke(new Callable() { public Object call() { return doGetColumnValue(getParentIShellFolder(), getRelativePIDL(), column); @@ -1166,6 +1173,21 @@ }); } + private static ShellFolder resolveLibrary(ShellFolder folder) { + for (ShellFolder f = folder; f != null; f = f.parent) { + if (!f.isFileSystem()) { + if(f.getPath() != null && "Library".equals(f.getFolderType())) { + try { + return getShellFolder(new File(folder.getPath())); + } catch (FileNotFoundException e) { + } + } + break; + } + } + return null; + } + // NOTE: this method uses COM and must be called on the 'COM thread'. See ComInvoker for the details private native ShellFolderColumnInfo[] doGetColumnInfo(long iShellFolder2);