Request for review 7147066: [macosx] FileDialog.getDirectory() returns incorrect directory

Mike Swingler swingler at apple.com
Wed Feb 29 07:32:49 PST 2012


On Feb 28, 2012, at 2:01 PM, Dmitry Cherepanov wrote:

> Mike Swingler wrote:
>> On Feb 27, 2012, at 2:45 PM, Dmitry Cherepanov wrote:
>>  
>>> Hello,
>>> 
>>> Here's a fix for two regressions caused by the changes for the multiple file selection support [1] (7124337). The fix adds an additional check "result == NSOKButton" to avoid the exception "attempt to insert nil object from objects[0]". Also after the fix, the file dialog returns a string constructed from -[NSURL path] (without the file protocol) as it was before the fix for 7124337.
>>> 
>>> Thanks,
>>> Dmitry
>>> 
>>> [1] http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/0e2f3e494814
>> 
>> Dmitry, in this case you want to use JNFNormalizedJavaStringForPath() instead of JNFNSToJavaString() which will correctly handle the translation from HFS's decomposed UTF8 strings to Java's precomposed UTF8 strings. 
> 
> Mike,
> 
> Thanks for the suggestion. Here's new webrev - http://cr.openjdk.java.net/~dcherepanov/7147066/webrev.1/

Looks great. I probably should have also mentioned that you can use NSArray iteration syntax too:
for (id item in array) { }

Regards,
Mike Swingler
Apple Inc.



More information about the macosx-port-dev mailing list