Integrated: 8235876: Misleading warning message in java source-file mode

Adam Sotona asotona at openjdk.java.net
Wed Nov 24 17:07:12 UTC 2021


On Wed, 24 Nov 2021 13:37:38 GMT, Adam Sotona <asotona at openjdk.org> wrote:

> Execution of  `java --source 7 Test.java` displays following warning: 
> `warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.` 
> 
> However use of `-Xlint:-options` is not allowed and so it proposes an invalid suggestion.
> 
> This is yet another case of "too much information" provided to user in source-file mode. 
> Target audience of source-file mode are Java beginners with very simple cases.
> Many options are not available in source-file mode and so this patch disables also related options warnings.
> 
> The case is similar to JDK-8268869
> 
> Patch adds `-Xlint:-options` into the list of default javac options in source-file mode.
> Relevant test is also provided.
> 
> Thanks,
> Adam

This pull request has now been integrated.

Changeset: 951247c8
Author:    Adam Sotona <asotona at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/951247c8cb4ea898bf7c188bed8e143ca7417c83
Stats:     16 lines in 2 files changed: 15 ins; 0 del; 1 mod

8235876: Misleading warning message in java source-file mode

Reviewed-by: vromero

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

PR: https://git.openjdk.java.net/jdk/pull/6537


More information about the compiler-dev mailing list