RFR (M) 8191521: handle long relative path specified in -Xbootclasspath/a on windows

Schmelter, Ralf ralf.schmelter at sap.com
Thu Jul 25 15:08:38 UTC 2019

Hi Calvin,

thanks for reviewing this change. 

> 4315       } else {
> 4316         prefix = L"\\\\?\\UNC";
> 4317         prefix_off = 1; // Overwrite the first char with the prefix.
> 4318       }

> Do you mean if the original path is something like "\\\\x\\y", it would 
> become the following?
>     ""\\\\?\\UNC\\x\\y"

Exactly. Usually you can just add a prefix, but in case of the an UNC path,
the double backslash must be changed to a single one. 

> Maybe add an example in the comment?

Good idea.

> 4368   if (err != ERROR_SUCCESS) {
> 4369     os::free(result);

> I think you need a NULL check on result before calling os::free() 
> because result could be NULL if the os::malloc() call at line 4328 has 
> failed.

os::free() is like ::free() and delete. You can call them with NULL,
which is just treated as a no-op.

> line 4282 please add a blank space before "The"
> line 4283 "er" should be "err"

Good catch.

> Could you also mention that the function is based on pathToNTPath() in 
> io_util_md.cpp?


> I haven't reviewed this file in details but I have tried your patch and 
> saw failures in tier1 testing.

That's interesting. Do you only see the errors with UNC paths? If yes,
could you open the 'Computer Management' application and look at
'System Tools' -> 'Shared Folders' -> 'Shares'. Usually if you have
a harddrive at let's say D:, windows will create a share called D$.
I've used this to check UNC paths, but the share might be missing.
Especially if T: is not a harddrive but a mapped drive. 

I should probably first test, if a can access the \\localhost\<DRIVELETTER>$
share at all and only then run the UNC path tests. 

Best regards,

More information about the hotspot-runtime-dev mailing list