RFR: 8163229: test test/tools/javac/CaptureInSubtype.java has a main method that is never executed Export [v2]
Archie L. Cobbs
duke at openjdk.org
Thu Nov 17 19:15:31 UTC 2022
> This PR deals with some housekeeping relating to compiler unit tests.
>
> JDK-8163229 points out that there are several tests that have a `public static void main(String[])` method, but because the test expects to fail during compilation, the test is never actually run, and so these `main` methods are just clutter that can be removed.
>
> However, there are also some tests where the test is never run, but the `main()` method generates one or more of the expected compilation errors. Obviously we need to keep those, but they don't need to be declared as `public static void main(String[])` which is misleading. So instead we rename these methods to `meth()`, and also we remove the `String[]` parameter when it's not needed by the test.
Archie L. Cobbs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
- Merge branch 'master' into JDK-8163229
- Rename or remove "main()" methods in tests that never actually run.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/10992/files
- new: https://git.openjdk.org/jdk/pull/10992/files/0dd3380c..ee28175a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=10992&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=10992&range=00-01
Stats: 36592 lines in 956 files changed: 13797 ins; 18971 del; 3824 mod
Patch: https://git.openjdk.org/jdk/pull/10992.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10992/head:pull/10992
PR: https://git.openjdk.org/jdk/pull/10992
More information about the compiler-dev
mailing list