8170633: backslashes in gensrc/module-info.java comments need escaping
authormchung
Fri, 02 Dec 2016 11:00:59 -0800
changeset 42355 30cac79609ee
parent 42354 131a371f5efc
child 42356 f350f3fd9dc4
8170633: backslashes in gensrc/module-info.java comments need escaping Reviewed-by: alanb, psandoz, wetmore
jdk/make/src/classes/build/tools/module/GenModuleInfoSource.java
--- a/jdk/make/src/classes/build/tools/module/GenModuleInfoSource.java	Fri Dec 02 10:05:53 2016 -0800
+++ b/jdk/make/src/classes/build/tools/module/GenModuleInfoSource.java	Fri Dec 02 11:00:59 2016 -0800
@@ -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;
                 }