<AWT Dev> [9] Review request for 8003399: JFileChooser gives wrong path to selected file when saving to Libraries folder on Windows 7

Anton V. Tarasov anton.tarasov at oracle.com
Fri May 8 09:47:00 UTC 2015


Hi Semyon,

Some comments:

- Please, correct the name to KnownfolderDefinition, or better KnownFolderDefinition:

+    static class KnownfolderDefenition {

- Should JNI exceptions be asserted in Java_sun_awt_shell_Win32ShellFolder2_loadKnownFolders?

Regards,
Anton.

On 07.05.2015 11:14, Semyon Sadetsky wrote:
> Hello,
>
> Please review fix for JDK9.
> webrev: http://cr.openjdk.java.net/~ssadetsky/8003399/webrev.00/
> bug: https://bugs.openjdk.java.net/browse/JDK-8003399
>
> ***THE ROOT CAUSE
> JDK uses legacy WINAPI special folders calls while MS introduced a new interfaces IKnownFolder and 
> IShellLibrary to manage special folder locations and the new Libraries functionality in Windows 7 
> is not backward compatible with old special folders CSIDL.
>
> ***SOLUTION
> Since it is too expensive to migrate AWT shell to the new interfaces and still they are not 
> supported in java.io the solution is to map virtual folder PIDL to the Known Folder GUID and 
> replace libraries links with the default library save location. Thus the File save dialog will be 
> able to work with any Libraries registered in the system (Windows Libraries concept assumes that 
> Libraries can be added arbitrary).
> The resulting code should be compatible with older Windows versions because the new COM interfaces 
> are called only if they are available and a Libraries link has been actually requested.
>
> ***TESTING
> A test scenario is added to check that all available Libraries links are converted into filesystem 
> paths.
>
> --Semyon
>



More information about the awt-dev mailing list