RFR: 8211033: Clean up the processing -classpath argument not to set LM_CLASS

Alan Bateman alanb at openjdk.org
Fri Nov 8 09:31:41 UTC 2024


On Fri, 8 Nov 2024 08:51:38 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which addresses https://bugs.openjdk.org/browse/JDK-8211033?
> 
> As noted in that issue, this is a clean up of the code which determines the "mode" through with the `java` application is being launched. In its current form the presence of `--classpath` (or its equivalent arguments) was unnecessary updating the mode to `LM_CLASS`. The commit in this PR removes that part to allow for the mode to be detected based merely on the presence (or absence) of `-m`, `-jar`, `--source` options. If neither is specified, the file extension is checked to determine the launch mode. 
> 
> Given the nature of this clean up, no new tests have been introduced. Existing tests in tier1, tier2, tier3 continue to pass with this change.

On the surface this looks okay but just to double check: this has no impact on `java -cp <classpath> -jar app.jar`. The class path in that case is `app.jar`, the class path specified to -cp is ignored.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/21971#issuecomment-2464224551


More information about the core-libs-dev mailing list