RFR: 8235876: Misleading warning message in java source-file mode [v2]

Adam Sotona asotona at openjdk.java.net
Wed Nov 24 13:52:36 UTC 2021


> 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

Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:

  removed obsolete part of the test

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6537/files
  - new: https://git.openjdk.java.net/jdk/pull/6537/files/ede3e33f..237ca7d6

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6537&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6537&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6537.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6537/head:pull/6537

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


More information about the compiler-dev mailing list