Review Request: JDK-8170633 backslashes in gensrc/module-info.java comments need escaping

Paul Sandoz paul.sandoz at oracle.com
Fri Dec 2 17:44:40 UTC 2016


> On 2 Dec 2016, at 09:39, Mandy Chung <mandy.chung at oracle.com> wrote:
> 
> The build tool generating module-info.java includes the path name of the source files in the comment for diagnosis where backslash character needs escaping.  This patch prints URI rather than file path.
> 

+1

Paul.

> Mandy
> 
> diff --git a/make/src/classes/build/tools/module/GenModuleInfoSource.java b/make/src/classes/build/tools/module/GenModuleInfoSource.java
> --- a/make/src/classes/build/tools/module/GenModuleInfoSource.java
> +++ b/make/src/classes/build/tools/module/GenModuleInfoSource.java
> @@ -146,9 +146,10 @@
>             for (String l : lines) {
>                 writer.println(l);
>                 if (l.trim().startsWith("module ")) {
> -                    writer.format("    // source file: %s%n", sourceFile);
> +                    // print URI rather than file path to avoid escape
> +                    writer.format("    // source file: %s%n", sourceFile.toUri());
>                     for (Path file: extraFiles) {
> -                        writer.format("    //              %s%n", file);
> +                        writer.format("    //              %s%n", file.toUri());
>                     }
>                     break;
>                 }
> 



More information about the core-libs-dev mailing list