RFR: 8349254: Disable "best-fit" mapping on Windows environment variables
Jaikiran Pai
jpai at openjdk.org
Fri Feb 7 13:20:11 UTC 2025
On Thu, 6 Feb 2025 19:46:21 GMT, Naoto Sato <naoto at openjdk.org> wrote:
> This is a follow-on fix to [JDK-8337506](https://bugs.openjdk.org/browse/JDK-8337506). The Java launcher can take arguments from "JDK_JAVA_OPTIONS" environment variable, so the same processing is needed. Also, obsolete code for Windows 9x has been removed.
src/java.base/share/native/libjli/args.c line 479:
> 477: jboolean ret = JNI_FALSE;
> 478:
> 479: if (firstAppArgIndex != 0 && // If not 'java', return
Hello Naoto, this is a pre-existing thing, but since we are changing this part of the code, I think the checks for `firstAppArgIndex` and `relaunch` can be moved before the call to `getenv()` (and now before `winGetEnv()` too) since the syscall to `getenv()` wasn't anyway changing the state of `firstAppArgIndex` or `relaunch`. I think doing those checks before the call to fetch the env value will simplify the conditional check here a bit, in terms of readability.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23498#discussion_r1946511351
More information about the core-libs-dev
mailing list