Re: RFR: 8236919: Refactor com.sun.tools.javac.main.CommandLine into a reusable module for other JDK tools [v2]

2022-11-22 Thread Jonathan Gibbons
On Tue, 22 Nov 2022 15:57:57 GMT, Christian Stein  wrote:

>> This PR copies the `CommandLine.java` file from module `jdk.compiler` 
>> (package `com.sun.tools.javac.main`) into the `jdk.internal.opt` module, 
>> creating a new package with name `jdk.internal.opt`. That new 
>> `jdk.internal.opt` package is then exported to the following modules:
>> - `jdk.jartool`
>> - `jdk.jlink`
>> - `jdk.jpackage`
>> 
>> Now, `jar`, `jlink`, and `jpackage` use a shared `CommandLine` class. In a 
>> future commit (presumable for JDK 21)  the original `CommandLine.java` file 
>> in `jdk.compiler` can and will be replaced with this new one in 
>> `jdk.internal.opt`. Same goes for the `jdk.javadoc` module.
>> 
>> - [x] Keep `CommandLine.java` in `jdk.compiler` module for the time being 
>> due to "JDK N-1 rule".
>> - [x] Keep `CommandLine.java` in `jdk.javadoc` module for the time being due 
>> to "JDK N-1 rule".
>> - [x] Remove `CommandLine.java` from `jdk.jartool` module
>> - [x] Remove `CommandLine.java` from `jdk.jlink` module
>> - [x] Remove `CommandLine.java` from `jdk.jpackage` module
>> - [x] Check for related but renamed(?) usages of `CommandLine.java` in other 
>> JDK tools: `jshell`, `jdeps`, `jfr`, ...
>
> Christian Stein has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Remove superseded comment

Marked as reviewed by jjg (Reviewer).

src/jdk.internal.opt/share/classes/jdk/internal/opt/CommandLine.java line 49:

> 47:  *
> 48:  *  This is NOT part of any supported API.
> 49:  *  If you write code that depends on this, you do so at your own 
> risk.

I think this entire paragraph can be removed. It is "just" the "scary warning" 
meant to warn people about using not-really-public classes in javac, before we 
had a module system for the encapsulation.

-

PR: https://git.openjdk.org/jdk/pull/11272


Re: RFR: 8236919: Refactor com.sun.tools.javac.main.CommandLine into a reusable module for other JDK tools [v2]

2022-11-22 Thread Christian Stein
> This PR copies the `CommandLine.java` file from module `jdk.compiler` 
> (package `com.sun.tools.javac.main`) into the `jdk.internal.opt` module, 
> creating a new package with name `jdk.internal.opt`. That new 
> `jdk.internal.opt` package is then exported to the following modules:
> - `jdk.jartool`
> - `jdk.jlink`
> - `jdk.jpackage`
> 
> Now, `jar`, `jlink`, and `jpackage` use a shared `CommandLine` class. In a 
> future commit (presumable for JDK 21)  the original `CommandLine.java` file 
> in `jdk.compiler` can and will be replaced with this new one in 
> `jdk.internal.opt`. Same goes for the `jdk.javadoc` module.
> 
> - [x] Keep `CommandLine.java` in `jdk.compiler` module for the time being due 
> to "JDK N-1 rule".
> - [x] Keep `CommandLine.java` in `jdk.javadoc` module for the time being due 
> to "JDK N-1 rule".
> - [x] Remove `CommandLine.java` from `jdk.jartool` module
> - [x] Remove `CommandLine.java` from `jdk.jlink` module
> - [x] Remove `CommandLine.java` from `jdk.jpackage` module
> - [x] Check for related but renamed(?) usages of `CommandLine.java` in other 
> JDK tools: `jshell`, `jdeps`, `jfr`, ...

Christian Stein has updated the pull request incrementally with one additional 
commit since the last revision:

  Remove superseded comment

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/11272/files
  - new: https://git.openjdk.org/jdk/pull/11272/files/ebdcbde7..7854e14c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=11272=01
 - incr: https://webrevs.openjdk.org/?repo=jdk=11272=00-01

  Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/11272.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11272/head:pull/11272

PR: https://git.openjdk.org/jdk/pull/11272