Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8216402

Command-line help wrong for javac --module

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 12
    • tools
    • None
    • behavioral
    • minimal
    • Docs only change, to match the existing implementation
    • add/remove/modify command line option
    • JDK

      Summary

      The javac command-line help for the --module option should be changed to match the implementation.

      Problem

      The command line help for --module / -m indicates that it only takes a single module-name as an argument. In fact, it accepts a comma-separated list of names.

      In addition, this option is inconsistent with regard to other options that accept modules names. The command-line help for --module uses <module-name>, but other options just use <module> to match the runtime behavior. The runtime equivalent for --module also uses <module>.

      Solution

      Update the command-line help to indicate that it accepts a comnma-separate list of module names, represented by <module>

      Specification

      $ hg diff
      diff -r 28ec06beb091 src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties
      --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties     Tue Jan 08 13:04:04 2019 -0800
      +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/javac.properties     Tue Jan 08 16:56:05 2019 -0800
      @@ -44,7 +44,7 @@
       javac.opt.sourcepath=\
           Specify where to find input source files
       javac.opt.m=\
      -    Compile only the specified module, check timestamps
      +    Compile only the specified module(s), check timestamps
       javac.opt.modulesourcepath=\
           Specify where to find input source files for multiple modules
       javac.opt.bootclasspath=\
      @@ -108,7 +108,7 @@
       javac.opt.arg.mspath=\
           <module-source-path>
       javac.opt.arg.m=\
      -    <module-name>
      +    <module>(,<module>)*
       javac.opt.arg.jdk=\
           <jdk>|none
       javac.opt.arg.dirs=\

      With those edits, the command-line help for the --module option will appear as follows:

        --module <module>(,<module>)*, -m <module>(,<module>)*
              Compile only the specified module(s), check timestamps

            jjg Jonathan Gibbons
            jjg Jonathan Gibbons
            Alan Bateman, Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: