<AWT Dev>  Review request: 8040007 GtkFileDialog strips user inputted filepath
anthony.petrov at oracle.com
Mon Jun 9 14:07:09 UTC 2014
> 176 free(prevDir);
> 177 prevDir = strdup(dir);
It's unnecessary to re-duplicate the prevDir on each loop iteration
here. I suggest to initialize it once instead. The less pointer
operations, the less room for bugs.
> 229 (*env)->ExceptionClear(env);
> 230 JNU_ThrowInternalError(env, "Could not instantiate current folder");
This error message sounds misleading because the code above doesn't
instantiate a "folder", it tries to instantiate a string. Also, if
exceptions did occur, I believe it's fine to report them as they are.
Otherwise, if the pointer is NULL, then this looks more like an OOM than
an internal error to me.
> 278 //This is a hack for use with "Recent Folders" in gtk where each
> 279 //file could have its own directory.
I assume you've tested this case, and it still works fine, right?
On 6/6/2014 8:00 PM, Alexander Zvegintsev wrote:
> please review the fix
> for the bug
> With this fix we don't use current folder from native GtkFileChooser
> anymore, now we build it by ourselves.
More information about the awt-dev