RFR: 8210275: Source Launcher should fail if --source is used without a source file

mandy chung mandy.chung at oracle.com
Thu Sep 20 20:56:32 UTC 2018


On 9/20/18 12:08 PM, Jonathan Gibbons wrote:
> Please review a small fix to the source launcher that showed up as
> the launcher sometimes ignoring the --source option and finding/running
> a class on the class path.
>
> The problem occurs when the classpath is set after the --source option,
> causing LM_CLASS mode to override the setting of LM_SOURCE.
>
> In addition, some of the error messages that may be reported by the
> source launcher are improved to use "source file" instead of "file" as
> an indication that source-file mode is being used.
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8210275
> Webrev: http://cr.openjdk.java.net/~jjg/8210275/webrev.00/index.html

This looks fine.

FWIW.  It reads to me that the launcher mode should not be set to LM_CLASS
when parsing -cp option as it does not know the mode until all options are
parsed. Then set to LM_CLASS if mode == LM_UNKNOWN (if not set).
But this requires closer inspection of the current implementation and it's
something for the future.

Mandy


More information about the core-libs-dev mailing list