Duh, should be v==null. Thanks for catching it. Cheers, Henry
> On Dec 12, 2018, at 10:50 AM, Mandy Chung <[email protected]> wrote: > > Brent is right since k is the given key and non-null. Although it does not > cause any issue as it only adds an empty element in the path, we should fix > it in this patch. > > Mandy > > On 12/12/18 10:30 AM, Brent Christian wrote: >> Hi, >> >> Shouldn't the lambdas be checking for v == null, rather than k == null? >> >> -Brent >> >> On 12/12/18 9:36 AM, Henry Jen wrote: >>> Hi, >>> >>> Can I get a review of following patch? >>> >>> Looks like the assumption test jdk will be in PATH is simply not true, >>> jtreg doesn’t do that. >>> Also, this patch make sure the JDK to be tested is first in the search >>> path. >>> >>> Cheers, >>> Henry >>> >>> >>> diff -r 241b8151b6b6 test/jdk/tools/launcher/JliLaunchTest.java >>> --- a/test/jdk/tools/launcher/JliLaunchTest.java Fri Nov 30 13:42:49 >>> 2018 -0800 >>> +++ b/test/jdk/tools/launcher/JliLaunchTest.java Wed Dec 12 09:31:53 >>> 2018 -0800 >>> @@ -49,10 +49,12 @@ >>> Map<String, String> env = pb.environment(); >>> if (Platform.isWindows()) { >>> // The DLL should be in JDK/bin >>> + String libdir = >>> Paths.get(Utils.TEST_JDK).resolve("bin").toAbsolutePath().toString(); >>> + env.compute("PATH", (k, v) -> (k == null) ? libdir : libdir + >>> ";" + v); >>> } else { >>> String libdir = >>> Paths.get(Utils.TEST_JDK).resolve("lib").toAbsolutePath().toString(); >>> String LD_LIBRARY_PATH = Platform.isOSX() ? >>> "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH"; >>> - env.compute(LD_LIBRARY_PATH, (k, v) -> (k == null) ? libdir : >>> v + ":" + libdir); >>> + env.compute(LD_LIBRARY_PATH, (k, v) -> (k == null) ? libdir : >>> libdir + ":" + v); >>> } >>> >>> OutputAnalyzer outputf = new OutputAnalyzer(pb.start()); >>> >
