Review request 8145409: Better detect JRE that JLI will be using
Dmitry Cherepanov
dmitry.cherepanov at oracle.com
Wed Jan 13 12:06:13 UTC 2016
Hi Kumar,
Thanks for the comments.
On 1/12/16 9:21 PM, Kumar Srinivasan wrote:
>
> Hi Dmitry,
>
> src/java.base/windows/native/libjli/java_md.c
>
> 1) use NULL
>
> - GetModuleFileName(0, buf, bufsize);
>
> + GetModuleFileName(NULL, buf, bufsize);
OK.
>
>
> 2) extra LF ?
>
> + * Removes the trailing file name and one sub-folder from a path.
> + *
> + * If buf is "c:\foo\bin\javac", then put "c:\foo" into buf.
>
> and
>
> + return TruncatePath(buf);
> +}
> +
> +
> +/*
Fixed.
>
>
> 3) Is this comment correct ?
>
> /*
> + * Retrieves the path to the executable file of the current process
> + * and then truncates the path
> + */
>
> Shouldn't it say Retrieves the path the JRE home by locating the
> executable of
> the current process ........
Fixed too.
>
>
> 4) Could you please add some comments to GetApplicationHomeFromAddress ?
> Shouldn't the method be called GetApplicationHomeFromDll ?
Good idea. I've updated the name and comments.
>
> + GetModuleHandleEx(dwFlags, (LPCSTR)&GetJREPath, &hModule);
>
> shouldn't you be testing the return value for success ?
Fixed.
Updated webrev:
http://cr.openjdk.java.net/~dcherepanov/8145409/webrev.v1/
Thanks
Dmitry
More information about the core-libs-dev
mailing list