Unclear docs regarding escaping of Windows paths.
Jonathan Gibbons
jonathan.gibbons at oracle.com
Thu Jan 10 22:06:51 UTC 2019
Thorsten,
FWIW, the primary change in the new implementation of arg files that
appeared in JDK 9 is that embedded quotes are supported. Previously, if
characters within a string needed to be escaped, the entire string had
to be escaped. Now, you can escape just part of a string. In general,
all "old-style" files should be accepted as before, but now you have
more flexibility over how you quote a string to escape parts of it.
-- Jon
On 01/10/2019 01:44 PM, Jonathan Gibbons wrote:
>
> I've filed JDK-8216522 [1] to track this general issue.
>
> For JDK 9 onward, the syntax rules in this area come down to:
>
> * outside of quotes, the backslash character has no special meaning
> and is treated literally
>
> * inside quotes, the backslash character is an escape character, and
> must be doubled to pass through a backslash character.
>
> As an example, the following are equivalent
>
> C:\Users\me\myfile.java
>
> "C:\\Users\\me\\myfile.java"
>
>
> Likewise the following are equivalent
>
> C:\Program" "Files\myfile.java
>
> "C:\\Program Files\\myfile.java"
>
> So, in terms of specifying paths, you only need to be careful if tyhe
> path contains whitespace characters.
>
>
> -- Jon
>
>
> [1]: https://bugs.openjdk.java.net/browse/JDK-8216522
>
>
>
> On 01/07/2019 03:46 AM, Thorsten Schöning wrote:
>> Guten Tag Jonathan Gibbons,
>> am Freitag, 4. Januar 2019 um 00:19 schrieben Sie:
>>
>>> The change that you noted in the URIs is just a side-effect of internal
>>> changes in the way that the documentation was generated. We removed the
>>> documentation for the old implementation from 9, and it is a bug that we
>>> did not get to update it with a reference to the new syntax, as
>>> described for the Java launcher in [1].
>> Do you take care of creating a bug adding such a reference? [1] make
>> some points a lot more clear and is actually what I hoped to find. So
>> thanks for that.
>>
>>> Please also note that the handling of command-line arguments is
>>> different from the handling of the contents of argument files.[...]
>> My link is explicitly mentioning argument files:
>>
>>> Examples
>>> Single Argument File[...]
>>> Two Argument Files
>> https://docs.oracle.com/en/java/javase/11/javadoc/javadoc-command.html#GUID-EFE927BC-DB00-4876-808C-ED23E1AAEF7D
>>
>> And the example for Windows contains the following:
>>
>>> -overview \java\jdk9\docs\api\overview-summary.html
>>> -sourcepath \java\
>> Which uses unescaped backslashs and should be a bug as per your linked
>> [1]. Am I wrong or do you take care of that as well or should I add
>> some bug somewhere or ...?
>>
>> Mit freundlichen Grüßen,
>>
>> Thorsten Schöning
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/javadoc-dev/attachments/20190110/653c4ff0/attachment.html>
More information about the javadoc-dev
mailing list