JDK 12 RFR of JDK-8207055 : Make javac -help output for -source and -target more informative

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Jul 11 21:18:35 UTC 2018



On 07/11/2018 11:18 AM, joe darcy wrote:
> Hello,
>
> Please review the changes to implement
>
>     JDK-8207055 : Make javac -help output for -source and -target more 
> informative
>     http://cr.openjdk.java.net/~darcy/8207055.1/
>
> Basically the -help output for -source and -target is augmented to 
> include a concatenation of the supported values for those options. It 
> would be possible to write the concatenation in a more stream-y 
> manner, but I think the loops are sufficient.
>
> Thanks,
>
> -Joe
>

Joe,

OK, but ...

While not without precedent[1], the use of the string ", " to create a 
string for a list is not correct in all locales.

Perhaps separately, we should create and use a utility method to convert 
a list to a string.

-- Jon

1:
src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java: 
.collect(Collectors.joining(", "));
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java: if 
(e != s.elems) result.append(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java: if 
(!first) s.append(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Attribute.java: 
if (!first) buf.append(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Attribute.java: 
buf.append(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java: 
printExprs(trees, ", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java: 
print(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java: 
print(", " + vdef.name);
src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java: 
delim = ", ";
src/jdk.compiler/share/classes/com/sun/tools/javac/main/Option.java: 
.collect(Collectors.joining(", "));
src/jdk.compiler/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java: 
sep = ", ";
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java~: 
out.print(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/JNIWriter.java: 
out.print(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java: 
collect(Collectors.joining(", ")));
src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java: 
writer.print(", ");
src/jdk.compiler/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java: 
writer.println(", ");
src/jdk.compiler/share/classes/jdk/internal/shellsupport/doc/JavadocHelper.java: 
sep = ", ";




More information about the compiler-dev mailing list